溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

帝國cms常用標(biāo)簽有哪些

發(fā)布時(shí)間:2020-10-20 17:54:12 來源:億速云 閱讀:161 作者:小新 欄目:建站服務(wù)器

這篇文章給大家分享的是有關(guān)帝國cms常用標(biāo)簽有哪些的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考。一起跟隨小編過來看看吧。

判斷會(huì)員是否登錄

<?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];//取得當(dāng)前欄目的頂級(jí)欄目ID
$rs=$empire->fetch2("select * from phome_enewsclass where classid=$topbclassid");
?>
_<?=$rs['bname']?>_<?=$public_r[sitename]?> 頂級(jí)欄目名稱+網(wǎng)站標(biāo)題

<?=$class_r[$GLOBALS[navclassid]][bname]?> 得到當(dāng)前欄目的名稱
<title>[!--pagetitle--] </title> 或  <title><?=$class_r[$GLOBALS[navclassid]][bname]?></title>
<meta name="keywords" content="[!--pagekey--]" />
<meta name="description" content="[!--pagedes--]" />
isgood=1 一級(jí)推薦

firsttitle=1 一級(jí)頭條

[e:loop={10,3,0,0}] 10當(dāng)前欄目,3顯示條數(shù),

[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--] 循環(huán)序號(hào)

<?=$bqsr['titleurl']?> <?=$bqr[title]?> <?=esub($bqr[title],8)?>

[/e:loop]

<?=DoWapRepNewstext($r[newstext])?>

時(shí)間調(diào)用標(biāo)簽:<?=date("Y-m-d",$bqr['newstime'])?>


列表頁

您當(dāng)前的位置:[!--newsnav--]

[!--no.num--]

[!--show.listpage--]

內(nèi)容頁

[!--info.next--]下一篇 [!--info.pre--]上一篇

萬能標(biāo)簽用[!--onclick--] 靈動(dòng)標(biāo)簽用<?=$bqr[onclick]?> 點(diǎn)擊量

代碼如下:

$titleurl=sys_ReturnBqTitleLink($navinfor); 獲得當(dāng)前頁面的網(wǎng)址
$url = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']; 獲得當(dāng)前頁面的網(wǎng)址

sql語句

代碼如下:

<?php
//報(bào)名人數(shù)
$num=$empire->gettotal("select count(*) as total from phome_enewsfeedback where kft='".$navinfor[title]."'");
?>

帝國CMS經(jīng)常用到的調(diào)用sql語句:

請(qǐng)注意,如果是帝國7.0版本的,需要將checked=1去掉

代碼如下:

  1,根據(jù)最新文章 select * from [!db.pre!]ecms_news where checked=1 order by newstime desc limit 10
  2,根據(jù)推薦文章 select * from [!db.pre!]ecms_news where checked=1 and isgood=1 order by newstime desc limit 10
  3,根據(jù)熱門文章 select * from [!db.pre!]ecms_news where checked=1 order by onclick desc limit 10
  4,根據(jù)頭條新聞 select * from [!db.pre!]ecms_news where checked=1 and firsttitle=1 order by newstime desc limit 10
  5,根據(jù)評(píng)論排行 select * from [!db.pre!]ecms_news where checked=1 order by plnum desc limit 10
  6,根據(jù)digg排行 select * from [!db.pre!]ecms_news where checked=1 order by diggtop desc limit 10
  7,根據(jù)投票排行 select * from [!db.pre!]ecms_news where checked=1 order by votenum desc limit 10
  8,根據(jù)下載排行 select * from [!db.pre!]ecms_news where checked=1 order by totaldown desc limit 10
  9,根據(jù)評(píng)分排行 select * from [!db.pre!]ecms_news where checked=1 order by infopfen desc limit 10

小技巧收錄:

php三元條件運(yùn)算符:

代碼如下:

<?=$bqr['ftitle']?$bqr['ftitle']:$bqr['title']?>

靈動(dòng)或者php查詢調(diào)用編輯器內(nèi)容的時(shí)候要加stripslashes刪除反斜杠比如:

