《:帝国cms常用标签汇总》要点:
本文介绍了:帝国cms常用标签汇总,希望对您有用。如果有疑问,可以联系我们。
[!--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]'",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}] 10当前栏目,3显示条数,[e:loop={4,1000,'leib="楼市快讯"','id DESC'}] 1有图片的显示. [e:loop={"select * from phome_ecms_xtgg where firsttitle=1 order by id DESC limit 20",6,0}] <?=$bqno?> [!--no.num--] 循环序号 <?=$bqsr['titleurl']?> <?=$bqr[title]?> <?=esub($bqr[title],8)?> [/e:loop]
<?=DoWapRepNewstext($r[newstext])?>PHP实战
时间调用标签:<?=date("Y-m-d",$bqr['newstime'])?>PHP实战
您当前的位置:[!--newsnav--]PHP实战
[!--no.num--]PHP实战
[!--show.listpage--]PHP实战
[!--info.next--]下一篇 [!--info.pre--]上一篇PHP实战
万能标签用[!--onclick--] 灵动标签用<?=$bqr[onclick]?> 点击量PHP实战
$titleurl=sys_ReturnBqTitleLink($navinfor); 获得当前页面的网址
$url = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']; 获得当前页面的网址
<?PHP
//报名人数
$num=$empire->gettotal("select count(*) as total from phome_enewsFeedback where kft='".$navinfor[title]."'");
?>
请注意,如果是帝国7.0版本的,必要将checked=1去掉PHP实战
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删除反斜杠好比:PHP实战
<?=stripslashes($r['newstext'])?>
$navinfor['id']
$r['id']
当前栏目名:PHP实战
$class_r[$GLOBALS['navclassid']]['classname'];
当前栏目父栏目:PHP实战
$class_r[$GLOBALS['navclassid']]['bclassid'];
当前栏目别名:PHP实战
$class_r[$GLOBALS['navclassid']]['bname'];
当前栏目子栏目:PHP实战
$class_r[$GLOBALS['navclassid']]['sonclass'];
当前栏目子判断是否为终级栏目:PHP实战
$class_r[$GLOBALS['navclassid']]['islast'];
当前栏目是否有已审核信息:PHP实战
$GLOBALS['num']==0为没有信息
帝国cms中引入PHP路径写法(例子是文件在根目录)PHP实战
'istop=0 and isgood=0 and firsttitle=0'
上上级栏目id:PHP实战
<?PHP $bclassid=$class_r[$GLOBALS[navclassid]][bclassid]; $bbclassid=$class_r[$bclassid][bclassid]; echo $bbclassid; ?> $bbclassid便是上上级父栏目id
<?
$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--]
<?
}
?>
[/code]PHP实战
动态使用:PHP实战
网站名称:<?=$public_r['sitename']?>
网站地址:<?=$public_r['newsurl']?>PHP实战
<?=format_datetime($bqr[newstime],'Y-m-d')?>
判断内容是否有图片,没有图片则显示文中广告 有图片则不显示:PHP实战
<?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常用标签汇总》等实战技能,PHP、MysqL、LINUX、APP、JS,CSS全面培养人才。