Discuz X3.2缩略图添加水印的方法 [复制链接]

moqu8 2017-2-5

6 0
DZ X3/3.2开启缩略图的时候水印只添加到原图上面,而缩略图上面无法进行水印图的添加,今天在站帮网说下缩略图添加水印方法。

1、打开source\function\function_post.php

2、查找
  1. $image->Watermark($_G['setting']['attachdir'].'/forum/'.$newattachfile[$aid], '', 'forum');
在其代码上面添加
  1. // 缩略图打水印
  2.          if (file_exists($_G['setting']['attachdir'] . '/forum/' . $newattachfile[$aid] . '.thumb.jpg')) {
  3.                     $image->Watermark($_G['setting']['attachdir'] . '/forum/' . $newattachfile[$aid] . '.thumb.jpg', '', 'forum');
  4.                 }
  5.                 // 缩略图打水印end
3、查找
  1. C::t('forum_attachment_unused')->delete($aid);

在其代码上面添加
  1. // 缩略图打水印
  2.        if (file_exists($_G['setting']['attachdir'] . '/forum/' . $attach['attachment'] . '.thumb.jpg')) {
  3.                 $image->Watermark($_G['setting']['attachdir'] . '/forum/' . $attach['attachment'] . '.thumb.jpg', '', 'forum');
  4.             }
  5.             // 缩略图打水印结束

修改好后上传覆盖即可。
最新回复 (0)
返回
支持中心
邮箱:winkill2012@qqcom
新站优化中!部分功能尚未完善,敬请谅解!
支持中心