The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Conditional only if in childforum
Lets say I have 6 forums:
Main-1 - Sub -2 Another-Main-3 - Other-Sub-4 - Another-Sub-5 -- Sub-of-Another-Sub-6 I am looking for a way to check, if a forum is a childforum of a certain forum. Like this, but I only want to put in the main forum. <vb:if condition="in_array($forum['forumid'], array(3))"></vb:if> <vb:if condition="$forum[forumid] == 3"></vb:if> In this excample if I say ID 3 (which is "Another-Main-3") I want the conditional also be true if the user is in forum 4,5 and 6. Any ideas how I can achive this? |
#2
|
||||
|
||||
Try using $foruminfo['parentlist'] to check to see if the forum is a child of forumid = 3.
|
#3
|
|||
|
|||
You mean like this?
<vb:if condition="$foruminfo['parentlist'] == 3"></vb:if> |
#4
|
||||
|
||||
No, the variable $foruminfo['parentlist'] is an array, so you need:
HTML Code:
<vb:if condition="in_array(3, $foruminfo['parentlist'])"></vb:if> |
#5
|
|||
|
|||
Thanks, but doesnt work for me
I can access {vb:raw $foruminfo['parentlist']} but I cant use it in a conditional. --------------- Added [DATE]1437594358[/DATE] at [TIME]1437594358[/TIME] --------------- I want to modify the title in some subforums. I guess I have to write a plugin anyway... |
#6
|
||||
|
||||
Because you don't use {vb:raw . . . } inside a conditional, use the code Mark provided in his post.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|