The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Simple Conditional Statement
Hello,
I'm slowly learning to manipulate the templates in vbulletin. There are two things I would like to do and was wondering if anyone can help. Please tell me if it is inappropriate to post this here, as I am new to all this 1) A conditional statement in a template 2) have it so announcements appear right in the forum, the way they do in invision power board 1)Conditionak Statement: I have altered templates so that certain templates call up html pages, so that they can display different sidebars for different sections. This is working just fine. What I would like to now is to have the "Forum Display" template call up a specific template based on the forum ID #. And then if I don't have a specific template set for that forum id, it defaults to a standard one. In other words it should be a conditional statement I place in the template, such as, in plain english IF Forum ID = 1 then display $myfooter1 IF Forum ID =2 then display $myfooter2 Or Else diplay $myfooter_default I just don't know the exact language 2) Announcement in forum The second change, is that I would like to alter the forum display template so that instead of the announcement appearing as a link, the actual text of the anouncement appears instead. (It should not have the announement title, username, avatar, etc, of the person leaving the announcement, only the text of that announcement) Thanks, Sam |
#2
|
|||
|
|||
a simple way to do this via templates with the first one. (normally I'd do it another way, but this way is simple to do)
Add the code to your forumdisplay template Code:
<if condition="$forumid == 4"> stuff for forumid 4 </if> <if condition="$forumid == 5"> stuff for forumid 5 </if> <else> default stuff </if> |
#3
|
||||
|
||||
Quote:
Code:
<if condition="$foruminfo[forumid] == 4"> stuff for forumid 4 <else /> <if condition="$forumid == 5"> stuff for forumid 5 <else /> default stuff </if> </if> |
#4
|
|||
|
|||
yeah, that's the more efficient way
though if efficiency is the goal I'd do it in php as oppose the vb template conditionals. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|