Help with template_
#1
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?
Reply
#2
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);
Reply
#3
none works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)