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
  • 相关阅读:
    pt-tcp-model
    (转)从史上八大MySQL宕机事故中学到的经验
    pt-query-digest
    DNS生效时间
    Python之uuid模块
    一个IO的传奇一生
    Python之Queue模块
    利用freemarker 静态化网页
    FreeMarker教程
    模板引擎freemarker的简单使用教程
  • 原文地址:https://www.cnblogs.com/52php/p/5675421.html
Copyright © 2011-2022 走看看