discuz x3.x 分類資訊中圖片加浮水印方法,discuzx3.x

來源:互聯網
上載者:User

discuz x3.x 分類資訊中圖片加浮水印方法,discuzx3.x

       這是前段時間,配置公司網站時解決的一個問題,現翻閱之前的筆記,給需要這個功能的大家。

      有道雲筆記:建立時間:2014-09-20 16:07

       

經過幾天的程式碼分析,逐漸找到需要添加浮水印的地方,最終只添加了幾行代碼。
直接主題: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'];

紅色即為添加的代碼

分析過程比較曲折,由於前段時間已經對分類資訊相對比較熟悉,知道disucz 中分類資訊的整個解析過程,所以這次根據論壇附件圖片中添加浮水印的方法,一步一步的定位到需要添加浮水印的位置。   

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.