$replace using a custom template

Not really sure if OK to ask here, since this question isn’t exactly related to this website.

In short, I’m lost why one code is, and an almost similar code isn’t working.

Working:
[php]$search = addslashes(‘‘);
$replace = addslashes(‘ test’);

$vbulletin->templatecache = str_replace($search, $replace.$search, $vbulletin->templatecache);[/php]
Not working:
[php]$search = addslashes(‘‘);
$replace = $vbulletin->templatecache;

$vbulletin->templatecache = str_replace($search, $replace.$search, $vbulletin->templatecache);[/php]
Working:
[php]$search = addslashes(‘

3 thoughts on “$replace using a custom template”

  1. nexia dit :

    $headinclude instead of $vbulletin->templatecache … because $headinclude is constructed at the end of init.php…

  2. Taragon dit :

    Using $headinclude didn’t work I’m afraid (read didn’t work for me)

    Managed to get it to work however
    parse_templates
    [php]$vbulletin->templatecache .= $vbulletin->templatecache;[/php]
    cache_templates
    [php]global $globaltemplates;
    $globaltemplates[] = ‘vbdock_facebox’;[/php]
    vbdock_facebox
    [html] [/html]
    Again, much appreciated (Y)

  3. nexia dit :

    oh, i did not notice where you had it hooked… the problem was actually the addslashes wrongly written… 🙂

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.

En savoir plus sur Un Papa Pro

Abonnez-vous pour poursuivre la lecture et avoir accès à l’ensemble des archives.

Continue reading