MyBB Community Forums

Full Version: Add Edit Profile button to managegroup.php page for Moderators & other additions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'd like to add an edit profile button on this page so that when you are looking at all your group members you can got straight to edit profile in the Mod CP without having to go to the users profile and then click edit profile in mod cp.

I know I have to edit the templates to add columns

and something in this section of the managegroup.php page

Can someone show me the edit please?

while($user = $db->fetch_array($query))
	{
		$altbg = alt_trow();
		$regdate = my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $user['regdate']);
		$post = $user;
		$sendpm = $email = '';
		if($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$post['ignorelist'].",", ",".$mybb->user['uid'].",") === false)
		{
			eval("\$sendpm = \"".$templates->get("postbit_pm")."\";");
		}
		
		if($user['hideemail'] != 1)
		{
			eval("\$email = \"".$templates->get("postbit_email")."\";");
		}
		else
		{
			$email = '';
		}
		$query1 = $db->simple_select("groupleaders", "uid", "uid='{$user['uid']}' AND gid='{$gid}'");
		$isleader = $db->fetch_array($query1);
		$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
		$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
		if($isleader['uid'])
		{
			$leader = $lang->leader;
		}
		else
		{
			$leader = '';
		}
Add to that while loop:
if($mybb->usergroup['canmodcp'])
{
   $user['editlink'] = '<a href="'.$mybb->settings['bburl'].'/modcp.php?action=editprofile&amp;uid='.$user['uid'].'">Edit Profile</a>';
}

Then add {$user['editlink']} to managegroup_user template.
Awesome, worked like a charm.... thanks
I would also now like to add a single additional user group title to a column. Is this possible?
ok new route:

I know additionalgroups could contain a series of group id numbers, but if I just want to identify if it contains 1 number of the series of group id numbers:

how can I do that:

if($user['additionalgroups'] contains the number '85'

I believe I got it, if anyone else needs to knowBig Grin

if (stripos(','.$user['additionalgroups'].',', ',85,') !== false)