The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Avatar based on Forum
I'm looking to see if anyone can create a hack that would allow a user to assign an secondary avatar that is displayed in another forum.
For example, if I were to have an RPG forum, the members could use their RPG character as the avatar in there, while having their "regular" avatar throughout the rest of the site. |
#2
|
|||
|
|||
After searching the entire vBulletin.org forums for exactly the same thing, and finidng nothing, I decided to make this myself. N.b. This is a template modification at the moment. I am working on a plugin but it wont be done for ages as it isn't high on my priority list at the moment.
First, you need to create a new User Profile Field. It is to be a text box that users can put a URL to an image in that will eventually be their own custom RPG avatar. Note down the field name for future use. Then, go to the style you want these changes to show in and edit templates. Find postbit or postbit_legacy. Then find the following code: Code:
<if condition="$show['avatar']"> <div class="smallfont"> <br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> </if> Code:
<if condition="$show['avatar']"> <if condition="in_array($thread[forumid], array(42, 70, 43, 149, 44, 146, 103, 145, 52, 65, 82, 73, 77, 74, 47, 137, 138, 139, 50, 108, 177, 176, 178, 143, 101, 164, 63, 175, 174, 147, 144, 182))"> <if condition="$post['field24']"> <div class="smallfont"> <br /> <a href="member.php?$session[sessionurl]u=$post[userid]"> <img src="$post[field24]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> <else /> <div class="smallfont"> <br /> <a href="member.php?$session[sessionurl]u=$post[userid]"> <img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> </if> <else /> <div class="smallfont"> <br /> <a href="member.php?$session[sessionurl]u=$post[userid]"> <img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> </if> </if> Look at the above code, you can see a long list of numbers in an array. Those numbers are the forum ids for the forums you want the avatars to change in. Adjust those numbers for the forum ids that are on your forums that you want the avatars to change in. Underneath that code there is an if conditional with "field24" listed. Replace the number 24 with whatever number your new custom user profile field is. Then do the same for the field24 part further down which is the image url for the avatar to use. And then you are done. Make sure to do the template changes in any styles you want this to work in. I have masses of templates on my forums so it took a while, but luckily it is just a copy and paste job and only in one template. |
#3
|
|||
|
|||
That sooooooo worked.
Thanks dude. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|