vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   variables in templates (https://vborg.vbsupport.ru/showthread.php?t=207610)

al3bed 03-07-2009 12:28 PM

variables in templates
 
hi,

I want know why this variable not identifed within template?

example:

in the plugin
PHP Code:

if ($vbulletin->options['options_product'] == 2){     
$slot $leaderboard; } 

when I use $slot within template it not show but when I make it without if statment it's shown:

PHP Code:

$slot $leaderboard

I need to do many options for each variable and the only way is to do if statment ..
any help

Lynne 03-07-2009 03:57 PM

So you aren't getting the variable if you put it in the if statement? Then obviously the if statement isn't evaling to true. So you need to look into why that is.

Dismounted 03-08-2009 04:47 AM

And the hook location is? Most likely, $vbulletin is not in scope.

al3bed 03-08-2009 12:29 PM

dear Lynne the if statement is cover a menu of 3 choices for each choice the variable take a value so I don't think that the if statement not evaling to true. like this one:

PHP Code:

if ($vbulletin->options['ain_code_custom'] == 1){
$ain_width 728$ain_height 90;}
elseif (
$vbulletin->options['ain_code_custom'] == 2){
$ain_width 468$ain_height 60;}
else { 
$ain_width 234$ain_height 60;} 

when I use $ain_width & $ain_height in a template it's not shown but if I assign if statement I don't get the variable.

hook name is parse_templates

Quote:

Most likely, $vbulletin is not in scope
how can I determine if hook in scope of $vbulletin?

--------------- Added [DATE]1236519897[/DATE] at [TIME]1236519897[/TIME] ---------------

sorry I found the problem .. it's not about if statement ..

I am just a stupid :D


All times are GMT. The time now is 06:25 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.01075 seconds
  • Memory Usage 1,723KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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