search
HomeCMS TutorialPHPCMSHow to remove watermark in phpcms

How to remove watermark in phpcms

May 31, 2020 pm 01:23 PM
phpcms

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools