Discuz X3 默认开启缩略图的时候水印只添加到原图上面,而缩略图上面无法进行水印图的添加,需要改下程序,方可给缩略图添加水印,需要修改2个地方:

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');
}
// 缩略图添加水印 end

相关文章:

  • 2021-04-02
猜你喜欢
  • 2021-09-23
  • 2021-11-12
  • 2021-11-19
  • 2022-12-23
  • 2021-11-08
  • 2022-01-26
  • 2021-11-12
相关资源
相似解决方案