PDA

View Full Version : parse_template crazy trouble ! help !


alexhirurg
02-04-2007, 12:59 PM
I've spent several hours to fight with absolutely strange problem:

plugin parse_template:


$search='/\$stylevar\[imgdir_button\]\/edit.gif/';
$replace='$vboptions[cleargifurl]';

$vbulletin->templatecache['postbit_legacy'] = preg_replace($search,$replace,$vbulletin->templatecache['postbit_legacy']);


This changing string in template $stylevar[imgdir_button]/edit.gif, but as result of template string is empty !!! i.e. $vboptions[cleargifurl] not working ! but if i put it manually in 'postbit' template - it working well. why i can't do this in plugin ?
What's the shit ? can somebody explain ?

Only one solution that i found - this construction:

$replace="{$GLOBALS['vbulletin']->options['cleargifurl']}";


But Why ???
and how to do this correctly ?

Dismounted
02-06-2007, 04:19 AM
$replace = $vbulletin->options['cleargifurl'];

$vboptions only works in templates.