PDA

View Full Version : variables in templates


al3bed
03-07-2009, 12:28 PM
hi,

I want know why this variable not identifed within template?

example:

in the plugin
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:

$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:

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

Most likely, $vbulletin is not in scope

how can I determine if hook in scope of $vbulletin?

--------------- Added 1236519897 at 1236519897 ---------------

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

I am just a stupid :D