The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Add image next to avatar
I am trying to figure out how to add one or more images next to a user's avatar, depending upon whether they belong to specific classes. What I'd like to do is create hidden user profile fields, and then depending on whether a user belongs to one of these categories, a small image will appear next to the user's avatar.
I've seen this on numerous sites, usually for different levels of donars. I just can't figure out how to do it. Does anyone know of any existing hacks for this? Thanks |
#2
|
|||
|
|||
maybe the awards hack is what you thinking of ?
|
#3
|
|||
|
|||
I found something under "perks" but it doesn't work for vBulletin 2.9
|
#4
|
||||
|
||||
What do you mean by "depending on whether a user belongs to one of these categories".. By catagories do you mean usergroups? If so, just create the new usergroup, then in functions.php
Find: Code:
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";"); } Code:
if ($post[usergroupid] ==X) { $image = "<img src=\"http://www.yoursite.com/forums/images/specialimage.gif\">"; } else { $image=""; } You could also do it based on custom profile fields if thats what you mean. But you'd need to add the drop down profile field selection hack first. |
#5
|
|||
|
|||
Thanks for the tip, but I just can't make it work.
I wasn't sure if you meant Postbit or Postbit_avatar, so I tired various combinations with both. This is what I used: In Postbit <a name="post$post[postid]"></a> $post[firstnewinsert] <normalfont><b>$post[username]</b></normalfont><br> <smallfont>$post[usertitle]</smallfont><br> $post[avatar]<br />Feild name: $post[field9]$image <smallfont>Registered: $post[joindate]<br> Location: $post[field2]<br> Posts: $post[posts]</smallfont></td> In Postbit_avatar <img src="$avatarurl""$image" $imageborder="0" alt=""> In neither case did it work. |
#6
|
||||
|
||||
I meant the postbit, not postbit_avatar.
What exactly did you put in functions.php? Copy and paste it here and I'll tell you why its not working. |
#7
|
|||
|
|||
Thanks,
This is the relevant portion of functions.php: } if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) { $post[avatar]=""; } else { eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";"); } if ($post[usergroupid] ==14) { $image = "<img src=\"http://usslibertyinquiry.com/forums/images/PH.gif\">"; } else { $image=""; } |
#8
|
||||
|
||||
Are you sure that you put the correct usergroup id? I just tested it on my board and it works fine.
|
#9
|
|||
|
|||
In Admin, I opened up User Groups and moused over the selected group. Down below, it showed the group id as 14.
In functions.php it is written as "==14" Are there supposed to be two equal signs? Also, is it enough to just use "14" or does it need to be "usergroupid14"? Finally, in postbit, is this the correct placement of $Image: $post[avatar]<br />Feild name: $post[field9]$image Thanks, Ron |
#10
|
||||
|
||||
Your functions.php code is correct. I copied the code from your post and pasted it into my functions.php then changed the usergroupid to 6 (admin) and it worked fine.
Make sure when you add the $image text to your postbit that its all smallcase, just like the code in functions.php. I don't know what else could be causing it not to work for you. You have actually added some people to the new usergroup, correct? If nobody is in that usergroup then you're not gonna see anything. Just to test it, try changing the usergroup ID to 6.. You should then see the image in all admins posts. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|