James Birkett
07-09-2010, 11:40 AM
I have a plugin running on the fetch_musername hook that changes the username mark-up depending on a selection in their profile.
The plugin is:
if((!empty($user['field14'])) && ($user['displaygroupid'] == 40)){
switch($user['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
}
Now, this plugin works around some areas (profile, posts) but it fails to work on things like visitor messaging and the who's online display block.
Has anyone got any ideas how to fix this?
I'd take a guess that it's because I'm using the $user variable, that isn't globally available... so perhaps I would have to change the conditional too...
Would I have to declare the $post['fieldX'] and $bbuserinfo['fieldX'] in there too?
EDIT: I tried this code too, and it failed to work:
if((!empty($user['field14'])) && ($user['displaygroupid'] == 40)){
switch($user['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
switch($post['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
switch($bbuserinfo['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
}
--------------- Added 1278698556 at 1278698556 ---------------
Bump.
Sorry guys, this is something I've been looking at for ages and I can't debug it :(
The plugin is:
if((!empty($user['field14'])) && ($user['displaygroupid'] == 40)){
switch($user['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
}
Now, this plugin works around some areas (profile, posts) but it fails to work on things like visitor messaging and the who's online display block.
Has anyone got any ideas how to fix this?
I'd take a guess that it's because I'm using the $user variable, that isn't globally available... so perhaps I would have to change the conditional too...
Would I have to declare the $post['fieldX'] and $bbuserinfo['fieldX'] in there too?
EDIT: I tried this code too, and it failed to work:
if((!empty($user['field14'])) && ($user['displaygroupid'] == 40)){
switch($user['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
switch($post['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
switch($bbuserinfo['field14']){
case 'Ice Blue':
$user['musername'] = "<span style=\"color:#74BBFB; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Tree Green':
$user['musername'] = "<span style=\"color:#9CDE7B; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Orange':
$user['musername'] = "<span style=\"color:#F38330; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Pink':
$user['musername'] = "<span style=\"color:#EA3884; font-weight:bold;\">".$user['username']."</span>";
break;
case 'Purple':
$user['musername'] = "<span style=\"color:#B290C0; font-weight:bold;\">".$user['username']."</span>";
break;
}
}
--------------- Added 1278698556 at 1278698556 ---------------
Bump.
Sorry guys, this is something I've been looking at for ages and I can't debug it :(