MyBB Community Forums

Full Version: Help with template_
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?
Which part is it not doing?

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");

And I would also store them as strings. It makes life easier if you need to change one of them. Only do the below once you know the above works.
$find = "\$lang->delete_pm</a>(\r|\n)*";
$replace = "\$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", '#'.preg_quote($find).'#', $find."\n".$replace);
....
find_replace_templatesets("private_read", '#'.preg_quote($replace).'#', "", 0);
none works