Phpcms v9 Editor uploads a picture to add a watermark

Source: Internet
Author: User

The first step: Add a Watermark box to the Picture Upload dialog box to find:

Satics/js/ckeditor/ckeditor.js line 17,554th (need to format, I use NetBeans) to change to

function D () {
W.$.open ();
if (B.iscustomdomain ()) W.$.domain=document.domain;
var e= ';
if (x.size) e=x.size-(c?7:0);
var f=u.frameid+ ' _input ';
W.$.write ([' ' <input type= ' checkbox "Name=" ', E.htmlencode (' watermarks_enable '), ' size= ' ', E.htmlencode (E > 0?) E: '), '/> add watermark ',' </form> ', ' </body>W.$.close ();
for (Var g=0; g<y.length; g++) y[g].enable ();
};

Added a red section

Step Two: Modify phpcms/libs/classes/image.class.php line 16th

function __construct ($thumb _enable = 0, $water _enable = 0, $siteid)

Modify phpcms/libs/classes/image.class.php line 18th and line 20

$this->water_enable = $water _enable; (Line 18th)

$this->watermark_enable = $this->water_enable; (line 20th)

Step three: Modify Phpcms/libs/classes/attachment.class.php line 35th to:

Change the last parameter of the upload method to $watermark _enable = 0

At the same time, add 39 lines below the blank place:

$watermark _enable = isset ($_post[' watermarks_enable ')? 1: $watermark _enable;

Continue to modify: The 123th row instantiates the image class when the parameter is changed to:

$image = new Image ($thumb _enable, $watermark _enable, $this->siteid);

(from reprint)

Phpcms v9 Editor uploads a picture to add a watermark

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.