Help with template_ - Ryan Gordon - 2006-03-11
find_replace_templatesets("private_read", '#\$lang->delete_pm</a>(\r?)(\n?)#', "\$lang->delete_pm</a>\n| <a href=\"pmreport.php\?pmid=\$pm\[pmid\]&action=report\" onClick=\"popupWin('pmreport.php\?pmid=\$pm\[pmid\]&action=report', 'reportPm', 400, 300); return false;\">Report</a>\n");
find_replace_templatesets("private_read", '#| <a href="pmreport.php\?pmid=\$pm\[pmid\]&action=report" onClick="popupWin(\'pmreport.php\?pmid=\$pm\[pmid\]&action=report\', \'reportPm\', 400, 300); return false;">Report</a>(\r?)(\n?)#', "", 0);
Those dont seem to work Am I doing something wrong?
RE: Help with template_ - decswxaqz - 2006-03-11
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\]&action=report\" onclick=\"popupWin('pmreport.php\?pmid=\$pm\[pmid\]&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\]&action=report\" onclick=\"popupWin('pmreport.php\?pmid=\$pm\[pmid\]&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);
RE: Help with template_ - Ryan Gordon - 2006-03-11
none works
|