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); } } |
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]; } } |
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 織夢(mèng)dedeCMS刪除文章時(shí)同時(shí)刪除縮圖和內(nèi)容中大圖等附件