Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 09-23-2004, 06:24 PM
d3f d3f is offline
 
Join Date: Feb 2002
Location: The Underground
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 09-23-2004, 08:34 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #3  
Old 09-23-2004, 09:34 PM
d3f d3f is offline
 
Join Date: Feb 2002
Location: The Underground
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 09-23-2004, 11:25 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 09-24-2004, 12:39 AM
d3f d3f is offline
 
Join Date: Feb 2002
Location: The Underground
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 09-24-2004, 07:56 AM
Milorad Milorad is offline
 
Join Date: Mar 2003
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

check THIS_SCRIPT, which is defined in each php file. index.php and showthread.php will have a different value for THIS_SCRIPT.
Reply With Quote
  #7  
Old 09-24-2004, 12:13 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah i think i got ya now.
But nope that's not possible, you have to use the THIS_SCRIPT constant for that.
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 02:25 AM.


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.04108 seconds
  • Memory Usage 2,206KB
  • 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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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