程序版本:discuz!X3 
目的:连缩略图都加上水印的~ 
适合人群:使用Discuz!x3的站长的特殊需求 
 
 
1:打开source\function\function_post.php- $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');
 
 - }
 
 - // 缩略图打水印结束
 
  复制代码 上传替换原文件,上传图片生成缩略图就有水印了。 
 
本教程有无限星辰工作室 www.xmspace.net 整理发布,转载请注明地址,谢谢! |   
 
 
 
 |