Image watermarking method in Discuz x3.x classification information

Source: Internet
Author: User

This is a time ago, the configuration of the company's website when a problem solved, and now read the previous notes, to the need for this feature everyone.

Youdao Cloud Notes: creation time: 2014-09-20 16:07

After a few days of code analysis, gradually found the need to add a watermark, and finally added only a few lines of code.
Direct topic: source/class/extend/extend_thread_sort.php in the Extend_thread_sort class,In its method 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 ');

Red is the added code

Analysis process is more tortuous, because the previous period of time has been relatively familiar with the classification information, know Disucz in the entire parsing process of classification information, so this time according to the forum attached to the image of the method of adding watermarks, step by step positioning to the need to add a watermark location.

Image watermarking method in Discuz x3.x classification information

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.