![]() |
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:
|
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))"> |
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. |
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.
|
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 |
The code is in Opserty's post man. :)
|
It it all in my post... I can't understand what you don't get...
Quote:
Code:
<if condition="$forumid == 1"> |
Except that the "Displayed to ..." text now doesn't match the conditions. ;)
-- hugh |
~ Edited.
|
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? |
Why didn't you say! :p
Instead of $forumid try $foruminfo['forumid'] and if that doesn't work try $thread['forumid'] or $post['forumid']. One of them is bound to work! If it doesn't...what template are you putting this code it? |
Quote:
But now I want first finish for members becouase it is easier. Later I will see how to made this for guests. OK, I will try now what you said. --------------- Added [DATE]1203251199[/DATE] at [TIME]1203251199[/TIME] --------------- I will post this code so you will be able to see what is wrong. Note this is code just for members. Foruminfo, thread and post does not made anything different. Still GENERAL banner is displayed on all forums. Code:
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND ($show[member])"> |
Have you changed Instead of $forumid as I said above?
Quote:
|
Quote:
To clear this, code was like this $foruminfo['77'], or like this $foruminfo[77], $thread['77'] or $post['77'] but still general banner is allways displayed? |
NO! lol :p
Just substitute the text in as I gave it to you. So $forumid becomes $foruminfo['forumid']! Simple ;) |
Quote:
This code working. Code:
<if condition="$thread['forumid'] == 77"> |
No problem. Glad you finally got it working. :)
|
All times are GMT. The time now is 10:42 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|