找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 160|回复: 0

[cms教程] Discuz X3.2/X2.5缩略图添加水印方法

[复制链接]

该用户从未签到

发表于 2014-11-21 12:08:38 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

×
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');
                    }
                    // 缩略图打水印结束
        复制代码
        修改好后上传覆盖即可。
回复

使用道具 举报

网站地图|页面地图|文字地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2024-10-8 06:29

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表