<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">

观点

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

织梦删除空间中多余的没有被引用的图片

时间:2020-12-21

在用织梦建站的时候,我们时常会删除一些文章,但是有个问题,就是删除文章的同时,文章内的图片还保存在网站空间中,占用了服务器资源。我曾经就有过一次,无用的图片达到八百多MB,要是手动去删,何年何月啊。 

一般来说有二种情况,我们分别来操作:

1、删除文章的同时,删除该文章内的图片,

打开dede/inc/inc_batchup.php

第一处找到

"http://删除数据库的内容"

在这前面加上

01 //删除缩略图
02 if($arcRow['litpic']!=""){
03 $dsql->ExecuteNoneQuery("Delete From dede_uploads where url='$arcRow[litpic]'");
04 $truedir = GetTruePath($arcRow['siterefer'],$arcRow['sitepath']);
05 $litpicfile = $truedir.$arcRow['litpic'];
06 @unlink($litpicfile);
07 }
08 //删除大图
09 $arcbodyQuery = "Select * from ".$arcRow['addtable']." where aid='$aid'";
10 $arcbodyRow = $dsql->GetOne($arcbodyQuery);
11 $imgsrcarray=GetImageSrc($arcbodyRow['body']);
0