常用帝国cms标签收录
帝国网站管理系统V6.6版-数据字典 : http://www.phome.net/doc/manual/extend/html/dbdoc/index.html
帝国模板网:http://www.daixiao360.cn/
http://www.yangqq.com/jstt/bj/2014-10-18/731.html 帝国cms常用标签调用方法总结
帝国CMS没通用的调用网站栏目名称的标签,[!-有-pagetitle--]是调用当前页面的名称
如果想在列表页或者内容页调用网站的名称可以使用: <?=$public_r[sitename]?>
判断会员是否登录
<?php
if(!$_COOKIE[ecmsmlusername]){
$srr="登录可见";
}else{
$srr="[!--lbsly--]";
}
?>
[!--news.url--]skin/default/
[e:loop={"select classid,classname,bname from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><?=$bqr[bname]?></title>[/e:loop]
[e:loop={"select * from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><?=$bqr[bname]?></title>[/e:loop]
<?php
$fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的顶级栏目ID
$rs=$empire->fetch1("select * from phome_enewsclass where classid=$topbclassid");
?>
_<?=$rs['bname']?>_<?=$public_r[sitename]?> 顶级栏目名称+网站标题
<?=$class_r[$GLOBALS[navclassid]][bname]?> 得到当前栏目的名称
<title>[!--pagetitle--] </title> 或 <title><?=$class_r[$GLOBALS[navclassid]][bname]?></title>
<meta name="keywords" content="[!--pagekey--]" />
<meta name="description" content="[!--pagedes--]" />
isgood=1 一级推荐
firsttitle=1 一级头条
[e:loop={10,3,0,0}] 10当前栏目,3显示条数,
[e:loop={4,1000,0,1,'leib="楼市快讯"','id DESC'}] 1有图片的显示。
[e:loop={"select * from phome_ecms_xtgg where firsttitle=1 order by id DESC limit 20",6,24,0}]
<?=$bqno?> [!--no.num--] 循环序号
<?=$bqsr['titleurl']?> <?=$bqr[title]?> <?=esub($bqr[title],8)?>
[/e:loop]
<?=DoWapRepNewstext($r[newstext])?>
时间调用标签:<?=date("Y-m-d",$bqr['newstime'])?>
列表页
您当前的位置:[!--newsnav--]
[!--no.num--]
[!--show.listpage--]
内容页
[!--info.next--]下一篇 [!--info.pre--]上一篇
万能标签用[!--onclick--] 灵动标签用<?=$bqr[onclick]?> 点击量
$titleurl=sys_ReturnBqTitleLink($navinfor); 获得当前页面的网址
$url = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']; 获得当前页面的网址
sql语句
<?php
//报名人数
$num=$empire->gettotal("select count(*) as total from phome_enewsfeedback where kft='".$navinfor[title]."'");
?>
帝国CMS经常用到的调用sql语句:
请注意,如果是帝国7.0版本的,需要将checked=1去掉
1,根据最新文章 select * from [!db.pre!]ecms_news where checked=1 order by newstime desc limit 10
2,根据推荐文章 select * from [!db.pre!]ecms_news where checked=1 and isgood=1 order by newstime desc limit 10
3,根据热门文章 select * from [!db.pre!]ecms_news where checked=1 order by onclick desc limit 10
4,根据头条新闻 select * from [!db.pre!]ecms_news where checked=1 and firsttitle=1 order by newstime desc limit 10
5,根据评论排行 select * from [!db.pre!]ecms_news where checked=1 order by plnum desc limit 10
6,根据digg排行 select * from [!db.pre!]ecms_news where checked=1 order by diggtop desc limit 10
7,根据投票排行 select * from [!db.pre!]ecms_news where checked=1 order by votenum desc limit 10
8,根据下载排行 select * from [!db.pre!]ecms_news where checked=1 order by totaldown desc limit 10
9,根据评分排行 select * from [!db.pre!]ecms_news where checked=1 order by infopfen desc limit 10
小技巧收录:
php三元条件运算符:
<?=$bqr['ftitle']?$bqr['ftitle']:$bqr['title']?>
灵动或者php查询调用编辑器内容的时候要加stripslashes删除反斜杠比如:
<?=stripslashes($r['newstext'])?>
内容页当前信息ID:
$navinfor['id']
列表内容模板信息ID:
$r['id']
当前栏目名:
$class_r[$GLOBALS['navclassid']]['classname'];
当前栏目父栏目:
$class_r[$GLOBALS['navclassid']]['bclassid'];
当前栏目别名:
$class_r[$GLOBALS['navclassid']]['bname'];
当前栏目子栏目:
$class_r[$GLOBALS['navclassid']]['sonclass'];
当前栏目子判断是否为终级栏目:
$class_r[$GLOBALS['navclassid']]['islast'];
当前栏目是否有已审核信息:
$GLOBALS['num']==0为没有信息
帝国cms中引入php路径写法(例子是文件在根目录)
<?php include(ECMS_PATH."./bottom.php");?>
排除置顶、头条、推荐等,sql附加条件:
'istop=0 and isgood=0 and firsttitle=0'
上上级栏目id:
<?php
$bclassid=$class_r[$GLOBALS[navclassid]][bclassid];
$bbclassid=$class_r[$bclassid][bclassid];
echo $bbclassid;
?>
$bbclassid就是上上级父栏目id
投稿、登陆、反馈、留言等之后跳转指定页面:
<input type=hidden name=ecmsfrom value="返回页面地址">
统计信息被收藏数:
<?
$favas=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsfava where id='$navinfor[id]' and classid='$GLOBALS[navclassid]'");
?>
<?=$favas?>就是这条信息的收藏数
列表、结合项判断当前没有信息给出提示:
<?
if($GLOBALS['num']=='0'){
?>
<p>对不起,暂时没有任何信息!</p>
<?
}else{
?>
[!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]
<?
}
?>
动态使用:
网站名称:<?=$public_r['sitename']?>
网站地址:<?=$public_r['newsurl']?>
帝国自身的时间转换函数:
<?=format_datetime($bqr[newstime],'Y-m-d')?>
此函数自带判断,比较不错,推荐。
判断内容是否有图片,没有图片则显示文中广告 有图片则不显示:
<?php
$string=$navinfor['newstext'];//内容字段
$some="<img ";
$num=explode($some,$string);
if(count($num)>1){//判断内容中是否有图片
?>
[!--newstext--]
<?
}else{
?>
<div id="ad">我是广告</div>
[!--newstext--]
<?
}
?>
截取加过滤标签:
<?=esub(htmlspecialchars(strip_tags($navinfor[newstext])),160)?>
内容页或灵动标签支持标题属性
内容页:
<?=DoTitleFont($navinfor[titlefont],$navinfor[title])?>
灵动标签:
<?=DoTitleFont($bqr[titlefont],$bqr[title])?>
标题截取字数+标题属性:
<?=DoTitleFont($bqr[titlefont],esub($bqr[title],32,'...'))?>
常用帝国cms标签收录的更多相关文章
- 帝国CMS标签【操作类型】说明详解
看标签的参数时候,一般最后一个参数是操作类型说明,可是后面写的是:"操作类型说明 具体看操作类型说明", 这个操作类型说明在什么地方看啊 操作类型 说明 操作类型 说明 0 各栏目 ...
- 帝国CMS文章随机调用等一些常用标签
1.帝国CMS文章随机调用等一些常用标签 [e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*7','onclick desc'}] ...
- 帝国cms常用标签
.loop获取时间标签 /*获取年月日,时分秒.可以按照自己的需求单独获取年,或者月.*/ <?=date("Y-m-d H:i:s",$bqr[newstime])?> ...
- 帝国cms支持的变量及灵动标签变量汇总
帝国CMS对首页.列表页.内容页这三个页面模板支持的变量是不同的,有的是通用的,有的不是通用的,本文就这三个模板常用的变量列于此,另外灵动标签很好用啊,也顺便收藏于此,以备后用,到时不用到处翻来翻去的 ...
- 已收录的帝国cms文章被误删除了怎么办?
我们一直提倡网站要经常备份,但是有时也会遗忘,一不小心被谁删除了那就欲哭无泪了.就像ytkah刚弄了一个站,开了个权限比较高的后台帐号给别人用,居然把两三个栏目都删除了,想发狂啊.刚好又有段时间没备份 ...
- 帝国cms修改[!--show.listpage--]分页页码所生成的html标签
在使用帝国cms系统时,我们用[!--show.page--]和[!--show.listpage--]来生成页码 其中[!--show.listpage--]所生成的html页码代码为: <a ...
- 帝国cms搜索关键字调用标签(showsearch)怎么用
前面ytkah介绍了如何让帝国CMS7.2搜索模板支持动态标签调用,现在我们来说说怎么调用帝国cms搜索关键字调用标签(showsearch).在帝国cms后台那边的使用方法:[showsearch] ...
- 帝国cms调用最新文章 利用文字调用标签phomenews
最近建站时,朋友要求在头部用帝国cms调用最新文章,当时想了用灵动标签调用,但需要设置一个具体的栏目id,这样就不是调用全站的最新文章了,后面查看了一下标签说明,想到了文字调用标签phomenews. ...
- 帝国cms发布信息时替换正文IMG图片标签里的ALT内容
帝国cms发布信息时替换正文IMG图片标签里的ALT内容 在 e/class/userfun.php 里面增加 //替换正文IMG里的ALT内容 function user_imgalt($mid,$ ...
随机推荐
- [LeetCode][Java] Search Insert Position
题目: Given a sorted array and a target value, return the index if the target is found. If not, return ...
- LeetCode242——Valid Anagram
Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = & ...
- 使用 Electron 构建桌面应用(拖动控制篇)
使用 Electron 构建桌面应用(拖动控制篇) 当窗口被定义了大小,我们也就是在自定义这个窗口,使得它不可拉伸没有框架,让它看起来就像一个真正的声效器浮在桌面上. 现在问题来了 – 要如何移动或者 ...
- C++Primer 4th edition读书笔记-第二章
1 变量的定义用于为变量分配存储空间,还可以为变量指定初始值.在一个程序中,变量有且只有一个定义.声明用于向程序表明变量的名字和类型.定义也是声明:当定义变量时,我们声明了它的类型和名字.可以通过使用 ...
- 工作流模式 (zhuan)
http://www.cnblogs.com/soundcode/archive/2010/12/30/1922283.html *********************************** ...
- Query图像滑块插件 (支持触摸/滑动手势)
1.http://bxslider.com/ 2.http://www.slidesjs.com/ (http://www.html5cn.org/article-6437-1.html很多歌)
- RTX——第8章 任务优先级修改
以下内容转载自安富莱电子: http://forum.armfly.com/forum.php 任务优先级设置注意事项RTX 操作系统任务优先级的设置要注意以下几个问题: 设置任务的优先级时,数值越 ...
- maven-gpg-plugin:1.2:sign (sign-artifacts) on project jdbc-pool: Cannot obtain passphrase in batch mode或者是Plugin execution not covered by lifecycle configuration
本解决方案转自:http://blog.csdn.net/tangximing123/article/details/21179467 执行 Maven install 时报错: Failed to ...
- Ajax初窥
Ajax四个步骤 1. 创建Ajax对象2. 连接到服务器3. 发送请求4. 接收返回值 0x01 创建AJAX对象 方法1(非IE6.0) Var oAjax = new XMLHttpReques ...
- C++报错集锦
(一)invalid initialization of non-const reference of type 'float&' from a temporary of type 'floa ...