Discuz X3.2/X2.5缩略图添加水印方法

时间:2019-01-02 16:06作者:网友投稿
  Discuz X3/X2.5默认开启缩略图的时候水印只添加到原图上面,而缩略图上面无法进行水印图的添加,今天在站帮网说下缩略图添加水印方法。   1、打开source\function\function_post.php   2、查找 $image->Watermark($_G['setting']['attachdir'].'/forum/'.$newattachfile[$aid], '', 'forum'); 复制代码 在其代码上面添加 // 缩略图打水印          if (file_exists($_G['setting']['attachdir'] . '/forum/' . $newattachfile[$aid] . '.thumb.jpg')) {                     $image->Watermark($_G['setting']['attachdir'] . '/forum/' . $newattachfile[$aid] . '.thumb.jpg', '', 'forum');                 }                 // 缩略图打水印end 复制代码 3、查找 C::t('forum_attachment_unused')->delete($aid); 复制代码 在其代码上面添加 // 缩略图打水印        if (file_exists($_G['setting']['attachdir'] . '/forum/' . $attach['attachment'] . '.thumb.jpg')) {                 $image->Watermark($_G['setting']['attachdir'] . '/forum/' . $attach['attachment'] . '.thumb.jpg', '', 'forum');             }             // 缩略图打水印结束 复制代码 修改好后上传覆盖即可。

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。