PDA

View Full Version : Plugin problem


vsforums
02-04-2011, 06:18 PM
I got in plugin code:

$content = "<if condition=\"THIS_SCRIPT != 'adv_index'\">something</if>";

$vbulletin->templatecache['headinclude'] = $vbulletin->templatecache['headinclude'] . fetch_template('my_template');
eval('$vbulletin->templatecache[\'headinclude\']');

and in my_template I have:
$content

and unfortunately in page source I see those ifs....
I should see only "something" if I'm on adv_index without those ifs.
<if condition="THIS_SCRIPT != 'adv_index'">something</if>

Anyone any idea how to do that ? I cant place those ifs in template...
Is this doable? How?

kh99
02-04-2011, 07:16 PM
I don't know if there's a way to do that in a template, that's an interesting question.

But I think you'd just need:


if (THIS_SCRIPT != 'adv_index')
{
$content = 'something';
}


then the template stuff.

ETA:...or maybe
$content = (THIS_SCRIPT != 'adv_index') ? somthing : '';