MyBB Community Forums

Full Version: Help for Forum-Team
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Are there anywhere settings where I can manipulate the Forum Team page?

First I want to give an order to the teams (right now I think it is just alphabetically).

Another think is, where can I switch it off, that the moderators are seen on this page (It is not in the moderator group). (Probably in the template)

I also would like to define which information is shown on this page (rather than showing the forum name, I like to show two custom ones).

Anybody any ideas?
The code is in showteam.php
The templates are in the "Show Forum Team Templates" category.

To remove the moderators list, just comment this code out with /* and */
$query = $db->query("SELECT m.fid, m.uid, u.username, u.usergroup, u.displaygroup, u.hideemail, u.receivepms, f.name FROM ".TABLE_PREFIX."moderators m LEFT JOIN ".TABLE_PREFIX."users u ON (m.uid=u.uid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=m.fid) ORDER BY u.username, f.name");
while($mod = $db->fetch_array($query))
{
	$modsarray[$mod['uid']] = $mod;
	if($modforums[$mod['uid']])
	{
		$modforums[$mod['uid']] .= "<br>";
	}
	$modforums[$mod['uid']] .= "<a href=\"forumdisplay.php?fid=$mod[fid]\">$mod[name]</a>";
}
if(is_array($modsarray))
{
	$bgcolor = "trow1";
	while(list($uid, $user) = each($modsarray))
	{
		$forumslist = $modforums[$uid];
		$uid = $user['uid'];
		$post['uid'] = $user['uid'];
		if($user['hideemail'] != "yes")
		{
			eval("\$emailcode = \"".$templates->get("postbit_email")."\";");
		}
		else
		{
			$emailcode = "";
		}
		if($user['receivepms'] != "no")
		{
			eval("\$pmcode = \"".$templates->get("postbit_pm")."\";");
		}
		else
		{
			$pmcode = "";
		}
		$username = formatname($user['username'], $user['usergroup'], $user['displaygroup']);
		$location = $user['location'];
		eval("\$modrows .= \"".$templates->get("showteam_moderators_mod")."\";");
		if($bgcolor == "trow1") 
		{
			$bgcolor = "trow2";
		}
		else
		{
			$bgcolor = "trow1";
		}
	}
	eval("\$usergroups .= \"".$templates->get("showteam_moderators")."\";");
}
Thanx for the code Smile.

So there are no settings, if I want to change something I have to hardcode it?
Yeah basically.
Do you have an idea how I could display custom fiels instead of the username?

Like I explained in the first post, instead of showing the Forum Name, I want to add to custom fields.

I already have an idea how to do the order think, I will test that later Smile
OK, I tried to put $post[fid4] in the showteam_usergroup_user after $user[username], but it does not show anythink. Do I have to add something to the showteam.php??

BTW To give an order to the Team, I just added a number in front of the groupname covert in brakets.

e.g. </1>
</2> etc.

I first tried <1 /> but that wasen't hidden.
In showteam.php, find this:
$query = $db->query("SELECT u.*, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."users u WHERE u.displaygroup IN ($teamquery) OR (u.displaygroup = 0 AND u.usergroup IN ($teamquery)) ORDER BY u.username ASC");
Replace with the following:
$query = $db->query("SELECT uf.*, u.*, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."userfields uf ON (uf.ufid=u.uid) WHERE u.displaygroup IN ($teamquery) OR (u.displaygroup = 0 AND u.usergroup IN ($teamquery)) ORDER BY u.username ASC");

And use $user[fid4] in the template.

(Untested code, please let me know whether it works or not)
I just found

$query = $db->query("SELECT u.*, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."users u WHERE u.usergroup IN ($teamquery) ORDER BY u.username ASC");

And replaced it with

$query = $db->query("SELECT uf.*, u.*, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."userfields uf ON (uf.ufid=u.uid) WHERE u.displaygroup IN ($teamquery) OR (u.displaygroup = 0 AND u.usergroup IN ($teamquery)) ORDER BY u.username ASC");

And it works very nicely Smile, Thanx a lot.
Hey, after upgrading, I realized that after the modification the E-Mail option is reversed on the page (so if you to choose not to display it, it does, and vice versa). Any idea and help?
Ok, your modifiactaion seems to be right Smile. The oroginal is still wrong.

http://community.mybboard.net/showthread.php?tid=5217