the first option is not good cause i need to change a <div> tag and i cant find such in the compiled template .
about this code :
PHP Code:
if ( $vbulletin->options['active_users_onoff'] ) {
$jsvar = vB_Template::create('active_users_js')->render();
vB_Template::preRegister('SHOWTHREAD',array('jsvar' => $jsvar));
$vbulletin->templatecache['SHOWTHREAD'] = str_replace('<head>','<head> \' . $jsvar . \' ',$vbulletin->templatecache['SHOWTHREAD']);
}
1. it worked for me, why is that if i used the <head> to do the replace ?
2. why here i must use preRegister .
3. tried this on global_complete with no success at all :
PHP Code:
if ( $vbulletin->options['active_users_onoff'] AND THIS_SCRIPT=='SHOWTHREAD' ) {
$replace = ' <!-- Refresh Button -->
<vb:if condition="$vbulletin->options[\'active_users_onoff\']">
<button onclick="showUsers()" type="button" style="float:left;"> {vb:rawphrase refresh_button} </button>
</vb:if>
<div id="thread_active_users">' . PHP_EOL . ' <p>' ;
// vB_Template::preRegister('SHOWTHREAD',array('replace' => $replace));
$output = str_replace('<p>', '\'' . $replace . '\'' ,$output);
}
of course i need to change the div also but i kept it with the <p> just to see if there is a change.
also, on global_complete can i use {vb:rawphrase.. ?
after its compiled - its a php code. after its rendered - does it includes the {vb:rawphr... or puts a text instead already ?
Thanks alot for the help .