Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 09-28-2004, 08:56 PM
eblivion eblivion is offline
 
Join Date: Sep 2004
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 09-29-2004, 12:18 AM
nexialys
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #3  
Old 09-29-2004, 01:29 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 09-29-2004, 02:34 AM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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,
Reply With Quote
  #5  
Old 09-29-2004, 09:53 PM
eblivion eblivion is offline
 
Join Date: Sep 2004
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ~
Reply With Quote
  #6  
Old 09-29-2004, 09:55 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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">
Reply With Quote
  #7  
Old 09-29-2004, 09:57 PM
eblivion eblivion is offline
 
Join Date: Sep 2004
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 09-29-2004, 11:50 PM
eblivion eblivion is offline
 
Join Date: Sep 2004
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ~
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04282 seconds
  • Memory Usage 2,236KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (7)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete