The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Images displayed before Username for certain Usergroups
Hi Guys,
I need to know if there is a plugin out there, that allows me to set an option to display an image before the username; if a user is in a certain usergroup. If not, how would I go about creating one, so it displays everywhere on my forum? I know this can be done with HTML Mark-up, but I want it done my way, so that the HTML Mark-up of this group, don't interfere with other Usergroups. Example: A user can be Premium and apart of this group with the image still displayed left of their username, without affecting the username colour. Any help is appreciated. |
#2
|
|||
|
|||
I'm not sure if this exists already, but you could create a plugin using hook fetch_musername and add image code to $user['musername']. Like:
Code:
if (is_member_of($user, X)) { $user['musername'] = "<img src='images/someimg.gif'>" . $user['musername']; } |
#3
|
|||
|
|||
Quote:
But is this; If User is UserID add image or If user is a member of UsergroupID add images? The second would be preferred ofcourse, but I shall try this nonetheless. |
#4
|
|||
|
|||
Quote:
The second one. 'X' is a groupid, and can be the primary group or any secondary group. (BTW, you can also list more values if you want, like is_member_of($user, X, Y, Z...) |
#5
|
|||
|
|||
Quote:
Code:
Parse error: syntax error, unexpected ':' in /home/tactical/public_html/includes/functions.php(1620) : eval()'d code on line 3 |
#6
|
|||
|
|||
Oops, there was a typo - should have been ')' instead of ':' -
Code:
if (is_member_of($user, X)) { $user['musername'] = "<img src='images/someimg.gif'>" . $user['musername']; } Also you need to be careful to use single quotes in your img tag. If you still get an error, post your exact code here. |
#7
|
|||
|
|||
Works brilliantly, thanks KH99, great help as always.
Also to anyone who's trying this and wants text to be displayed when hovering over the Image. Change this: Code:
<img src='X'> Code:
<img src='X' title='Y'> Tested and working |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|