MyBB Community Forums

Full Version: Problem with find_replace_templatesets function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am using this function to find the variable
{$posticons}
and replace it.
Using this:

find_replace_templatesets("newthread", '{$posticons}', '', 0);
yields nothing.
Nor with:
find_replace_templatesets("newthread", preg_quote('{$posticons}'), '', 0);

Why doesn't it work? The template name is correct so is the variable
Try this:

// replace with...
find_replace_templatesets('newthread', '#{$posticons}#', '', 0);

Also, are you calling this before you do the find_replace function?

require MYBB_ROOT.'inc/adminfunctions_templates.php';
Didn't work and yes i do include that file.
How about this...

find_replace_templatesets('newthread', '#\n{\$posticons}#', '', 0); 
Also doesn't work.
find_replace_templatesets("newthread", "#".preg_quote('{$posticons}')."#i", '', 0);

find_replace_templatesets('newthread', '#{\$posticons}#', '', 0);
Both don't work.
The {$posticons} variable not removed from your newthread template with that code?
Yep, still there.

EDIT: You guys can test them yourselves to see they don't work...i have no idea why they don't work.
RateU's first example works fine for me.

find_replace_templatesets("newthread", "#".preg_quote('{$posticons}')."#i", '', 0);
Pages: 1 2