<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦dede删除文章时怎样同时删除缩图和内容中大图

时间:2020-12-21

织梦dede删除文章时怎样同时删除缩图和内容中大图,这问题很多朋友都提到了,下面笔者给大家回答下:

打开dede/inc/inc_batchup.php找到"http://删除数据库的内容"
在这前面加上

//删除缩略图
if($arcRow['litpic']!=""){
$dsql->ExecuteNoneQuery("Delete From uploads where url='$arcRow[litpic]'");
$truedir = GetTruePath($arcRow['siterefer'],$arcRow['sitepath']);
$litpicfile = $truedir.$arcRow['litpic'];
@unlink($litpicfile);
}
//删除大图
$arcbodyQuery = "Select * from ".$arcRow['addtable']." where aid='$aid'";
$arcbodyRow = $dsql->GetOne($arcbodyQuery);
$imgsrcarray=GetImageSrc($arcbodyRow['body']);
foreach ($imgsrcarray as $v) {
if((trim($v)!="")&&(!eregi("^http://",$v))){
$dsql->ExecuteNoneQuery("Delete From uploads where url='$v'");
$picfile = $truedir.$v;
@unlink($picfile);
}
}

//删除数据库的内容

第二处:
找到
Select archives.ID,archives.title,archives.typeid
改为:
Select archives.ID,archives.title,archives.typeid,archives.litpic

第三处:
在文件最后加上一函数
//获得内容中的图像地址
function GetImageSrc($body){
if( !isset($body)) return '';
else{
preg_match_all ("/<(img|IMG)(.*)(src|SRC)=[\"|'|]{0,}([h|\/].*(jpg|JPG|gif|GIF))[\"|'|\s]{0,}/isU",$body,$out);
return $out[4];
}
}

0
首页
案例
关于
联系