query($q); while ($set->next()) { $node_content=$set->getString('node_content'); $new_content=preg_replace_callback("/(http:\/\/www.kyberia.sk\/([a-zA-Z]*).php)?\?(action=([a-zA-Z]*))?\&(node_id=([0-9]*))?(\&alone=([0-9]*))?/i","changeRegExp",$node_content); if ($new_content!=$node_content) { $node_id=$set->getString('node_id'); $new_content=AddSlashes($new_content); $db->query("update node_content set node_content='$new_content' where node_id='$node_id'"); echo $node_id." updated
"; } } function changeRegExp($match) { global $db; if ($match[8]) { $q="select node_id from nodes where node_type='4' and old_id='".$match[8]."'"; $s=$db->query($q); $s->next(); $id=$s->getString('node_id'); return "/id/$id"; } else { if ($match[4]=='forum') { $q="select node_id from nodes where node_type='3' and old_id='".$match[6]."'"; $s=$db->query($q); $s->next(); $id=$s->getString('node_id'); return "/id/$id"; } } } ?>