zoukankan      html  css  js  c++  java
  • 给 DiscuzX3 缩略图添加水印

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

    1、打开 sourcefunctionfunction_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
  • 相关阅读:
    谜之This
    JS 面向对象 ~ 继承的7种方式
    JS 面向对象 ~ 创建对象的 9 种方式
    JS 原型与原型链
    ES6 Promise 详解
    Vue diff 算法
    Vue Router 路由实现原理
    Vue Keep-alive 原理
    Vue 响应式原理
    JS 有趣的JS
  • 原文地址:https://www.cnblogs.com/52php/p/5675421.html
Copyright © 2011-2022 走看看