PDA

View Full Version : Secondary Usergroups Question


Glenn379
06-29-2009, 03:25 AM
Hey everyone.

I have another odd question I hope someone can answer. I just started to use a template mod for adding images based on usergroups. The following is an example of what I have:

<if condition="$post[usergroupid] == 10">
<img src="fainte/postbit/crimson_blades.gif" border="0">
<br>
</if>

<if condition="$post[usergroupid] == 11">
<img src="fainte/postbit/crimson_blades_officer.gif" border="0">
<br>
</if>


The problem is that I want to be able to display multiple images for each member based on their additional usergroups as well. Right now I have myself set up to both of those groups but only one image will display because it's my primary usergroup. Does anyone know if there is a code for secondary usergroups versus primaries? Does anyone have any other ideas? Thanks

HMBeaty
06-29-2009, 04:20 AM
Try this....it's also XHTML compliant :D
<if condition="is_member_of($vbulletin->userinfo, 10)">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="is_member_of($vbulletin->userinfo, 11)">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>

Glenn379
06-29-2009, 04:38 AM
Try this....it's also XHTML compliant :D
<if condition="is_member_of($vbulletin->userinfo, 10)">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="is_member_of($vbulletin->userinfo, 11)">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>

Thanks redline! I tried it but now nothing shows up :(

HMBeaty
06-29-2009, 04:45 AM
Ok, try THIS one, lol

<if condition="in_array($bbuserinfo[usergroupid], array(10))">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="in_array($bbuserinfo[usergroupid], array(11))">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>

Glenn379
06-29-2009, 04:56 AM
Ok, try THIS one, lol


It has the original problem. it shows the primary but not the secondary

HMBeaty
06-29-2009, 05:00 AM
ERRR!!! I used to know a conditional that checked if the users groups were primary and seconday but I can't remember it. I THOUGHT it was the first one I posted. The bad thing about these, is there's so many ways to do it. So, try this one...
<if condition="is_member_of($bbuserinfo, 10)">
<img src="fainte/postbit/crimson_blades.gif" alt="" border="0" />
<br />
</if>

<if condition="is_member_of($bbuserinfo, 11)">
<img src="fainte/postbit/crimson_blades_officer.gif" alt="" border="0" />
<br />
</if>

--------------- Added 1246256287 at 1246256287 ---------------

I'm assuming you got this working?

Glenn379
06-29-2009, 05:18 AM
ERRR!!! I used to know a conditional that checked if the users groups were primary and seconday but I can't remember it. I THOUGHT it was the first one I posted. The bad thing about these, is there's so many ways to do it. So, try this one...


Yay! Third one's the charm. :) Thank you!

The only issue is that everyone else on that page has the same thing now. Any ideas?

HMBeaty
06-29-2009, 05:21 AM
The only issue is that everyone else on that page has the same thing now. Any ideas?
What do you mean?

Glenn379
06-29-2009, 05:24 AM
There are two people registered ATM. We are both in userID 9. I have added myself to 9 with 10 and 11 as secondaries. The three images now show up where I want them but for whatever reason all three show up in his postbit too even though he isn't in all three.

HMBeaty
06-29-2009, 05:32 AM
Not sure about the answer to that one. Have you checked his profile in the AdminCP to make sure the other user doesn't have any additional usergroups selected?

Glenn379
06-29-2009, 05:46 AM
Not sure about the answer to that one. Have you checked his profile in the AdminCP to make sure the other user doesn't have any additional usergroups selected?

Yes I have and he isn't

--------------- Added 1246301472 at 1246301472 ---------------

They also only show up when logged in.