MyBB Community Forums

Full Version: added moderator name's colour
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I could look at it but no promises Wink
Here is the plugin
http://mods.mybb.com/archive/view/username-style
If you could get it to work on 1.6 would be good.
when you activate the plugin you will see any moderators you have listed get change to moderator guest.
First change the compatibility of the plugin.

Next replace the usernamestyle_build_forumbits_forum function with this one.

function usernamestyle_build_forumbits_forum(&$forum)
{
	global $db, $mybb, $lang, $templates, $moderatorcache, $modlistsetting;
	
	// Moderator column is not off
	$mybb->settings['modlist'] = $modlistsetting;
	
	if($mybb->settings['modlist'] != 0)
	{
		$moderators = "";
		$done_moderators = array(
					"users" => array(),
					"groups" => array()
				);
		$parentlistexploded = explode(',', $forum['parentlist']);
		foreach($parentlistexploded as $mfid)
		{
			if(is_array($moderatorcache[$mfid]))
			{
				foreach($moderatorcache[$mfid] as $modtype)
				{
					foreach($modtype as $moderator)
					{
						if($moderator['isgroup'])
						{
							if(in_array($moderator['id'], $done_moderators['groups']))
							{
								continue;
							}
							$moderators .= $comma.htmlspecialchars_uni($moderator['title']);
							$done_moderators['groups'][] = $moderator['id'];
						}
						else
						{
							if(in_array($moderator['id'], $done_moderators['users']))
							{
								continue;
							}
							$moderators .= "{$comma}<a href=\"".get_profile_link($moderator['id'])."\">".format_name(htmlspecialchars_uni($moderator['username']),$moderator['usergroup'],$moderator['displaygroup'])."</a>";
							$done_moderators['users'][] = $moderator['id'];
						}
						$comma = ", ";
					}
				}
			}
		}
		$comma = "";
		
		if($moderators)
		{
			eval("\$forum['modlist'] = \"".$templates->get("forumbit_moderators")."\";");
		}
		else
		{
			$forum['modlist'] = "";
		}
	}
	
	// To avoid overwriting by original code segment
	$mybb->settings['modlist'] = 0;
	
	// Format lastposter name
	$query = $db->simple_select("users", "usergroup, displaygroup", "uid = '".$forum['lastposteruid']."'");
	$user = $db->fetch_array($query);
	
	$forum['lastposter'] = format_name($forum['lastposter'], $user['usergroup'], $user['displaygroup']);
}

Note: This will only fix this in the forumbit, I did not check and did not fix anything else. For that please contact the plugin author.
Thanks dude,
i've been trying to get an answer for that since 1.6 was launched as i use this plugin i edited the file as above and now it works, it was only the forumbit that was broke in the plugin that was the only reason i never used it.
(2010-11-20, 08:53 PM)- G33K - Wrote: [ -> ]Just use notepad or wordpad to edit the files and then upload them to your ftp.

bro,it's work.thank you so much for everything.
hi there..

need some favour...how about group?do i need to edit the same file?
anybody?
(2011-04-11, 04:51 PM)fid Wrote: [ -> ]hi there..

need some favour...how about group?do i need to edit the same file?
im too interested %)
Pages: 1 2 3