All pastes #589190 Raw Edit

Someone

public php v1 · immutable
#589190 ·published 2007-06-25 21:17 UTC
rendered paste body
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;/i';  	$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 if there was one	if($times > 0){		$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>';