TrigZu
12-27-2010, 11:24 AM
RESOLVED
Hey guys, thanks for checking out my thread, I don't really know if this part is considered coding, but here I go...
This is from the memberaction_dropdown template; the goal is to have VIP member's usernames to show up as a custom color that they set. I realize I could concatenate the VIP and Field check in the example below, but I didn't to break things up more clearly. The issue is that on Firefox & IE $memberinfo['field7'] is showing up as empty, but on Google Chrome it works fine.
Modified Snippet From memberaction_dropdown template:
<vb:if condition="$memberinfo['musername']">
//If the user is VIP
<vb:if condition="is_member_of($memberinfo,17)">
//And the user has a custom color set
<vb:if condition="$memberinfo['field7']">
//Display the user's name in the color they want
<span style="color: {vb:raw memberinfo.field7};">{vb:raw memberinfo.username}</span>
//If the VIP member doesn't have a custom color
<vb:else />
//Display the regular color for that member group (VIP)
{vb:raw memberinfo.musername}
</vb:if>
//If the member isn't a VIP then display the regular color set for that member group
<vb:else />
{vb:raw memberinfo.musername}
</vb:if>
//It never gets here, but just display the username if it does
<vb:else />
{vb:raw memberinfo.username}
</vb:if>
Original Snippet From memberaction_dropdown template:
<vb:if condition="$memberinfo['musername']">
{vb:raw memberinfo.musername}
<vb:else />
{vb:raw memberinfo.username}
</vb:if>
Obviously I don't use the comments in the template like that, those are just there for you guys. At one point I had said "++++ it, I'm just going to edit the musername part in functions.php," but that didn't work either. The same issue happened. It's like when I try to check if they're part of the VIP usergroup (#17) it breaks field7, otherwise it works fine (but then it's applied to everyone instead of just VIPs).
Here's the changes I made to functions.php later.
Modified Snippet From functions.php:
$user['musername'] = $vbulletin->usergroupcache["$displaygroupid"]['opentag'] . $username . $vbulletin->usergroupcache["$displaygroupid"]['closetag'];
//If the user is VIP then set $user['musername'] to the VIPs color, otherwise leave it alone.
$user['musername'] = is_member_of($user,17) ? '<span style="color: ' . $user['field7'] . 'font-weight: bold;">' . $username . '</span>' : $user['musername'];
Original Snippet From functions.php:
$user['musername'] = $vbulletin->usergroupcache["$displaygroupid"]['opentag'] . $username . $vbulletin->usergroupcache["$displaygroupid"]['closetag'];
Here's a link to a thread if you'd like to see what's going on visually. Test is the VIP member in question.
http://darklandservers.com/showthread.php?3192-PM-Limit&p=36177#post36177
His name should show up white if it's working, and blue if it's not (the default VIP color). You can test it in Chrome and Firefox and see what I'm talking about, I've already had other people test it.
Honestly, I'm really disappointed in myself for not being able to get this to work out. Asking for help was the last thing I wanted to do, but I've set my (coder's) pride aside for now because I've been pulling my hair out for too long trying to get this to work. I'm going on vacation today and won't be able to work on it for another 3 or 4 days so I'm trying to get this resolved now rather than later. Big thanks to anyone who can help. :D
/rage
What really makes me angry is that I know that this should be easy. I mean, just the concept is so basic. Maybe if I get some sleep this will be easier. I think it would make my day if it turned out not to be me just being stupid, but I have a feeling that's not the case.
--------------- Added 1293505911 at 1293505911 ---------------
Nevermind. It appears as though only people in my forum moderator group can see the name's properly. I'm trying to find out what permissions they might have that would do that.
--------------- Added 1293513494 at 1293513494 ---------------
Got it, because the field was private it wouldn't let the regular members get anything. When I was testing on Google Chrome I was using a moderator account.
Hey guys, thanks for checking out my thread, I don't really know if this part is considered coding, but here I go...
This is from the memberaction_dropdown template; the goal is to have VIP member's usernames to show up as a custom color that they set. I realize I could concatenate the VIP and Field check in the example below, but I didn't to break things up more clearly. The issue is that on Firefox & IE $memberinfo['field7'] is showing up as empty, but on Google Chrome it works fine.
Modified Snippet From memberaction_dropdown template:
<vb:if condition="$memberinfo['musername']">
//If the user is VIP
<vb:if condition="is_member_of($memberinfo,17)">
//And the user has a custom color set
<vb:if condition="$memberinfo['field7']">
//Display the user's name in the color they want
<span style="color: {vb:raw memberinfo.field7};">{vb:raw memberinfo.username}</span>
//If the VIP member doesn't have a custom color
<vb:else />
//Display the regular color for that member group (VIP)
{vb:raw memberinfo.musername}
</vb:if>
//If the member isn't a VIP then display the regular color set for that member group
<vb:else />
{vb:raw memberinfo.musername}
</vb:if>
//It never gets here, but just display the username if it does
<vb:else />
{vb:raw memberinfo.username}
</vb:if>
Original Snippet From memberaction_dropdown template:
<vb:if condition="$memberinfo['musername']">
{vb:raw memberinfo.musername}
<vb:else />
{vb:raw memberinfo.username}
</vb:if>
Obviously I don't use the comments in the template like that, those are just there for you guys. At one point I had said "++++ it, I'm just going to edit the musername part in functions.php," but that didn't work either. The same issue happened. It's like when I try to check if they're part of the VIP usergroup (#17) it breaks field7, otherwise it works fine (but then it's applied to everyone instead of just VIPs).
Here's the changes I made to functions.php later.
Modified Snippet From functions.php:
$user['musername'] = $vbulletin->usergroupcache["$displaygroupid"]['opentag'] . $username . $vbulletin->usergroupcache["$displaygroupid"]['closetag'];
//If the user is VIP then set $user['musername'] to the VIPs color, otherwise leave it alone.
$user['musername'] = is_member_of($user,17) ? '<span style="color: ' . $user['field7'] . 'font-weight: bold;">' . $username . '</span>' : $user['musername'];
Original Snippet From functions.php:
$user['musername'] = $vbulletin->usergroupcache["$displaygroupid"]['opentag'] . $username . $vbulletin->usergroupcache["$displaygroupid"]['closetag'];
Here's a link to a thread if you'd like to see what's going on visually. Test is the VIP member in question.
http://darklandservers.com/showthread.php?3192-PM-Limit&p=36177#post36177
His name should show up white if it's working, and blue if it's not (the default VIP color). You can test it in Chrome and Firefox and see what I'm talking about, I've already had other people test it.
Honestly, I'm really disappointed in myself for not being able to get this to work out. Asking for help was the last thing I wanted to do, but I've set my (coder's) pride aside for now because I've been pulling my hair out for too long trying to get this to work. I'm going on vacation today and won't be able to work on it for another 3 or 4 days so I'm trying to get this resolved now rather than later. Big thanks to anyone who can help. :D
/rage
What really makes me angry is that I know that this should be easy. I mean, just the concept is so basic. Maybe if I get some sleep this will be easier. I think it would make my day if it turned out not to be me just being stupid, but I have a feeling that's not the case.
--------------- Added 1293505911 at 1293505911 ---------------
Nevermind. It appears as though only people in my forum moderator group can see the name's properly. I'm trying to find out what permissions they might have that would do that.
--------------- Added 1293513494 at 1293513494 ---------------
Got it, because the field was private it wouldn't let the regular members get anything. When I was testing on Google Chrome I was using a moderator account.