All pastes #589142 Raw Edit

Someone

public php v1 · immutable
#589142 ·published 2007-06-25 20:57 UTC
rendered paste body
$sql = 'SELECT post_id, post_text   FROM ' . POSTS_TABLE;$result = $db->sql_query($sql);$inctimes = 0;while ($row = $db->sql_fetchrow($result)){	$message_parser->message = &$row['post_text'];	$regexp = '/\&lt;div class=\"quote\"\&gt;.*Quoting: ([^&]*)&lt;\/div&gt;([^&]*)&lt;\/div&gt;/iUe';  	$times = 0;	$times = preg_match_all($regexp, $message_parser->message, $matches);	if($times > 0){		echo '<p> ' . $row['post_id'] . ' has ' . $times . ' match(es). </p>';	}	$inctimes = $inctimes + $times;		preg_replace($regexp,"[quote=\"$1\"]$2[/quote]",$message_parser->message);		//Update DB with change	$sql = 'UPDATE ' . POSTS_TABLE . ' SET post_text = ' . $db->sql_escape($message_parser->message) . '		WHERE post_id = ' . $row['post_id'];	$db->sql_query($sql);}echo '<p> There should be ' . $inctimes . ' modifications to the database </p>';