The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
So I'm trying to setup a hook on fetch_musername
And when the user matches certain characteristics, I force-change their musername to a different style. Problem is, when I do that, it changes it for EVERYONE. Makes no sense to me...
This is the plugin on the hook: Code:
if (is_member_of($vbulletin->userinfo, 31)) { $user[musername] = "<strong><span style='color: #FF66FF'>" . $username . "</span></strong>"; } Any ideas? |
#2
|
||||
|
||||
What hook are you placing this in?
|
#3
|
||||
|
||||
Your condition says "if you the viewer are a member of group 31, then change....". So yes, if you the viewer are a member of group 31, then all the usernames will be changed.
|
#4
|
|||
|
|||
to clarify, I want it to only work for members of usergroup 31.
however, it does it for EVERY single user, regardless of usergroup... I don't understand how that's possible. I'm playing it under the hook fetch_musername. |
#5
|
||||
|
||||
There is a difference between the *viewer* of the page being a member of group 31, and the page/post belonging to a member of group 31. Your condition is for the first - the viewer of the page. "if the viewer of the page is in group 31, change the username in this way" either all user names on the page will be changed, or they won't - depending on the group the *viewer* is a member of.
If you are talking about a showthread page, and want the *posters* username to change based on whether the *poster* is in usergroup 31 or not (who cares what the usergroup id of the viewer is), then that is a different condition - you would probably use the variable $user['usergroupid'] in the condition. |
#6
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|