PDA

View Full Version : Why does str_replace works, but not eval($navbar='') on FORUMHOME?


ThorstenA
08-15-2008, 06:11 AM
To add a template on forumhome_complete, this works:
$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar','$navbar'.fetch_template('cu stom'),$vbulletin->templatecache['FORUMHOME']);
but that not:
eval('$navbar .= "' . fetch_template('custom') . '";');

I am curious why :)

Opserty
08-15-2008, 09:00 AM
If I remember correctly, $navbar gets eval()'d right at the end of the page, most likely after the forumhome_complete hook. So it will just overwrite the custom template.

You could check by looking for the hook in the index.php and see its location compared to where the navbar is eval()'d