vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Conditionals on mod (THIS_SCRIPT) (https://vborg.vbsupport.ru/showthread.php?t=69965)

eblivion 09-28-2004 08:56 PM

Conditionals on mod (THIS_SCRIPT)
 
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

Quote:

Originally Posted by eblivion
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.

PHP Code:

eval('$blah = "' fetch_template('index_hader') . '";'); 

Just change to
PHP Code:

eval('$header = "' fetch_template('header') . '";'); 

If that is what you are trying to do,

eblivion 09-29-2004 09:53 PM

Quote:

Originally Posted by Live Wire
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.

PHP Code:

eval('$blah = "' fetch_template('index_hader') . '";'); 

Just change to
PHP Code:

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

Quote:

Originally Posted by nexialys
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

Quote:

Originally Posted by Zachery
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 ~


All times are GMT. The time now is 11:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00977 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete