經(jīng)過幾天的代碼分析,逐漸找到需要添加水印的地方,最終只添加了幾行代碼。
直接主題:
source/class/extend/extend_thread_sort.php
中為extend_thread_sort類,
在其方法public function after_newthread()中
if($_G['forum_optionlist'][$optionid]['type'] == 'image') {
$identifier = $_G['forum_optionlist'][$optionid]['identifier'];
$sortaids[] = intval($_GET['typeoption'][$identifier]['aid']);
require_once libfile('class/image');
$image = new image;
$imgoptiondata = dunserialize($value);
if($_G['setting']['watermarkstatus'] && empty($_G['forum']['disablewatermark'])) {
$image->Watermark($imgoptiondata['url'], '', 'forum');
$update['filesize'] = $image->imginfo['size'];}
紅色即為添加的代碼
分析過程比較曲折,由于前段時(shí)間已經(jīng)對(duì)分類信息相對(duì)比較熟悉,知道disucz 中分類信息的整個(gè)解析過程,所以這次根據(jù)論壇附件圖片中添加水印的方法,一步一步的定位到需要添加水印的位置。
————————————————
版權(quán)聲明:本文為CSDN博主「richerg85」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權(quán)協(xié)議,轉(zhuǎn)載請(qǐng)附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/richerg85/article/details/41543429
歡迎光臨 Discuz! 官方交流社區(qū) (http://r615.cn/) | Powered by Discuz! X5.0 |