The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Conditonal Questions?
I was just woundering if there was anyway to do a conditional for "Template is Forumhome" or "Template is not showthread" so I could add content that appears to everyone but make it only show up in my sidebar on certain templates/pages.
Thanks in advanced. |
#2
|
||||
|
||||
Questions about modifying vBulletin's default behaviour and asking about modifications in general, should be posted in General vBulletin Questions. Please read the forum descriptions more carefully in future. I've moved your thread there for you
Thanks, - Dean ---------------- On topic you should be able to use <if condition="THIS_SCRIPT == 'showthread'"></if> |
#3
|
|||
|
|||
Thanks dean, this works great but dosnt use the template name, it uses the "define('THIS_SCRIPT', 'index');" line from each file, is there anyway to use a conditonal based on if the template name, perhaps if you have Add Template Name in HTML Comments enabled? or would this require some sort of code edit.
|
#4
|
||||
|
||||
i don't see what you are trying.
if you are editing the template, you should know which template you edit, and therefore a conditional in that template related to a template name would be useless, because it would be either always true or always false. you can just use a conditional for checking which script is running, and that would be Deans way. Or am i getting something totally wrong now? |
#5
|
|||
|
|||
ok say I defined a template in global.php with something like
eval('$mytemplate = "' . fetch_template('mytemplate') . '";'); as a global template now lets say somewhere I want to use in forumhome and some other specific templates <if condition="$bbuserinfo['usergroupid'] != 6"> $mytemplate </if> now in my header I want something like <if conditon="templatepresent == mytemplate"> some other content assoiated with mytemplate but does not reside within it </if> I want to know if thats possible. |
#6
|
|||
|
|||
check THIS_SCRIPT, which is defined in each php file. index.php and showthread.php will have a different value for THIS_SCRIPT.
|
#7
|
||||
|
||||
ah i think i got ya now.
But nope that's not possible, you have to use the THIS_SCRIPT constant for that. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|