内容替换控制台
输入框存在未填写项,请认真填写后重试!
';
} else{
$old=$_POST['oldurl'];
$new=$_POST['newurl'];
$lei=$_POST['lei'];
if($lei=='video-thumb'||$lei=='video-mp4'||$lei=='video-fm'||$lei=='post-text'||$lei=='post-title'||$lei=='page-text'||$lei=='page-title'||$lei=='comments-text'||$lei=='comments-url'){
$db = Typecho_Db::get();
$prefix = $db->getPrefix();
$data_name=$prefix.'contents';
//文章内容或标题
if($lei=='post-text'||$lei=='post-title'){
if($lei=='post-text'){$lei='text';}
if($lei=='post-title'){$lei='title';}
$db->query("UPDATE `{$data_name}` SET `{$lei}`=REPLACE(`{$lei}`,'{$old}','{$new}') WHERE type='post'");
}
//独立页面内容或标题
if($lei=='page-text'||$lei=='page-title'){
if($lei=='page-text'){$lei='text';}
if($lei=='page-title'){$lei='title';}
$db->query("UPDATE `{$data_name}` SET `{$lei}`=REPLACE(`{$lei}`,'{$old}','{$new}') WHERE type='page'");
}
//自定义字段
if($lei=='video-thumb'||$lei=='video-mp4'||$lei=='video-fm'){
$data_name=$prefix.'fields';
if($lei=='video-fm'){$lei='fm';}
if($lei=='video-thumb'){$lei='thumb';}
if($lei=='video-mp4'){$lei='mp4';}
$db->query("UPDATE `{$data_name}` SET `str_value`=REPLACE(`str_value`,'{$old}','{$new}') WHERE name='{$lei}'");
}
//评论内容
if($lei=='comments-text'||$lei=='comments-url'){
$data_name=$prefix.'comments';
if($lei=='comments-text'){$lei='text';}
if($lei=='comments-url'){$lei='url';}
if($new=='null'||$new=='NULL'){$new='';}
$db->query("UPDATE `{$data_name}` SET `{$lei}`=REPLACE(`{$lei}`,'{$old}','{$new}')");
}
}else{
echo '
表单参数疑似被篡改提交异常!
';
}
?>
内容替换完成!请等待自动刷新!