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'); - }
- // 縮略圖打水印結束
修改好後上傳覆蓋即可。