PDA

View Full Version : Avatar by User Profile Fields


Arminios
08-31-2007, 03:21 PM
I'm wondering if someone could come up with a code for me that will choose avatar out from User Profile Fields if no Avatar is selected.

I'm running a World of Warcraft guild forum on http://www.victrix-guild.com and would like for everyone to have a avatar. Atm I got http://img464.imageshack.us/img464/2228/noavatarjw2.jpg as a standard avatar if nothing is selected.

Been hacking a little on my postbit, and it should be possible to forexample set "Troll_Female_Rogue.gif as a avatar if they have selected troll, female and rogue in "Edit Profile"

This is the code I use for my faction, race, class and profession icons


<if condition="$post[fieldA] && $post[fieldB]" && $post[fieldC]><img src="images/wow/$post[fieldA]_$post[fieldB]_$post[fieldC].gif" alt="$post[fieldA] $post[fieldB] $post[fieldC]"></if>



This is the avatar code


<if condition="$show['avatar']">
<div class="smallfont">
&nbsp;<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>





edit:
--------------------------------------------------------------------------------------
I shouldn't have asked, as it was very easy to do so when actually taking the time to just merge them together.

If you want to do this yourself you can use the following code:
<if condition="$show['avatar']">
<div class="smallfont">
&nbsp;<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>
<else />
<if condition="$post[field5] && $post[field7] && $post[field13]"><img src="images/wow/$post[field5]_$post[field7]_$post[field13].gif" alt="$post[field5] $post[field7] $post[field13]"></if>
</if>


User Profile Field 5 is called "Class" and are a single selection menu with these options:

Druid
Hunter
Rogue
Mage
Paladin
Priest
Shaman
Warlock
Warrior


User Profile Field 7 is called "Race" and are a single selection menu with these options:

Blood Elf
Orc
Tauren
Troll
Undead


User Profile Field 13 is called "Gender" and are a single selection menu with these options:

Female
Male



I have files like this in the /images/wow folder:

Warrior_Tauren_Female.gif
Warrior_Tauren_Male.gif
Warrior_Undead_Female.gif
...and so on...

These are then avatars.