今天總結(jié)了一些phpcms常用的標簽,方便大家以后忘記了點看就可以查看。
頭部:
{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}
常用系統(tǒng)常量: {CSS_PATH} {JS_PATH} {IMG_PATH} {APP_PATH}//程序目錄
模板包含:{template "content","header"} {template "content","sidebar"} {template "content","footer"}
------常用調(diào)用數(shù)據(jù)-------
{pc:content action="lists" catid="6" num="8" order="inputtime DESC" }
{loop $data $r}
常用標簽:{$r[thumb]}
推薦位調(diào)用:
{pc:content action="position" posid="1" order="listorder DESC" num="5"}
{loop $data $r}
一級欄目調(diào)用:
{pc:content action="category" catid="0" num="8" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
在文章前顯示文章分類名:
{pc:content action="lists" catid="2" order="listorder DESC" num="14" }
{loop $data $n $r}
指定變量循環(huán)增長:
{pc:content...
{php $num = 0}
{loop $data $r}
...
{php $num++}
{/loop}
{/pc}文章從指定位置調(diào)用:num="3" start="5"} (可配合pc:get標簽使用)
文章列表頁調(diào)用關(guān)鍵字,或者首頁調(diào)用關(guān)鍵字:
{pc:content action="lists" catid="$catid" num="10" order="id DESC" page="$page"}
{loop $data $r}
{$r[title]}
php $keywords = explode(',',$r[keywords]);}
文章標簽:
{loop $keywords $keyword}
{$keyword}
{/loop}
{/loop}
{/pc}當列表幾行的時候出現(xiàn)一次某些符號:{if $n%2==1}|{/if}
-------------------列表頁調(diào)用-------------------------
當前位置顯示:
class="postion">當前位置:首頁 > {catpos($catid)} 列表
當前欄目名稱:{$catname}
獲取父欄目id/獲取父欄目名稱:{$CATEGORY[$catid][parentid]} / {$CATEGORYS[$CAT[parentid]][catname]}
指定ID欄目名稱:{$CATEGORYS[欄目ID號]['catname']} / {$CATEGORYS[$catid]['catname']}
其他常用調(diào)用:{$r[description]} {$r[image]}
列表內(nèi)容顯示(帶分頁):
{pc:content action="lists" catid="$catid" num="20" order="id DESC" page="$page"} {loop $data $r}
- {date('Y-m-d H:i:s',$r[inputtime])}{$r[title]}
{/loop}{$pages}{/pc}
顯示該欄目下的子欄目:
{if $top_parentid}
{pc:content action="category" catid="$top_parentid" num="15" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
如果欄目下邊沒有子類,那么顯示一級分類
{pc:content action="category" catid="0" num="100" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
頻道頁:
{php $j=1;}
{loop subcat($catid) $v}
{php if($v['type']!=0) continue;}
更多?{$v[catname]}
{pc:content action="lists" catid="$v[catid]" num="5" order="id DESC"}
{loop $data $r}
- {date('Y-m-d',$r[inputtime])}{$r[title]}
{/loop}
{/pc}
{$j++}
{/loop}---------------------文章內(nèi)容頁-------------------
顯示內(nèi)容:
{$title} {$inputtime} {$content} {$copyfrom} {$thumb} 當前所屬欄目:{$CAT[catname]} 當前所屬欄目URL:{$CAT[url]}
獲取多文件類型的上傳的第一個文件地址:{php eval("\$arr=" . $r[upload] . ";");echo $arr[0]['fileurl'];}
父欄目名稱與鏈接:{$CATEGORYS[$CAT[parentid]][catname]} 與 {$CATEGORYS[$CAT[parentid]][url]}
獲取上上級欄目名稱與鏈接:{$CATEGORYS[$CATEGORYS[$CAT[p
arentid]][parentid]][catname]} 與 {$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][url]}
組圖列表:
{loop $photos $r}
瀏覽次數(shù):
次
顯示上一頁和下一頁:
文章內(nèi)容分頁:
加載評論:
{if $allow_comment && module_exists('comment')}
{/if}-----------PC:get語句調(diào)用數(shù)據(jù)---------------
用pc:get時的記錄條數(shù)時分頁顯示:
解決辦法一:
{pc:get sql="SELECT title,url FROM v9_news where catid=9 and status=99 order by updatetime desc" start="0" num="4" return="v"}
解決辦法二:
{pc:get sql="SELECT title,url FROM v9_news where catid=9 and status=99 order by updatetime desc limit 0,4--" return="v"}
在首頁某模型所有欄目最新文章調(diào)用帶欄目名稱
{pc:get sql="select * from v9_convert_news where status=99 order by id desc" num="11"}
{loop $data $v}
---------------------友情鏈接-----------------------------------------------------------------------
{pc:link action="type_list" typeid="0" siteid="1" linktype="1" order="listorder DESC" num="8"}
{loop $data $v}
{$v['name']}
{/loop}
{/pc}一般常用標題: {$v['url']} {$v['url']} {$v['logo']}
注:linktype="1"時為圖片友情。為0時為文本鏈接
--------------調(diào)用單頁內(nèi)容-------------------------------
{pc:get sql="SELECT content FROM v9_page where catid='6'" return="data"}
{loop $data $r}
{str_cut(strip_tags($r[content]), 160)}
{/loop}
{/pc}---------------調(diào)用排行-----------------
{pc:content action="hits" catid="13" order="weekviews DESC" num="4"}
{loop $data $r}
統(tǒng)計:{tjcode()}
碎片:{pc:block pos="scroll"}{/pc}



