Basically, I'm using a plugin on the fetch_musername hook to allow users to choose their own colour.
Here's the code:
PHP Code:
global $field7_cache;
if (!is_array($field7_cache))
{
$field7_cache = array();
}
$exclusives = array(
'Duck' => '#FFD953',
'Penguin' => '#8496B0',
'Emerald' => '#46C184',
'Ruby' => '#EB1264',
'Sapphire' => '#008AFB',
'Tourmaline'=> '#F7A9C3',
'Purple' => '#9D6DCD',
'Aquamarine'=> '#88E1FB',
'Silver' => '#A5A5A5',
'Orange' => '#DE5E12',
'Teal' => '#2D8181',
'Pink' => '#FF397F'
);
if($user['displaygroupid'] == 9)
{
if($user['field7'])
{
$field7_cache[$user['userid']] = $user['field7'];
}
else
{
$row = $vbulletin->db->query_first(sprintf("SELECT field7 FROM " . TABLE_PREFIX ."userfield WHERE userid = %d", $user['userid']));
$field7_cache[$user['userid']] = $row['field7'];
}
if($field7_cache[$user['userid']])
{
$field = $field7_cache[$user['userid']];
}
if($field)
{
$user['field7'] = $field;
}
$colour = $exclusives[$user['field7']];
$vbulletin->usergroupcache["9"]['opentag'] = "<span style=\"color: {$colour}; font-weight:bold\">";
$vbulletin->usergroupcache["9"]['closetag'] = "</span>";
$user['musername'] = $vbulletin->usergroupcache["9"]['opentag'] . $user['username'] . $vbulletin->usergroupcache["9"]['closetag'];
I'm using a plugin to show coloured usernames on forumdisplay and forumhome and I just wanted to make sure that my plugin isn't the cause of the issue before I decide to pull apart the other plugins.
Thanks in advance!