织梦cms V5.6缩略图上不添加水印的方法

484 ℃

织梦cms V5.6缩略图默认为添加水印,缩略图比较小,添加水印会很难看,那么怎么才能在缩略图上不添加水印呢?方法如下:

修改DedeCMS程序里的dede/inc/inc_archives_functi*****.php 文件 (dede为后台默认路径)
查找到:
//获取一个远程图片
function GetRemoteImage($url,$uid=0)

这个函数里面有一句:
@WaterImg($rndtrueName, 'down');
修改成:
//@WaterImg($rndtrueName, 'down');
再查找:
//获得文章body里的外部资源
function GetCurContent($body)
{
global $cfg_multi_site,$cfg_basehost,$cfg_basedir,$cfg_image_dir;

修改成:
//获得文章body里的外部资源
function GetCurContent($body)
{
global $cfg_multi_site,$cfg_basehost,$cfg_basedir,$cfg_image_dir,$autolitpic,$litpic;
$autolitpic = (empty($autolitpic) ? '' : $autolitpic);

然后在这同一个函数里面查找到:
$value = trim($value);
$rndFileName = $imgPath.'/'.$milliSecondN.'-'.$key.$itype;
$fileurl = $imgUrl.'/'.$milliSecondN.'-'.$key.$itype;
$rs = $htd->SaveToBin($rndFileName);

在其下面添加:
//自动获取缩略图
if($autolitpic==1 && $litpic=='')
{
$litpic = GetDDImgFromBody($body);
}

最后一步:
查找到:
//处理HTML文本
//删除非站外链接、自动摘要、自动获取缩略图
function AnalyseHtmlBody($body,&$description,&$litpic,&$keywords,$dtype='')
{
global $autolitpic,$remote,$dellink,$autokey,$cfg_basehost,$cfg_auot_description,$id,$title,$cfg_soft_lang;
$autolitpic = (empty($autolitpic) ? '' : $autolitpic);
$body = stripslashes($body);
//远程图片本地化
if($remote==1)
{
$body = GetCurContent($body);
}
//删除非站内链接
if($dellink==1)
{
$basehost = "http://".$_SERVER['HTTP_HOST'];
$body = str_replace($cfg_basehost,'#basehost#',$body);
$body = str_replace($basehost,'#2basehost2#',$body);
$body = preg_replace("/(]*)>)|(<//a>)/isU","",$body);
$body = str_replace('#basehost#',$cfg_basehost,$body);
$body = str_replace('#2basehost2#',$basehost,$body);
}
//自动摘要
if($description=='' && $cfg_auot_description>0)
{
$description = cn_substr(html2text($body),$cfg_auot_description);
$description = trim(preg_replace('/
/','',$description));
$description = addslashes($description);
}

在这个下面的:
//自动获取缩略图
if($autolitpic==1 && $litpic=='')
{
$litpic = GetDDImgFromBody($body);
}

修改成:

//自动获取缩略图
//if($autolitpic==1 && $litpic=='')
//{
//$litpic = GetDDImgFromBody($body);
/

织梦CMS如何屏蔽搜索引擎识别

织梦cms提交文章后自动推送到百度站长平台

wordpress如何自动获取文章中第一张图片为缩略图

wordpress如何直接调用特色图片(has_post_thumbnail)

wordpress有图片显示图片没图片不显示

标签: 水印, 织梦cms, 缩略图

上面是“织梦cms V5.6缩略图上不添加水印的方法”的全面内容,想了解更多关于 织梦cms 内容,请继续关注web建站教程。

当前网址:https://m.ipkd.cn/webs_725.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

Naive UI前端UI组件库中文文档官网介绍
全球最受欢迎的前端开源工具库——Bootstrap v4中文文档
帝国cms功能之网站管理系统搜索关键字管理
vuejs移动端实现滚动到底部自动分页
dedecms织梦实现每天首页自动更新一次的方法