帝國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}]
[e:loop={"select * from phome_enewsclass where classid='$GLOBALS[navclassid]'",1 ,24,0}]
$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]?> 取得目前欄位目的名稱
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}]
=$bqno?> ; [!--no.num--] 循環序號
=$bqsr['titleurl']?> =$bqr[title]?> =esub ($bqr[title],8)?>
[/e:loop]
=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!
}else{
?>
[!--empirenews.listtemp--][! --empirenews.listtemp--]
}
?>
[/code]
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
[!--newstext--]
}
?>
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中文網其他相關文章!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

透過存取config.inc.php檔案並檢查dositemap設置,可以找到帝國CMS網站地圖。如果設定為"on",則網站地圖已啟用。網站地圖路徑位於sitemapurl設定中,可以透過瀏覽器存取或透過FTP下載。

帝國CMS的手機端設定位於「模板管理」模組的「手機模板」中,具體步驟包括:啟用模板、選擇應用頻道、編輯模板內容,並儲存設定。

帝國CMS模板檔案理想的放置位置是/e/template/default/skin/default/,其次還可以放置在/e/data/skins/和/e/skin/,需要注意保持資料夾結構、設定檔案權限以及定期備份。

帝國CMS資料庫設定檔位於網站根目錄下e/config/db.inc.php,它包含以下設定資訊:$dbhost:資料庫伺服器位址$dbuser:資料庫使用者名稱$dbpass:資料庫密碼$dbname:資料庫名稱$dbport :資料庫連接埠$dbcharset:資料庫字元集

帝國CMS的自動發布介面位於/e/api/web/postinfo.php,使用步驟如下:存取/e/api/web/postinfo.php 位址使用HTTP POST 提交文章標題、欄位ID、分類ID、作者和文章內容等資料介面會傳回一個JSON 格式的回應,其中包含發佈結果和文章ID

帝國cms百度主動推送插件位於根目錄/e/api/baidu/push.php。具體設定步驟如下:1. 上傳外掛程式至指定路徑。 2. 在帝國cms後台設定「百度主動推送」選項,包括推送位址、API Key和推送間隔。 3. 取得百度推送資訊:推送位址:https://data.zz.baidu.com/urls?site=YOUR_SITE&token=YOUR_API_KEY,API Key:登入百度搜尋資源平台取得。 4. 定期更新API Key,並設定合理的推送間隔。

帝國CMS模板下載位置:官方模板下載:https://www.phome.net/template/第三方模板網站:https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/安裝方式:下載模板解壓縮模板上傳模板選擇模板

是的,帝國CMS是一款免費的開源內容管理系統(CMS)。它是一款輕量CMS,功能豐富,易於使用。帝國CMS遵循GNU通用公共授權(GPL),這意味著它可以免費下載、安裝和使用。對於商業用途,它提供了付費版本,提供額外的功能和支持,例如廣告管理、線上支付和高級技術支援。
