[!--news.url--]skin/default/[e:loop={"select classid,classname,bname from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}][/e:loop][e:loop={"select * from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}] [/e:loop]fetch1("select * from phome_enewsclass where classid=$topbclassid");?>__ 顶级栏目名称+网站标题 得到当前栏目的名称 [!--pagetitle--] 或
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}] [!--no.num--] 循环序号 [/e:loop]
您当前的位置:[!–newsnav–]
[!–no.num–]
[!–show.listpage–]
内容页
[!–info.next–]下一篇 [!–info.pre–]上一篇
万能标签用[!–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三元条件运算符:
灵动或者php查询调用编辑器内容的时候要加stripslashes删除反斜杠比如:
内容页当前信息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路径写法(例子是文件在根目录)
排除置顶、头条、推荐等,sql附加条件:
'istop=0 and isgood=0 and firsttitle=0'
上上级栏目id:
$bbclassid就是上上级父栏目id投稿、登陆、反馈、留言等之后跳转指定页面:
统计信息被收藏数:
<?
$favas=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsfava where id='$navinfor[id]' and classid='$GLOBALS[navclassid]'");
?>
就是这条信息的收藏数