Quote:
Originally Posted by lulanglo
Hi Sarcoth,
really nice roster, I am trying to modifie the code to our guild need and i would like to have an icon instead of the name of the class, I am not a Vbulletin guru do you think you could help me ?
I created a Single-Selection Menu user profile field with a selection of 8 classes, what I am trying to do is do a if condition and show the right class icon acording to the selection.
here is what I tried but i cant get it to work
Code:
<td class="$bgclass" nowrap="nowrap">
<if condition="$user[field6] = warrior "><img src="images/classes/warrior_icon.gif" alt="Warrior" /><else />$user[field6]</if></td>
the icon is showing up but the problem is, it showing up even if field6 does not equal warrior...... and how can i do multiple statement ? like if it warrior show warrior_icon.gif and the same for 8 different class ?
Thank you.
|
Try this instead.
Open the showroster.php file.
Find:
Below it add:
Code:
$classurl = 'images/spacer.gif';
if ($user[field9] == 'Warrior') { $classurl = 'images/classes/warrior.gif'; }
if ($user[field9] == 'Bard') { $classurl = 'images/classes/bard.gif'; }
$classimage = '<img src="'.$classurl.'" border="0" alt="'.$user[field9].'">';
Add more if { } lines for additional classes and change the $classurl path to match the location and names of your images.
Then go to the showroster_userbits template.
Use this instead of the code you are using:
Code:
<td class="$bgclass" nowrap="nowrap">$classimage</td>
I don't see the need for a conditional here here as long as you list all the class if statements in the .php file. Since you already supply the user with a drop down with all the classes, they can't enter their own.
I hope that helps. I tested it and worked for me.