MyBB Community Forums

Full Version: Find replace templatesets
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, im running into problems with the code below

PHP Code:
find_replace_templatesets('postbit''{$post[\'usertitle\']}''RSN: <a href="highscores.php?rsusers={$post[\'fid4\']}">{$post[\'fid4\']}</a><br />{$post[\'usertitle\']}'); 

Basicly, it does absolutely nout to the templates but returns no error and I havent a clue whats wrong with it.

Can anyone help?

Thanks in advance,
Alec
Try this:
PHP Code:
find_replace_templatesets('postbit''#'.preg_quote('{$post[\'usertitle\']}').'#''RSN: <a href="highscores.php?rsusers={$post[\'fid4\']}">{$post[\'fid4\']}</a><br />{$post[\'usertitle\']}'); 
Cheers zinga! You always seem to be the one helping me here!

It worked perfectly! However how can I change that around to revert the changes on deactivate? Ive tried wiggling it around a but and still it doesnt revert the changes Sad
Sorry for double posting but I thought it better than starting a new topic.

Anyway how can I do the opposite of the code you gave me?

So I need the code to do the opposite of this for the deactivate function.
PHP Code:
find_replace_templatesets('postbit''#'.preg_quote('{$post[\'usertitle\']}').'#''RSN: <a href="highscores.php?rsusers={$post[\'fid4\']}">{$post[\'fid4\']}</a><br />{$post[\'usertitle\']}'); 

If anyone could help that would be awsome cos i've tried everything I can think of. REGEX completely baffles me though.
PHP Code:
find_replace_templatesets('postbit''#'.preg_quote('RSN: <a href="highscores.php?rsusers={$post[\'fid4\']}">{$post[\'fid4\']}</a><br />').'#'''0); 
Writing in a hurry, so not sure if that's right, but it should do it.
Zinga, I LOVE YOU!
Reference URL's