Home>Article>CMS Tutorial> How to remove watermark in phpcms

How to remove watermark in phpcms

藏色散人
藏色散人 Original
2020-05-31 13:23:05 2032browse

How to remove watermark in phpcms

phpcmsHow to remove the watermark?

Many webmaster friends know that Phpcms v9 has its own watermark function. Today, when I was modifying a website for a friend, I asked if I could remove the watermark function that comes with Phpcms v9, because sometimes when uploading pictures in the editor, I don’t want the uploaded pictures to be automatically added with the watermark that comes with Phpcms v9. watermark.

Analysis: Since it is a function in the program, there must be a piece of code that controls this function. Through further searching for information, the editor found the file where this function resides and the corresponding control code. The editor below will share with you the setting steps to remove phpcms v9.

Step 1: First find the statics/images/water folder according to the directory path and delete the water file; if the system cannot find the watermark image in the water folder, follow the setting method in step 2. Add a watermark in text format to the image.

Step 2: Find the watermark function in the phpcms/libs/classes/image.class.php file according to the directory path, and set the value of the $w_text parameter in this function to empty. (Refer to the following code)

function watermark($source, $target = ”, $w_pos = ”, $w_img = ”, $w_text = ”,$w_font = 8, $w_color = ‘#ff0000’) { $w_pos = $w_pos ? $w_pos : $this->w_pos; $w_img = $w_img ? $w_img : $this->w_img; if(!$this->watermark_enable || !$this->check($source)) return false; if(!$target) $target = $source; $w_img = PHPCMS_PATH.$w_img; $source_info = getimagesize($source); $source_w = $source_info[0]; $source_h = $source_info[1];

If the webmaster friends have designed watermark pictures, they can also be replaced. The replacement method is to find the watermark image in the statics/images/water folder and replace it with the selected watermark image, upload it and overwrite it. There are many ways to add, delete and replace watermarks. If webmaster friends want to add text format watermarks to the pictures they upload, they not only need to delete the statics/images/water folder, but also need to change the $ in the watermark function. Change the value of the w_text parameter to the text you need to design. The design of watermark is actually not difficult and can be achieved using programs. The editor has also designed many watermarks. Just take the encapsulated class and call it.

The above is the detailed content of How to remove watermark in phpcms. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn