一聚教程网:一个值得你收藏的教程网站

热门教程

phpcms v9删除上传图片自动添加水印功能

时间:2022-06-25 16:22:58 编辑:袖梨 来源:一聚教程网

https://img.111cn.net

https://img.111cn.net去除https://img.111cn.netflashhttps://img.111cn.netupload网络https://img.111cn.net文件上传https://img.111cn.net选项及去掉自动添加水印功能https://img.111cn.nethttps://img.111cn.net

https://img.111cn.net

第一步:修改wwwroot\phpcms\modules\attachment\templates\swfupload.tpl.phphttps://img.111cn.net

https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net
 代码如下https://img.111cn.net复制代码https://img.111cn.net
https://img.111cn.net

https://img.111cn.net

https://img.111cn.net
    https://img.111cn.net
https://img.111cn.net
        https://img.111cn.net
    https://img.111cn.net
                https://img.111cn.net
  • onclick="SwapTab('swf','on','',5,1);">https://img.111cn.nethttps://img.111cn.net
  • https://img.111cn.net
    //删除以下https://img.111cn.net
               https://img.111cn.nethttps://img.111cn.net https://img.111cn.net
  • https://img.111cn.nethttps://img.111cn.net
  • https://img.111cn.net
    https://img.111cn.net
    https://img.111cn.net
                https://img.111cn.netadmin_username && $_SESSION['userid']) {?>https://img.111cn.net
                https://img.111cn.net
  • iframehttps://img.111cn.net('album_list','index.php?m=attachment&c=attachments&a=album_load&args=https://img.111cn.net');">https://img.111cn.nethttps://img.111cn.net
  • https://img.111cn.net
                https://img.111cn.net
  • https://img.111cn.nethttps://img.111cn.net
  • https://img.111cn.net
                https://img.111cn.nethttps://img.111cn.net
                https://img.111cn.nethttps://img.111cn.net
                https://img.111cn.net
  • https://img.111cn.nethttps://img.111cn.net
  • https://img.111cn.net
                https://img.111cn.nethttps://img.111cn.net
            https://img.111cn.net
https://img.111cn.net
         https://img.111cn.net
https://img.111cn.net
         https://img.111cn.net
https://img.111cn.net
    https://img.111cn.net
https://img.111cn.net
     https://img.111cn.nethttps://img.111cn.nethttps://img.111cn.net
    https://img.111cn.net
https://img.111cn.net
    https://img.111cn.nethttps://img.111cn.net
                https://img.111cn.net
https://img.111cn.nethttps://img.111cn.net https://img.111cn.nethttps://img.111cn.net https://img.111cn.net,https://img.111cn.net https://img.111cn.nethttps://img.111cn.nethttps://img.111cn.nethttps://img.111cn.net
https://img.111cn.net
                https://img.111cn.net
https://img.111cn.net
https://img.111cn.net
    https://img.111cn.net
                https://img.111cn.net
https://img.111cn.net https://img.111cn.nethttps://img.111cn.nethttps://img.111cn.net https://img.111cn.nethttps://img.111cn.net
https://img.111cn.net
//删除下面的水印https://img.111cn.net
https://img.111cn.netcheckboxhttps://img.111cn.net" id="watermark_enable" value="1" https://img.111cn.net onclick="change_params()"> https://img.111cn.nethttps://img.111cn.net

https://img.111cn.net

         https://img.111cn.net

 https://img.111cn.net
      https://img.111cn.net
https://img.111cn.net
https://img.111cn.net
         https://img.111cn.net
https://img.111cn.net
         https://img.111cn.nethttps://img.111cn.nethttps://img.111cn.nethttps://img.111cn.net
         https://img.111cn.net
        https://img.111cn.net
             https://img.111cn.net
https://img.111cn.net
      https://img.111cn.net
https://img.111cn.net
     https://img.111cn.net
https://img.111cn.net
https://img.111cn.nethttps://img.111cn.net        https://img.111cn.net  https://img.111cn.net https://img.111cn.net  https://img.111cn.net
     https://img.111cn.netadmin_username && $_SESSION['userid']) {?>https://img.111cn.net
        https://img.111cn.nethttps://img.111cn.net
        https://img.111cn.nethttps://img.111cn.net
        https://img.111cn.nethttps://img.111cn.net
        https://img.111cn.nethttps://img.111cn.net
        https://img.111cn.net
https://img.111cn.net
         https://img.111cn.net
https://img.111cn.nethttps://img.111cn.net
https://img.111cn.net
            https://img.111cn.net
    https://img.111cn.net
                https://img.111cn.netforeachhttps://img.111cn.net ($att as $_v) {?>https://img.111cn.net
       https://img.111cn.net
  • https://img.111cn.net
        https://img.111cn.net
    https://img.111cn.net
         https://img.111cn.netjavascripthttps://img.111cn.net:album_cancel(this,https://img.111cn.net,'https://img.111cn.net')" href="javascript:;" class="off"  title="https://img.111cn.net">https://img.111cn.net
    https://img.111cn.net
    https://img.111cn.nethttps://img.111cn.nethttps://img.111cn.net
        https://img.111cn.net
    https://img.111cn.net
       https://img.111cn.net
  • https://img.111cn.net
       https://img.111cn.nethttps://img.111cn.net
             https://img.111cn.net
https://img.111cn.net
        https://img.111cn.net
   https://img.111cn.net
        https://img.111cn.net     https://img.111cn.net
    https://img.111cn.nethttps://img.111cn.net
     https://img.111cn.nethttps://img.111cn.net
    https://img.111cn.nethttps://img.111cn.net
https://img.111cn.nethttps://img.111cn.net
https://img.111cn.net
https://img.111cn.net

https://img.111cn.net
https://img.111cn.net

https://img.111cn.net补充:彻底去除自带的水印功能https://img.111cn.nethttps://img.111cn.net

https://img.111cn.net

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

https://img.111cn.net

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

https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net https://img.111cn.net
 代码如下https://img.111cn.net复制代码https://img.111cn.net
https://img.111cn.net

function watermark($source, $target = '', $w_pos = '', $w_img = '', $w_text = '',$w_font = 8, $w_color = '#ff0000') {https://img.111cn.net

https://img.111cn.net

$w_pos = $w_pos ? $w_pos : $this->w_pos;https://img.111cn.net

https://img.111cn.net

$w_img = $w_img ? $w_img : $this->w_img;https://img.111cn.net

https://img.111cn.net

if(!$this->watermark_enable || !$this->check($source)) return false;https://img.111cn.net

https://img.111cn.net

if(!$target) $target = $source;https://img.111cn.net

https://img.111cn.net

$w_img = PHPCMS_PATH.$w_img;https://img.111cn.net

https://img.111cn.net

$source_info = getimagesize($source);https://img.111cn.net

https://img.111cn.net

$source_w = $source_info[0];https://img.111cn.net

https://img.111cn.net

$source_h = $source_info[1];https://img.111cn.net

https://img.111cn.net
https://img.111cn.net

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

https://img.111cn.net

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

https://img.111cn.net https://img.111cn.net https://img.111cn.net

热门栏目