MyBB Community Forums

Full Version: find_replace_templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i never seem to be able to get this to work properly:

i can add things to templates, but when i go to remove it, it doesn't give an error just doesn't remove it, heres what i have:

Code:
function EMS_activate(){
    
    require MYBB_ROOT.'/inc/adminfunctions_templates.php';
    
    find_replace_templatesets('header', "#\<navigation>#", "<navigation><br />{\$messagestyle}{\$boardmessage}");
    
    }
function EMS_deactivate(){
    
    require MYBB_ROOT.'/inc/adminfunctions_templates.php';
    
    find_replace_templatesets('header', "#\<br />\{\$messagestyle\}\{\$boardmessage\}#", "");
    
    }

any ideas?
In the deactivate, try using this instead:
PHP Code:
find_replace_templatesets('header'"#\<br />\{\$messagestyle\}\{\$boardmessage\}#"""0); 
that didn't work :\
PHP Code:
function EMS_activate(){    
    require 
MYBB_ROOT.'/inc/adminfunctions_templates.php';
    
find_replace_templatesets(
        
"header",
        
'#'.preg_quote('<navigation>').'#',
        
'<navigation><br />
{$messagestyle}{$boardmessage}'
    
);
}
function 
EMS_deactivate(){    
    require 
MYBB_ROOT.'/inc/adminfunctions_templates.php';    
    
find_replace_templatesets(
        
"header",
        
'#'.preg_quote('<navigation><br />
{$messagestyle}{$boardmessage}'
).'#',
        
'<navigation>',
        
0
    
);

Ehh, I should've read it more, but Jan got it - thanks Smile
yup, working, now, thanks jan
Reference URL's