首頁 >CMS教程 >帝國CMS >帝國cms常用標籤總結

帝國cms常用標籤總結

silencement
silencement轉載
2019-11-26 14:22:212951瀏覽

帝國cms常用標籤總結

判斷會員是否登入

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}]<? =$bqr[bname]?>[/e:loop]

[e:loop={"select * from phome_enewsclass where classid='$GLOBALS[navclassid]'",1 ,24,0}]<?=$bqr[bname]?>[/e:loop]

$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");
?>
_ 頂級欄位名稱網站標題

取得目前欄位目的名稱
[!--pagetitle--] 或 <?=$class_r[$GLOBALS[navclassid]][bname]?>


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}]




[/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語句

 程式碼如下:

//報名人數 
$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!] ? 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'];

Current column alias:

The code is as follows:

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

Current column sub-column:

The code is as follows:

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

Judge whether the current column is the final column:

The code is as follows:

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

Whether the current column has reviewed information:

The code is as follows:

$GLOBALS['num']==0 means there is no information

Introduce php path writing method into empire cms (for example, the file is in the root directory)

The code is as follows:

Exclude top, headlines, recommendations, etc., sql additional conditions:

The code is as follows:

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

Superior column id:

$bclassid=$class_r[$GLOBALS[navclassid]][bclassid];
$bbclassid=$class_r[$bclassid][ bclassid];
echo $bbclassid;
?>
$bbclassid is the superior parent column id

Jump to the specified page after submission, login, feedback, message, etc.:

The code is as follows:

Number of statistics collected:

The code is as follows:

$favas=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsfava where id='$navinfor[id]' and classid='$GLOBALS[navclassid]'");
?>
It is a list of the number of collections of this message

, combined with items to determine the current No information is given:

if($GLOBALS['num']=='0'){
?>

Sorry, temporarily Not a single piece of news!


}else{
?>
[!--empirenews.listtemp--][! --empirenews.listtemp--]
}
?>
[/code]

Dynamic usage:

Website name:< ;?=$public_r['sitename']?>
Website address:

The empire’s own time conversion function:

The code is as follows:

This function has its own judgment, which is quite good and recommended.

Determine whether the content has pictures. If there is no picture, the advertisement in the text will be displayed. If there is a picture, it will not be displayed:

The code is as follows:

$string=$ navinfor['newstext'];//Content field
$some="$num=explode($some,$string);
if(count($num)> 1){//Determine whether there are pictures in the content
?>
[!--newstext--]
}else{
?>
< ;div id="ad">I am an advertisement


[!--newstext--]
}
?>

Intercept and add filter tags:

The code is as follows:

Content The page or smart tag supports the title attribute
Content page:

The code is as follows:

Smart label:

The code is as follows:

Title interception word count title attribute:

The code is as follows:

The above is the entire content of this article, I hope you all like it.

以上是帝國cms常用標籤總結的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:www.word666.com。如有侵權,請聯絡admin@php.cn刪除
上一篇:帝國cms使用js+css實現目前欄位高亮效果的方法下一篇:帝國cms使用js+css實現目前欄位高亮效果的方法

相關文章

看更多