Not Solved added moderator name's colour
#23
Not Solved
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.
Reply


Messages In This Thread
added moderator name's colour - by fid - 2010-11-05, 07:26 PM
RE: added moderator name's colour - by fid - 2010-11-12, 07:58 PM
RE: added moderator name's colour - by Aaron - 2010-11-15, 10:31 AM
RE: added moderator name's colour - by fid - 2010-11-16, 08:01 PM
RE: added moderator name's colour - by adbrad - 2010-11-16, 11:00 PM
RE: added moderator name's colour - by fid - 2010-11-17, 05:56 AM
RE: added moderator name's colour - by adbrad - 2010-11-17, 09:22 AM
RE: added moderator name's colour - by fid - 2010-11-17, 03:51 PM
RE: added moderator name's colour - by adbrad - 2010-11-17, 04:38 PM
RE: added moderator name's colour - by fid - 2010-11-17, 06:59 PM
RE: added moderator name's colour - by - G33K - - 2010-11-18, 06:31 AM
RE: added moderator name's colour - by fid - 2010-11-18, 06:18 PM
RE: added moderator name's colour - by - G33K - - 2010-11-19, 12:06 AM
RE: added moderator name's colour - by fid - 2010-11-19, 08:46 AM
RE: added moderator name's colour - by - G33K - - 2010-11-19, 10:22 PM
RE: added moderator name's colour - by fid - 2010-11-20, 03:32 AM
RE: added moderator name's colour - by - G33K - - 2010-11-20, 08:53 PM
RE: added moderator name's colour - by fid - 2010-11-21, 03:30 PM
RE: added moderator name's colour - by adbrad - 2010-11-20, 09:09 PM
RE: added moderator name's colour - by - G33K - - 2010-11-21, 01:03 AM
RE: added moderator name's colour - by adbrad - 2010-11-21, 09:01 AM
RE: added moderator name's colour - by - G33K - - 2010-11-21, 09:29 AM
RE: added moderator name's colour - by adbrad - 2010-11-21, 09:34 AM
RE: added moderator name's colour - by - G33K - - 2010-11-21, 11:10 AM
RE: added moderator name's colour - by adbrad - 2010-11-21, 12:37 PM
RE: added moderator name's colour - by fid - 2011-04-11, 04:51 PM
RE: added moderator name's colour - by BuzzY - 2011-05-17, 01:33 PM
RE: added moderator name's colour - by fid - 2011-04-15, 04:16 PM

Forum Jump:


Users browsing this thread: 8 Guest(s)