MyBB Community Forums

Full Version: Help with find_replace_templatesets()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
find_replace_templatesets("private_read", '#\$lang->delete_pm</a>(\r?)(\n?)#', "\$lang->delete_pm</a>\n| <a href=\"pmreport.php\?pmid=\$pm\[pmid\]&amp;action=report\" onClick=\"popupWin('pmreport.php\?pmid=\$pm\[pmid\]&amp;action=report', 'reportPm', 400, 300); return false;\">Report</a>\n");

find_replace_templatesets("private_read", '#| <a href="pmreport.php\?pmid=\$pm\[pmid\]&amp;action=report" onClick="popupWin(\'pmreport.php\?pmid=\$pm\[pmid\]&amp;action=report\', \'reportPm\', 400, 300); return false;">Report</a>(\r?)(\n?)#', "", 0);


Those dont seem to work Sad Am I doing something wrong?
You probably need to backslash the | and ( and )
Replied to your other topic on mybb mods.
nothing works Sad
heres the file, if you want to take a look at it. Everything works except the find_replace_templatesets() part
in case u were sure that this is the right thing to find, then replace

try to use for exaple

find_replace_templatesets("postbit", '#'.preg_quote('$post[onlinestatus]').'#', '$post[onlinestatus] $post[country]');
using preg_quote u will not have to escape all the things. maybe u have missed 1 or somthing not sureConfused

regards
Wont it parse the variables though? Dont those need to be \'ed out manually?
well yea, I know that. but dont you have to put a \ behind any variable ($variablehere for instance) so it doesnt get parsed by the Zend Engine
Well with none of the times i used preg_quote , i had to put \ before $variable !!

however make a test file and check it

regards