判斷會員是否登入
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}]
=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語句
程式碼如下:
//報名人數
$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三元條件運算子:
程式碼如下:
=$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'];
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]'");
?>
=$favas?>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!
Dynamic usage:
Website name:< ;?=$public_r['sitename']?>
Website address: =$public_r['newsurl']?>
The empire’s own time conversion function:
The code is as follows:
=format_datetime($bqr[newstime],'Y-m-d')?>
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
Intercept and add filter tags:
The code is as follows:
=esub(htmlspecialchars(strip_tags($navinfor[newstext])),160)?>
Content The page or smart tag supports the title attribute
Content page:
The code is as follows:
=DoTitleFont($navinfor[titlefont],$navinfor[title])?>
Smart label:
The code is as follows:
=DoTitleFont($bqr[titlefont],$bqr[title])?>
Title interception word count title attribute:
The code is as follows:
=DoTitleFont($bqr[titlefont],esub($bqr[title],32,'...')) ?>
The above is the entire content of this article, I hope you all like it.
以上是帝國cms常用標籤總結的詳細內容。更多資訊請關注PHP中文網其他相關文章!