好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

phpcms v9 彻底去除自带的水印功能的方法

第一步:找到 statics/images/water  文件夹,将去删除;如果系统找不到water文件夹的水印图片,则将会执行第二步,给图片添加一个文本格式的水印

  第二步:找到 phpcms/libs/classes/image.class.php 文件中 watermark 函数,将此函数中 $w_text  参数的值设置为 空 即可

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 ];

 

  如果想替换为自己设计的水印图片,则只需要替换 statics/images/water 文件夹下的水印图片为自己设计的水印图片即可。

  如果想给自己上传的图片添加文本格式的水印,则除了需要删除 statics/images/water 文件夹外,还需要将 watermark函数 中的 $w_text 参数的值修改为自己想要的文字即可。

查看更多关于phpcms v9 彻底去除自带的水印功能的方法的详细内容...

  阅读:45次