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
  • 相关阅读:
    Linux删除文件相关命令
    Bing语句
    VS2013配置Winpcap
    node10-mongoose
    node09-cookie
    node08-express
    node07-http
    node06-path
    node05-fs
    node04-buffer
  • 原文地址:https://www.cnblogs.com/52php/p/5675421.html
Copyright © 2011-2022 走看看