How to add watermarks to images in discuz x3.x category Information

Source: Internet
Author: User

How to add watermarks to images in discuz x3.x category Information

This is a problem solved when configuring the company website some time ago. Now, read the previous notes and give it to anyone who needs this function.

Youdao cloud Note: Creation Time:

After several days of code analysis, I found the place where I needed to add the watermark, and finally added only a few lines of code.
Direct topic: source/class/extend/extend_thread_sort.php is the extend_thread_sort class, and its public function after_newthread () if ($ _ G ['Forum _ optionlist'] [$ optionid] ['type'] = 'image '){
$ Identifier = $ _ G ['Forum _ optionlist'] [$ optionid] ['identifier'];
$ Sortaids [] = intval ($ _ GET ['tyexception'] [$ 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'];

Red indicates the added code.

The analysis process is twists and turns. As we have been relatively familiar with the classification information some time ago and know the entire parsing process of the category information in disucz, this time we add a watermark based on the image attached to the Forum, position the watermark to be added step by step.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.