帝国CMS标签随心使用技巧笔记(经验)

 本文内容很零散,是在具体使用中总结的,待整理:

 
1、会员列表分页位置:/e/member/list
 
2、栏目ID表:前缀_enewsclass
 
3、单独调用一个栏目链接:<?=$class_r[栏目id]['classpath']?>
 
4、单独调用一个栏目名称:<?=$class_r[栏目id]['classname']?>
 
5、内容页收藏夹地址:/e/member/fava/add?classid=2&id=75
 
6、内容页调用会员的用户名和空间链接:<a href="http://www.zzarea.com/e/space/?userid=1">admin</a>
 
7、内容页显示会员收藏数:<?=$empire->gettotal("select count(*) as total from phome_enewsfava where id='$navinfor[id]'and classid='$navinfor[classid]'");?>
 
8、统计当前栏目的文章数:[totaldata]$GLOBALS[navclassid],0[/totaldata]
 
9、统计 159 栏目的文章数:[totaldata]'159',0,0[/totaldata]
 
10、关于帝国CMS会将“/”自动替换为空的说明,请用到“/”的地方用“////”四个反斜杠代替
 
11、内容页简介字数的控制:<?=sub($navinfor[smalltext],0,您的字数,false)?>
 
12、对灵动标签的内容进行排序:
 
 [e:loop={'select * from hao_sd_about where classid=1 order by title asc limit 10',20,24,0}]
 
<li><a href="<?=$bqsr[titleurl]?>" target="_self" title="<?=sub($bqr[title],0,40,false)?>"><?=sub($bqr[title],0,26,false)?></a></li>
 
[/e:loop]
 
解释:
 
hao_sd_about是要查询字段所在的表名;
 
classid=1是要查询的栏目ID是1;
 
order by title asc 是查询title这个字段的//升序排列
 
order by title desc 是查询title这个字段的//降序排列
 
limit 10 是取10条,可以去掉去全部!
 
13、<?=date('Y-m-d',$bqr[newstime])?> 灵动标签的时间输出
 
14、调用栏目图片(一般在内容页):
 
[e:loop={"select classimg from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]
 
<?=$bqr[classimg]?>
 
[/e:loop]
 
解释:phome_enewsclass是您要调用的表的名称;
 
$GLOBALS[navclassid]是当前栏目的ID;如果是调用固定栏目就填写固定的ID。
 
比如:[e:loop={"select classimg from XXX_enewsclass where classid='8'",1,24,0}]
 
<a href="/<?=$class_r[8]['classpath']?>"><img src="<?=$bqr[classimg]?>" alt="<?=$class_r[8]['classname']?>" /></a>
 
[/e:loop]
 
15、栏目列表页调用一篇文章的内容:   [e:loop={={4,1,12,0}]
 
    <?=$bqr[newstext]?>
 
               [/e:loop]
 
注意:newstext字段的属性设置,不然不能显示
 
16、调用栏目图片:
 
[e:loop={"select classimg from 数据库前缀_enewsclass where classid='要调用的栏目ID'",1,24,0}]
 
<a href="/<?=$class_r[要调用的栏目ID]['classpath']?>"><img src="<?=$bqr[classimg]?>" alt="<?=$class_r[要调用的栏目ID]['classname']?>" /></a>
 
[/e:loop]
 
17、上传图片存放的原始表:“表前缀_enewsfile”,这个主要是便于修改上传的内容!
 
18、全局网站名称调用:<?=$public_r[sitename]?>
 
19、当前位置[–[!–newsnav–]修改“首页”两个字:修改位置:e/data/language/gb/pub/fun.php
 
'index'=>'首页', 这两个字可以随意更改成您想用的字;
 
20、分页分为:[!–show.page–](下拉式);[!–show.listpage–](列表式)——注意:动态页面只支持列表式(PS:[!–show.listpage–]的分页样式在:e/class/t_functions.php下修改;文字在语言包:e/data/language/fun.php 下修改 )
 
/** 随即调用 phome_ecms_news 表中 id为3 标题有 南京 文章内容有 南京
[ecmsinfo]"select * from phome_ecms_news where classid in (3) and (title like '%南京%' or newstext like '%南京%') order by rand() desc limit 10",10,28,0,24,9,0[/ecmsinfo]
 
/**调用 phome_ecms_news 表id为2,关键字为 阿弥陀经 的文章
 
[ecmsinfo]"select * from phome_ecms_news where checked=1 and classid=2 and keyboard ='$navinfor[阿弥陀经]' limit 10",50,32,0,24,14,0[/ecmsinfo]

本文链接:https://www.dnwfb.com/10.html,转载请注明出处。
0

评论0

没有账号? 注册  忘记密码?