修复qTranslate卸载后的文章标题和内容
[php]< ?php
require_once('wp-config.php');
$link = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db (DB_NAME, $link);
$str = "SELECT ID,post_title,post_content FROM wp_posts where post_status='publish' order by ID desc limit 40";//
$ra = mysql_query($str);
while($r = mysql_fetch_array($ra)){
$r['post_title'] = preg_replace('|<\!--:en-->.*< \!--:-->|','',$r['post_title']);
$r['post_title'] = addslashes (preg_replace('|< \!--:zh-->(.*)< \!--:-->|','$1',$r['post_title']));
if (strpos($r['post_content'],'')!==false){
$r['post_content']=substr($r['post_content'],0,strpos($r['post_content'],''));
}
$r['post_content'] = addslashes (str_replace(array('',''),array('',''),$r['post_content']));
$str="update wp_posts set post_title='$r[post_title]',post_content='$r[post_content]' where ID=$r[ID]";
mysql_query($str);
}
mysql_close($link);
?>[/php]