View Full Version : Conditionals on mod (THIS_SCRIPT)
eblivion
09-28-2004, 08:56 PM
vBulletin allows the use of <if condition="THIS_SCRIPT == 'page'">
to display different things based on the current page.
How do I get the similar affect with vBAdvanced?
They wouldn't provide any support to me since it's a mod.
I installed the vBAdvanced Homepage mod which is at: mydomain.com/index.php. All of the regular forum pages are at: mydomain.com/forum/xxx.php
I added the following to the phpinclude_start template:
define('THIS_SCRIPT2', '../page');
I wanted to use the same header file for all pages instead of the index_header on the vBAdvance page. In the header template, I added:
<if condition="$THIS_SCRIPT2 == 'index'">
do something
<else />
do this instead
</if>
It doesn't work. Am I doing something wrong?
nexialys
09-29-2004, 12:18 AM
you will not receive any support relatively to vBadvanced as it's a hack with a support forum, and it's not provided as part of vBulletin.. go to vbadvanced.com for this kind of requests...
btw, i suggest you upgrade to CMPS if you want to have a better control on your content.
Zachery
09-29-2004, 01:29 AM
THIS SCRIPT is a varible that is defined on a page,
define('THIS_SCRIPT2', '../page');
that becomes TRUE on EVERY page.
If you want it to become true on every page your going to need to do abit more work.
Logikos
09-29-2004, 02:34 AM
vBulletin allows the use of <if condition="THIS_SCRIPT == 'page'">
to display different things based on the current page.
How do I get the similar affect with vBAdvanced?
They wouldn't provide any support to me since it's a mod.
I installed the vBAdvanced Homepage mod which is at: mydomain.com/index.php. All of the regular forum pages are at: mydomain.com/forum/xxx.php
I added the following to the phpinclude_start template:
define('THIS_SCRIPT2', '../page');
I wanted to use the same header file for all pages instead of the index_header on the vBAdvance page. In the header template, I added:
<if condition="$THIS_SCRIPT2 == 'index'">
do something
<else />
do this instead
</if>
It doesn't work. Am I doing something wrong?
If you want to use the header your using on your forums. can't you find in the portal/index.php something that is calling the index_header template? Should look something like.
eval('$blah = "' . fetch_template('index_hader') . '";');
Just change to
eval('$header = "' . fetch_template('header') . '";');
If that is what you are trying to do,
eblivion
09-29-2004, 09:53 PM
If you want to use the header your using on your forums. can't you find in the portal/index.php something that is calling the index_header template? Should look something like.
eval('$blah = "' . fetch_template('index_hader') . '";');
Just change to
eval('$header = "' . fetch_template('header') . '";');
If that is what you are trying to do,
I did that...
The problem is that $THIS_SCRIPT only recognized php files in the directory of the forum. It doesn't work with things that are outside of the forum directory. That's why I was trying to figure out how to do something similar that recognizes php files in a different directory level.
What I'll do then, is just change the name of the vbAdvanced index page and place it in the same directory as the forum and use the server's Mod Rewrite feature to make it appear as if it's in my root directory. The $THIS_SCRIPT will work then.
~ Thanks for your help ~
Zachery
09-29-2004, 09:55 PM
THIS_SCRIPT works fine outside of the forum directory, i use it on my pages
http://www.usshomestarrunner.com (homeportal)
http://www.usshomestarrunner.com/smlinks (smlinks)
They both have their own identifiers
then i just do
<if condition="THIS_SCRIPT == homeportal">
or
<if condition="THIS_SCRIPT == smlinks">
eblivion
09-29-2004, 09:57 PM
you will not receive any support relatively to vBadvanced as it's a hack with a support forum, and it's not provided as part of vBulletin.. go to vbadvanced.com for this kind of requests...
btw, i suggest you upgrade to CMPS if you want to have a better control on your content.
Thanks,
I'll take a look at CMPS.
eblivion
09-29-2004, 11:50 PM
THIS_SCRIPT works fine outside of the forum directory, i use it on my pages
http://www.usshomestarrunner.com (homeportal)
http://www.usshomestarrunner.com/smlinks (smlinks)
They both have their own identifiers
then i just do
<if condition="THIS_SCRIPT == homeportal">
or
<if condition="THIS_SCRIPT == smlinks">
Thanks. I know what to do now. I was thinking that the value for 'THIS_SCRIPT' was dynamic like a server variable is. I just realized that it's specified in each of the pages.
~ Thanks again ~
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.