Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

Discuz!X1.5 支持时间和作者的文字水印插件

[复制链接]
530761333 发表于 2010-10-21 21:19:29 | 显示全部楼层 |阅读模式
修改方法:
第一步:
打开\source\class目录下class_image.php文件。
查找:
  1. } elseif($this->param['watermarktype'][$type] == 'text') {
  2. if(($this->param['watermarktext']['shadowx'][$type] || $this->param['watermarktext']['shadowy'][$type]) && $this->param['watermarktext']['shadowcolor'][$type]) {
  3. $shadowcolorrgb = explode(',', $this->param['watermarktext']['shadowcolor'][$type]);
  4. $shadowcolor = imagecolorallocate($dst_photo, $shadowcolorrgb[0], $shadowcolorrgb[1], $shadowcolorrgb[2]);
  5. imagettftext($dst_photo, $this->param['watermarktext']['size'][$type], $this->param['watermarktext']['angle'][$type], $x + $ax + $this->param['watermarktext']['shadowx'][$type], $y + $ay + $this->param['watermarktext']['shadowy'][$type], $shadowcolor, $this->param['watermarktext']['fontpath'][$type], $watermarktextcvt);
  6. }

  7. $colorrgb = explode(',', $this->param['watermarktext']['color'][$type]);
  8. $color = imagecolorallocate($dst_photo, $colorrgb[0], $colorrgb[1], $colorrgb[2]);
  9. imagettftext($dst_photo, $this->param['watermarktext']['size'][$type], $this->param['watermarktext']['angle'][$type], $x + $ax, $y + $ay, $color, $this->param['watermarktext']['fontpath'][$type], $watermarktextcvt);
  10. } else {
复制代码
              替换成:
  1. } elseif($this->param['watermarktype'][$type] == 'text' && $this->imginfo['width'] >= 250) {
  2. $objTmpImg = @imagecreatetruecolor($this->imginfo['width'], $this->imginfo['height']+16);
  3. @imagecopy($objTmpImg, $dst_photo, 0, 0, 0, 0, $this->imginfo['width'], $this->imginfo['height']);
  4. $dst_photo = $objTmpImg;
  5. $bg_x1 = 0;
  6. $bg_y1 = $this->imginfo['height'];
  7. $bg_x2 = $this->imginfo['width'];
  8. $bg_y2 = $this->imginfo['height']+16;
  9. $bg_color = imagecolorallocate($dst_photo, 0, 0, 0);
  10. imagefilledrectangle($dst_photo, $bg_x1, $bg_y1, $bg_x2, $bg_y2, $bg_color);
  11. if(($this->param['watermarktext']['shadowx'][$type] || $this->param['watermarktext']['shadowy'][$type]) && $this->param['watermarktext']['shadowcolor'][$type]) {
  12. $shadowcolorrgb = explode(',', $this->param['watermarktext']['shadowcolor'][$type]);
  13. $shadowcolor = imagecolorallocate($dst_photo, $shadowcolorrgb[0], $shadowcolorrgb[1], $shadowcolorrgb[2]);
  14. imagettftext($dst_photo, $this->param['watermarktext']['size'][$type], $this->param['watermarktext']['angle'][$type], $ax + $this->param['watermarktext']['shadowx'][$type] + 3, $this->imginfo['height'] + $ay + $this->param['watermarktext']['shadowy'][$type] + 2, $shadowcolor, $this->param['watermarktext']['fontpath'][$type], $watermarktextcvt);
  15. }

  16. $colorrgb = explode(',', $this->param['watermarktext']['color'][$type]);
  17. $n = $_G['member']['username'];
  18. $wtext = "该图片由 $n 上传至 上班族 SBanZ.Com 版权归原创者所有";
  19. $watermarktextcvt = iconv('GB2312', 'UTF-8', $wtext);
  20. $color = imagecolorallocate($dst_photo, $colorrgb[0], $colorrgb[1], $colorrgb[2]);
  21. imagettftext($dst_photo, $this->param['watermarktext']['size'][$type], $this->param['watermarktext']['angle'][$type], $ax + 3, $this->imginfo['height'] + $ay + 1, $color, $this->param['watermarktext']['fontpath'][$type], $watermarktextcvt);
  22. } else {
复制代码

该图片由 $n 于".date('y年n月j日', time())."上传至 西林网 LMQ8.Com 版权归原创者所有修改成自己的
第二步:
上传中文字体到:\static\image\seccode\font\ch 目录。


第三步,后台设置:水印位置任选。
添加水印条件自定。
水印图片类型选择文字水印。
融合度质量100

文本水印文字,请输入任意内容(随便输入
,不然出错)
选择自己上传的字体。
文字大小8-10自己看着办。
水印字体颜色#FFFFFF
水印阴影颜色#000000

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
haojay 发表于 2010-11-4 09:35:11 | 显示全部楼层
折磨好的东西竟然没人顶。真搞笑。
回复

使用道具 举报

seneca 发表于 2010-11-4 09:59:23 | 显示全部楼层
顶一下....如果以插件的模式安装就方便多了...
回复

使用道具 举报

xygylcs 发表于 2010-11-13 19:46:59 | 显示全部楼层
牛叉啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-29 01:21 , Processed in 0.263463 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表