The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
conditional in forum description
Hi,
I'd like to have a vbulletin conditional to show an additional description section for a forum advertiser/sponsor in the forum description for a specific forum. The conditional statement doesn't seem to be working though. Code:
Regular Forum description. <vb:if condition="!is_member_of($bbuserinfo, 11,6)"><i>Sponsored Text</i>.</vb:if> |
#2
|
|||
|
|||
K so according to vbulletin.com it can only be done with a custom mod... anyone want to take a crack?
|
#3
|
||||
|
||||
I don't really see why you couldn't use an if conditional, provided your advertisers have their own usergroup. But in addition to the userinfo if conditional, you'd need a forumid if conditional, so they only show in those forums, to those usergroups.
|
#4
|
|||
|
|||
Hi,
I'm not sure I understand what you mean when you say the advertisers having their own usergroup... could you rephrase it? So instead of putting this conditional in the actual forum description box, put a conditional that shows the description in the appropriate forum template instead, and include the conditional for the usergroup and the forum id, right? |
#5
|
||||
|
||||
The code you posted above has Usergroups specified. So I presumed you were trying to show/hide something to/from a specific Usergroups. For instance...
Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">CODE HERE</vb:if> Code:
<vb:if condition="in_array($forum['forumid'], array(1,2,3))">CODE HERE</vb:if> More efficiently, you would combine them if you want both cases to be true. Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3) AND in_array($forum['forumid'], array(1,2,3))">CODE HERE</vb:if> And yes, they would go wherever the description for forums is displayed in the templates. (I forget which one that is, at the moment.) They are "template conditionals", so that's the only place they work. |
#6
|
|||
|
|||
I am also trying to do the same thing. I want a small line of text to be shown in a forum (actually, a category) description, but only to certain usergroups. The forum will be sponsored by an advertiser, but I only want Unregistered and partially registered usergroups to see the sponsor text.
This is the code I am using: Code:
<vb:if condition="is_member_of($bbuserinfo, 3,1,35,21,4)"> <b>Sponsored by ADVERTISER X - </b><a href="http://www.ADVERTISER X link.com" target="_blank">ADDITIONAL SPONSOR TEXT</a><img src="http://www.IMAGE.GIF" width="1" height="1" border="0"/> </vb:if> |
#7
|
||||
|
||||
Quote:
|
#8
|
|||
|
|||
Quote:
But when I use that code that I posted, those usergroups in the if condition see the text - but so does everyone else. The if condition is not being recognized, so vbulletin is displaying the text for everyone. |
#9
|
||||
|
||||
I don't see any reason off hand why it shouldn't be working. What template are you using this in, and are any of the Usergroups you're using Secondary Usergroups?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|