discuz! x3.2 分类信息中图片加水印方法 《DZ3.4测试有效》

[复制链接]
查看722 | 回复0 | 2019-4-22 22:52:40 | 显示全部楼层 |阅读模式
找到文件:
source/class/extend/extend_thread_sort.php
中找到代码public function after_newthread()类中
在下面三行代码后添加红色部分
if($_G['forum_optionlist'][$optionid]['type'] == 'image') {
$identifier = $_G['forum_optionlist'][$optionid]['identifier'];
$sortaids[] = intval($_GET['typeoption'][$identifier]['aid']);
require_once libfile('class/image');
$image = new image;
$imgoptiondata = dunserialize($value);


if($_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark'])) {
$image->Watermark($imgoptiondata['url'], '', 'forum');
$update['filesize'] = $image->imginfo['size'];
}
}

红色为添加的代码
上传覆盖同名文件,更新缓存测试  
3.4测试亲测有效

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则