The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Identifying the forum a thread lives in using <if condition>
Does anyone know if there is a way to identify the Forum for which a thread belongs to so that I can give a set of threads a custom style without using a seperate style sheet and attaching it to a forum group.
Thats how I've done it in the past, but it becomes a bit messy if things change down the line. Essentially I have a News forum with several sub forums, every thread within news needs to look different to the threads on the rest of the site. |
#2
|
|||
|
|||
I think it might depend on what php file is being displayed. Do you know what php code is actually printing out your news threads?
|
#3
|
|||
|
|||
I'm not sure what you mean by that? the url that shows in the address bar doesn't have any reference to parent forums.
|
#4
|
|||
|
|||
The variables that are available to test in the template "if" condition are set in the php code. I looked at showthread.php and noticed that $post has a lot of the thread info but doesn't have the forums id. The forum id seems to be in $thread['forumid']. But that's when the url is 'showthread.php', so you could try that but it might not work for you if the page is not showthread.php.
|
#5
|
|||
|
|||
Not sure what to do with that but I'll give it a try thanks.
|
#6
|
||||
|
||||
What he's basically asking is what page (or template) are you trying to do the conditon in? The page, and template, will define what the name of the variable to use should be.
|
#7
|
|||
|
|||
I've got this working in showthread.php
<if condition="$forum[forumid] == 104"><div id="article"></if> I can't however get this working for multiple forumids <if condition="$forum[forumid] == 104 OR 25 OR 35"><div id="article"></if> I will also need to do this on forumdisplay.php but I haven't got to that bit yet. Thanks for the help so far, its making things alot easier. |
#8
|
||||
|
||||
HTML Code:
<if condition="in_array($forum['forumid'], array(104, 25, 35))"><div id="article"></if> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|