PDA

View Full Version : help with code


JIMRANGERS
12-03-2011, 12:25 PM
I use this code below


<vb:if condition="is_member_of($post, 17)" >
<img src="../images/premium.png"></img>
<vb:elseif condition="is_member_of($post, 11)" />
<img src="../images/sponsor.png"></img>
<vb:elseif condition="is_member_of($post, 18)" />
<img src="../images/new-member.png"></img>
<vb:elseif condition="is_member_of($post, 5)" />
<img src="../images/admin.png"></img>
<vb:elseif condition="is_member_of($post, 7)" />
<img src="../images/advisor.png"></img>
<vb:elseif condition="is_member_of($post, 23)" />
<img src="../images/VIP.png"></img>
<vb:else />
<img src="../images/member.png"></img>
</vb:if>

I would like to add some individual images to individaul members, not in the following usergroups above. I have tried using the following

<vb:if condition="$bbuserinfo['userid'] == x>

x being the members userid

but it seems to search userid and if theres a member with this number returns a true value thus displaying the image to everyone rather than to his profile only.

any help, pls?

kh99
12-03-2011, 12:34 PM
I think you want to check $post['userid'], and if you want it to be instead of the group images for certain users then you'll want to make it part of the existing if/elseif statement, but first. So something like this:

<vb:if condition="$post[userid] == X" >
<img src="../images/user_x.png"></img>
<vb:elseif condition="is_member_of($post, 17)" />
<img src="../images/premium.png"></img>
<vb:elseif condition="is_member_of($post, 11)" />
<img src="../images/sponsor.png"></img>
<vb:elseif condition="is_member_of($post, 18)" />
<img src="../images/new-member.png"></img>
<vb:elseif condition="is_member_of($post, 5)" />
<img src="../images/admin.png"></img>
<vb:elseif condition="is_member_of($post, 7)" />
<img src="../images/advisor.png"></img>
<vb:elseif condition="is_member_of($post, 23)" />
<img src="../images/VIP.png"></img>
<vb:else />
<img src="../images/member.png"></img>
</vb:if>

JIMRANGERS
12-03-2011, 01:04 PM
many thanks indeed

All sorted! :up: