导航:首页 > 万维百科 > 帝国cms缩略图质量

帝国cms缩略图质量

发布时间:2021-02-15 16:11:09

1、怎么调栏目缩略图 帝国cms

[e:loop={'3',24,0,0}]
<li><a href="<?=$bqsr[classurl]?>">
<img width="70" height="40" src="<?=$bqr[classimg]?>" /></a></li>
[/e:loop]

或者指定ID

[e:loop={"select classid,classname,classimg,intro from phome_enewsclass where classid=3",1,24,0}]
<li><a href="<?=$bqsr[classurl]?>" target="_blank"><span><img src="<?=$bqr[classimg]?>" alt="<?=$bqr[classname]?>"></span><?=$bqr[classname]?></a></li>
[/e:loop]

你参考下

2、如何制作帝国cms内容页的调用栏目缩略图

TAG:帝国cms
如何制作帝国cms内容页的调用栏目缩略图
帝国cms6.0后已经无法用[!--class.classimg--]直接调用栏目缩略图了,5.1以前的能行,现在只能在列表页能用[!--class.classimg--]调用缩略图标签,现在只有用灵动或者万能标签才能调用,调用代码如下
[e:loop={"select classimg from phome_enewsclass where classid='$GLOBAL[navclassid]'",1,24,0}]
[/e:loop]

3、如何调用栏目的缩略图 帝国cms

帝国cms列表模板,页面模板内容编辑框部分,用[!--class.classimg--]调用栏目图片,前提是该栏目设置中,你要给该栏目添加有图片!

如下图

4、灵动标签怎么调用栏目缩略图 帝国cms

[e:loop={'3',24,0,0}]
<li><a href="<?=$bqsr[classurl]?>">
<img width="70" height="40" src="<?=$bqr[classimg]?>" /></a></li>
[/e:loop]

或者指定ID

[e:loop={"select classid,classname,classimg,intro from phome_enewsclass where classid=3",1,24,0}]
<li><a href="<?=$bqsr[classurl]?>" target="_blank"><span><img src="<?=$bqr[classimg]?>" alt="<?=$bqr[classname]?>"></span><?=$bqr[classname]?></a></li>
[/e:loop]

你参考下

5、帝国CMS缩略图函数 sys_ResizeImg手机网站不生效,有谁解决过么?

一、帝国cms生成缩略图所用到的方法或函数是sys_ResizeImg(),依赖于php主机环境是否安装并支持gd库,通常都是支持的。
<img src="<?=sys_ResizeImg($bqr[titlepic],375,287,1)?>" alt="<?=$bqr['title']?>"/>

——代码摘自学而行营销网首页模板,效果如下。
用sys_ResizeImg()方法生成缩略图后,可以查看图片的路径,你发现图片路径并不在后台上传默认的d/file目录下,而是放在/e/data/tmp/目录中,由此可检验是否已经生效;另外方法中的第一个数字(本例中是375)表示缩略图的宽度,第2个数字(本例中是287)则是缩略图的高度,参数1则表示帝国默认的裁剪缩放生成缩略图的方式。
关于sys_ResizeImg()的最后参数说明。见如下:
帝国CMS缩略图函数改进(GD库改进)
本文关键字词:缩略图,缩略图函数,帝国CMS,帝国CMS,帝国CMS缩略图去黑边框
第一种方式 帝国默认:
sys_ResizeImg($r[titlepic],宽,高,0);//帝国默认的不裁剪缩放生成缩略图的方式
第二种方式 帝国默认:
sys_ResizeImg($r[titlepic],宽,高,1);//帝国默认的裁剪缩放生成缩略图的方式
第三种方式 去掉裁剪不够时的黑边并且从图片缩放后中间裁剪:
sys_ResizeImg($r[titlepic],宽,高,2);//新加去黑边裁剪生成缩略图的方式
第四种方式 只固定图片的宽,高度不限制(类似不规则瀑布流的图片形式),高填写为大于0的任意整数数字:
sys_ResizeImg($r[titlepic],宽,高,3);//新加去黑边生成类似瀑布流格式的方式
二、但是你看到的上图示例效果是经过改进后的,而默认sys_ResizeImg()生成的缩略图则是压缩比太高,图片质量很低,看上去很模糊失真,简直可用惨不忍睹来形容。如下。
(如果一个人审美正常的话,那么上图这个美女脸上的像素点如此明显,如此糙,或许你看了不会呕吐,但相信你会把自己的眼光移到别处的。)
要修改sys_ResizeImg()生成缩略图的质量倒是很容易。只需要打开e/class/gd.php文件。找到如下这行。
$func_output($temp_image, $new_name.$func_exname,9);
将最后一个数字修改为:
$func_output($temp_image, $new_name.$func_exname,85);

