给 DiscuzX3 缩略图添加水印
2024-08-29 13:43:44
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
最新文章
- CSharpGL(25)一个用raycast实现体渲染VolumeRender的例子
- openstack网络(neutron)模式之GRE的基本原理
- mysql 日期加减操作
- Unknown tag
- C# 通过SerialPort简单调用串口
- JQUERY解析XML IE8的兼容问题
- Spring JTA应用JOTM &; Atomikos II JOTM
- 转 C#开发微信门户及应用(1)--开始使用微信接口
- Oracle SQL篇(二)oracle自连接操作
- C++程序代写实现HashSet class
- 自动化运维工具——puppet详解(一)
- .Net语言 APP开发平台——Smobiler学习日志:如何快速实现Timer计时功能
- CSS伪类整理笔记
- [转]Linux中python3.6+ipython+Jupyter Notebook环境
- xshell远程登录工具的星号密码查看方法
- Redis闪退解决办法
- LitJson JavaScriptSerializer
- ArrayList封装
- Redis入门 - Windows环境搭建与第一个C# Sample
- 526. Beautiful Arrangement