The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to made if and else in vbulletin?
Hello, I want to put code in postbit so that I am able to have in some specific forums banners but when I don't have them (too many) than one common banner or message. Thanx in advance.
So here is the code and explanation inside that code: Code:
OPTION I <if condition="!in_array($forumid, array(FORUMID1))"> <td class="alt1" align="center"> <div> <a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="banner_path.jpg" border="0" alt="$vboptions[bbtitle]" /></a></td> <if /> OPTION II <if condition="!in_array($forumid, array(FORUMID2))"> <td class="alt1" align="center"> <div> <a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="banner_path.jpg" border="0" alt="$vboptions[bbtitle]" /></a></td> <if /> IF NOT OPTION I AND OPTION II, THAN GENERAL OPTION <if condition="!in_array($forumid, array(ANY OTHER FORUM ID))"> <td class="alt1" align="center"> <div> MARKETING </div> </td> <if /> |
#2
|
|||
|
|||
I'm not sure what you are asking really but is this what you want:
Code:
<if condition="in_array($forumid, array(1, 2, 3))"> Displayed to users in forum 1, 2 & 3 <else /> <if condition="in_array($forumid, array(4, 5, 6)"> Displayed to users in forum 4, 5 & 6 <else /> Displayed to everyone who is NOT in forum 1, 2, 3, 4, 5 or 6 </if> </if> |
#3
|
|||
|
|||
No, I want to display different banners for different forums, no different user groups.
Banner 1 for forumID35 Banner 2 for forumID67 ... Banner 5 for forumID32 Banner 6 for all other forum ID's on my forum So we need command else and if. I know something about that, but I don't have idea how to made that in vbulletin. I want to display different banners on different forums, so I have few banners (for example 5) and I want every banner for one forum. So five banners for five forums. Now becouase I have more than for example 50 forums, for rest I want to display one general banner, so when users are on the forums which don't have own banner (from group of the 5 banners) I want to display one general banner. |
#4
|
|||
|
|||
Ops has it right, if I get your meaning. Use the first conditional to show your forum specific banners (if condition = forum 1/2/3), else show the default banner.
|
#5
|
|||
|
|||
Quote:
Option I for forumid1 if not Option II for forumid2 if not Option III for forumid3 if not GENERAL OPTION for rest of the forums |
#6
|
|||
|
|||
The code is in Opserty's post man.
|
#7
|
|||
|
|||
It it all in my post... I can't understand what you don't get...
Quote:
Code:
<if condition="$forumid == 1"> Displayed to users in forum 1 <else /> <if condition="$forumid == 2"> Displayed to users in forum 2 <else /> Displayed to everyone who is NOT in forum 1 or 2 </if> </if> |
#8
|
||||
|
||||
Except that the "Displayed to ..." text now doesn't match the conditions.
-- hugh |
#9
|
|||
|
|||
~ Edited.
|
#10
|
|||
|
|||
Quote:
How is now I think that code displey banner from third (general) option on all forums, even on forum id 1 and forum id 2? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|