对应模块class.php set函数 如:article.class.php
if($this->itemid) {
$post['editor'] = $_username;
$new = $post['content'];
if($post['thumb']) $new .= '<img src=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif'.$post['thumb'].'http://www.qiyeyunshang.com/skin/gw/image/nopic.gif/>';
$r = $this->get_one();
$old = $r['content'];
if($r['thumb']) $old .= '<img src=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif'.$r['thumb'].'http://www.qiyeyunshang.com/skin/gw/image/nopic.gif/>';
//delete_diff($new, $old); //注释该语句即可
}
delete函数
删除文章时删除相关图片文件。
if($all) {
$userid = get_user($r['username']);
//if($r['thumb']) delete_upload($r['thumb'], $userid);
//if($r['content']) delete_local($r['content'], $userid);
$this->db->query(http://www.qiyeyunshang.com/skin/gw/image/nopic.gifDELETE FROM {$this->table} WHERe itemid=$itemidhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif);
$content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
$this->db->query(http://www.qiyeyunshang.com/skin/gw/image/nopic.gifDELETe FROM {$content_table} WHERe itemid=$itemidhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif);
if($MOD['cat_property']) $this->db->query(http://www.qiyeyunshang.com/skin/gw/image/nopic.gifDELETe FROM {$this->db->pre}category_value WHERe moduleid=$this->moduleid AND itemid=$itemidhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif);
if($r['username'] && $MOD['credit_del']) {
credit_add($r['username'], -$MOD['credit_del']);
credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid);
}
}
删除信息删除相关图片 include/ post.inc.php
clear_upload函数
//本次上传的图片文件 如果在thumb跟内容字段里没有那么删除。
foreach($_SESSION['uploads'] as $file) {
if(strpos($content, $file) === false) {
echo http://www.qiyeyunshang.com/skin/gw/image/nopic.gif$filehttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif;
//delete_upload($file, $_userid); //注释这句
} else {
if($DT['uploadlog'] && $itemid) $update[] = http://www.qiyeyunshang.com/skin/gw/image/nopic.gif'http://www.qiyeyunshang.com/skin/gw/image/nopic.gif.md5($file).http://www.qiyeyunshang.com/skin/gw/image/nopic.gif'http://www.qiyeyunshang.com/skin/gw/image/nopic.gif;
}
}