其中85就代表生成的缩略图压缩比,数字越高,压缩率越低,图片质量自然就越高,但要注意的是,图片质量高文件就会增大,如果图片过多、尺寸过大就会影响页面加载速度(通常),而我们使用缩略图的一个重要目的就是要减少图片尺寸以提高页面打开速度,因此这个数字华哥建议设置在65-90之间为好。
然后上传覆盖。再重新生成页面,查看是否有所变化。
讲真,这个修改方法以前华哥曾经实践过至少两次,但都没有成功。这次实践居然轻松就成功了,简直可说是如有神助!
不过也找不到以前失败的原因,或许是换了网站主机空间的缘故吧。可以判断的是,如果不成功看不到变化,那和这个修改方法无关,修改方法是正确的,这次得到测试和应用,没有任何变化或许要去检测主机系统或服务器的php环境配置。

6、帝国cms首页多表调用,要调用栏目缩略图+标题。

本来不想回答 去年做过项目4表联合 拿去自己改吧 不会改就没办法 不解释

[e:loop={'select * 
from 
(
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news where istop=1 order by newstime desc limit 13 )
Union All
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news1 where istop=1 order by newstime desc limit 13)
Union All
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news2 where istop=1 order by newstime desc limit 13)
Union All
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news3 where istop=1 order by newstime desc limit 13)
)  as A  order by newstime desc  limit 20',0,24,0}]
<?php
$fb=$empire->fetch1("select * 
from 
(
(select id,classid,smalltext from phome_ecms_news_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,smalltext from phome_ecms_news1_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,smalltext from phome_ecms_news2_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,smalltext from phome_ecms_news3_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
)  as A");
?>
<li class="clearfix">
<a target='_blank' href="<?=$bqr[titleurl]?>" title="<?=$bqr[title]?>" class="index-img"><img src="<?=$bqr[titlepic]?$bqr[titlepic]:'404.jpg'?>" alt="<?=$bqr[title]?>"></a>
<div class="index-text">
<h1><a target='_blank' href="<?=$bqr[titleurl]?>"><?=$bqr[title]?></a>
</h1>
<div class="index-con"></div>
<div class="index-intro"><a target="_blank" href="<?=$bqr[titleurl]?>?from=index_new_intro"><?=$fb[smalltext]?></a></div>
<div class="index-like clearfix">
<span class="time">
 <?php
$fr=$empire->fetch1("select * 
from 
(
(select id,classid,infotags from phome_ecms_news_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,infotags from phome_ecms_news1_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,infotags from phome_ecms_news2_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,infotags from phome_ecms_news3_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
)  as A");
            $keyr=explode(',',$fr[infotags]);
            for($i=0;$i<2;$i++)
            {
            echo'<span><a href="/liaotian/tags-'.$keyr[$i].'-0.html" target=_blank>'.$keyr[$i].'</a></span>&nbsp;&nbsp;';
            }
            ?>
</span>
<span class="time"><?=format_datetime($bqr[newstime],"m-d")?></span>
<div class="post-ope">
<a href="/e/public/digg/?classid=<?=$bqr[classid]?>&id=<?=$bqr[id]?>&dotop=1&ajaxarea=diggnum<?=$bqr[id]?>" class="post-like-btn post-like" id="post-like-top-btn">
<script>
document.write('<script src="/e/public/ViewClick/?classid=<?=$bqr[classid]?>&id=<?=$bqr[id]?>&down=5?t='+Math.random()+'"><'+'/script>');
</script>
</a>
</div>
</div>
</div>
</li>

[/e:loop]

功能:联合取4表数据 关联取附表简介 并取标签 附加顶功能 动态浏览量等

7、如何防止帝国CMS的内容页里因为图片太大而撑破表格?

1.javascript:if(this.width>600)this.width=600;

2.onload='javascript:if(this.width>600)this.width=600;'

3.$(document).ready(function() {
var maxWidth = 600;
var maxHeight = 600;
var curWidth = $(".wz>img").width();
var curHeight = $(".wz>img").height();
if(curWidth > maxWidth){
$(".wz>img").width(maxWidth);
}
if(curHeight > maxHeight){
$(".wz>img").height(maxHeight);
}
});
4.图片等比例缩放 jquery.LoadImage.demo.rar http://download.csdn.net/download/e8love/2298755

与帝国cms缩略图质量相关的知识