crx349 发表于 2015-4-18 11:21:19

discuz! x3.2 分类信息中图片加水印方法

source/class/extend/extend_thread_sort.php
中为extend_thread_sort类,
在其方法public function after_newthread()中


if($_G['forum_optionlist'][$optionid]['type'] == 'image') {
$identifier = $_G['forum_optionlist'][$optionid]['identifier'];
$sortaids[] = intval($_GET['typeoption'][$identifier]['aid']);

改成
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'];

上传覆盖同名文件,更新缓存测试
页: [1]
查看完整版本: discuz! x3.2 分类信息中图片加水印方法