Quote:
Originally Posted by oldford
OK, finally got this to work. Here's the code if you want to have the "New Thread" button redirect to different forms for different forums. Don't forget to end with the correct number of </if> end tags to close out the code.
HTML Code:
<a href="<if condition="$foruminfo['forumid'] == 123">form123.php<else /><if condition="$foruminfo['forumid'] == 456">form456.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if></if>">
PKRWUD, it looks like the <elseif> code isn't supported by VB so you need to nest <if> instead. At least according to the manual:
http://www.vbulletin.com/docs/html/m...e_conditionals
|
This works great.
I am not sure if anyone else would do it this way but I have a lot of different forms and instead of typing the name of each form file name such as:
Code:
<if condition="$foruminfo['forumid'] == 123">form123.php<else />
I instead am using:
Code:
<if condition="$foruminfo['forumid'] == 123">form$foruminfo[forumid].php<else />
Means one less thing to edit when nesting a bunch of these if/else.
This brings me to another question, would it be possible to just have one if statement and use an array of some sort like:
Code:
<if condition="$foruminfo['forumid'] == 123,124,125,126">form$foruminfo[forumid].php<else />
I know this does not work but could it be done? I am a complete code newb so I wouldn't have the first clue if it's possible or what's involved but that would cut down on huge nesting.