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
  • 相关阅读:
    ListIterator
    List与set
    iterator取集合元素
    我眼中的AI
    集合的共性方法
    集合转数组
    打开与关闭eclipse的自动补全功能
    Mr_matcher的细节1
    nodelet的应用
    nodelet的理解
  • 原文地址:https://www.cnblogs.com/52php/p/5675421.html
Copyright © 2011-2022 走看看