代碼如下:

<?=stripslashes($r['newstext'])?>

內(nèi)容頁當(dāng)前信息ID:

代碼如下:

$navinfor['id']

列表內(nèi)容模板信息ID:

代碼如下:

$r['id']

當(dāng)前欄目名:

代碼如下:

$class_r[$GLOBALS['navclassid']]['classname'];

當(dāng)前欄目父欄目:

代碼如下:

$class_r[$GLOBALS['navclassid']]['bclassid'];

當(dāng)前欄目別名:

代碼如下:

$class_r[$GLOBALS['navclassid']]['bname'];

當(dāng)前欄目子欄目:

代碼如下:

$class_r[$GLOBALS['navclassid']]['sonclass'];

當(dāng)前欄目子判斷是否為終級(jí)欄目:

代碼如下:

$class_r[$GLOBALS['navclassid']]['islast'];

當(dāng)前欄目是否有已審核信息:

代碼如下:

$GLOBALS['num']==0為沒有信息

帝國cms中引入php路徑寫法(例子是文件在根目錄)

代碼如下:

<?php include(ECMS_PATH."./bottom.php");?>

排除置頂、頭條、推薦等,sql附加條件:

代碼如下:

'istop=0 and isgood=0 and firsttitle=0'

上上級(jí)欄目id:

<?php
$bclassid=$class_r[$GLOBALS[navclassid]][bclassid];
$bbclassid=$class_r[$bclassid][bclassid];
echo $bbclassid;
?>
$bbclassid就是上上級(jí)父欄目id

投稿、登陸、反饋、留言等之后跳轉(zhuǎn)指定頁面:

代碼如下:

<input type=hidden name=ecmsfrom value="返回頁面地址">

統(tǒng)計(jì)信息被收藏?cái)?shù):

代碼如下:

<?
$favas=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsfava where id='$navinfor[id]' and classid='$GLOBALS[navclassid]'");
?>
<?=$favas?>就是這條信息的收藏?cái)?shù)

列表、結(jié)合項(xiàng)判斷當(dāng)前沒有信息給出提示:

<?
if($GLOBALS['num']=='0'){
?>
<p>對(duì)不起,暫時(shí)沒有任何信息!</p>
<?
}else{
?>
[!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]
<?
}
?>
[/code]

動(dòng)態(tài)使用:

網(wǎng)站名稱:<?=$public_r['sitename']?>
網(wǎng)站地址:<?=$public_r['newsurl']?>

帝國自身的時(shí)間轉(zhuǎn)換函數(shù):

代碼如下:

<?=format_datetime($bqr[newstime],'Y-m-d')?>

此函數(shù)自帶判斷,比較不錯(cuò),推薦。

判斷內(nèi)容是否有圖片,沒有圖片則顯示文中廣告 有圖片則不顯示:

代碼如下:

<?php
$string=$navinfor['newstext'];//內(nèi)容字段
$some="<img ";
$num=explode($some,$string);
if(count($num)>1){//判斷內(nèi)容中是否有圖片
?>
[!--newstext--]
<?
}else{
?>
<div id="ad">我是廣告</div>
[!--newstext--]
<?
}
?>

截取加過濾標(biāo)簽:

代碼如下:

<?=esub(htmlspecialchars(strip_tags($navinfor[newstext])),160)?>

內(nèi)容頁或靈動(dòng)標(biāo)簽支持標(biāo)題屬性
內(nèi)容頁:

代碼如下:

<?=DoTitleFont($navinfor[titlefont],$navinfor[title])?>

靈動(dòng)標(biāo)簽:

代碼如下:

<?=DoTitleFont($bqr[titlefont],$bqr[title])?>

標(biāo)題截取字?jǐn)?shù)+標(biāo)題屬性:

代碼如下:

<?=DoTitleFont($bqr[titlefont],esub($bqr[title],32,'...'))?>

感謝各位的閱讀!關(guān)于帝國cms常用標(biāo)簽有哪些就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI