2010-11-21, 11:10 AM
First change the compatibility of the plugin.
Next replace the usernamestyle_build_forumbits_forum function with this one.
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.
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.