I need to replace all of the mod code from an outdated youtube video embedding mod [ame] to [video].
Old code:
I want the new code to look like this:
Cleaner.php has this section to do the search and replace:
I want to add a $text = preg_replace with regex code to replace the old code.
I got this from stackoverflow:
and
The code looks right, but neither affected the thread text.
Anyone know how to make this work?
Old code:
Code:
[ame="http://www.youtube.com/watch?v=wYJ20INbM7Q"]YouTube - ‪Bill O'Reilly Interviews Rapper Lupe Fiasco - 06/20/11‬‏[/ame]
Code:
[video=youtube;wYJ20INbM7Q]http://www.youtube.com/watch?v=wYJ20INbM7Q[/video]
Code:
// BACK UP YOUR DATABASE
$replacer = array(
"" => "",
"" => "",
"" => "",
);
I got this from stackoverflow:
and
Code:
$text = preg_replace('|\[ame="http://www.youtube.com/watch\?v=([a-z0-9]+)"\]|i', '[video=youtube;$1]http://www.youtube.com/watch?v=$1[/video]', $text);
Anyone know how to make this work?


Comment