熟悉PbootCMS手冊是使用本程序開發(fā)模板的前提,雖然我們盡可能把所有標(biāo)簽做到簡單到想哭,但是還是需要您靜下心來好好看看!
全新內(nèi)核的PHP開源企業(yè)網(wǎng)站開發(fā)建設(shè)管理系統(tǒng),系統(tǒng)以高效、簡潔、強(qiáng)悍為開發(fā)目標(biāo),能夠滿足各類企業(yè)網(wǎng)站建設(shè)開發(fā)的需要。
系統(tǒng)后臺默認(rèn)訪問路徑:http://域名/admin.php 賬號:admin 密碼:123456
系統(tǒng)自帶完整后臺以及一套響應(yīng)式模板,默認(rèn)采用Sqlite數(shù)據(jù)庫,放入PHP(5.3+)環(huán)境即可直接使用,另外,如果您是在服務(wù)器上那么需要到官網(wǎng)先免費(fèi)獲取授權(quán)碼填寫到后臺相應(yīng)位置才能打開網(wǎng)站前臺
默認(rèn)采用sqlite數(shù)據(jù)庫,不需要做導(dǎo)入和配置操作,如果需要啟用mysql版本,請導(dǎo)入數(shù)據(jù)庫文件(/static/backup/sql/xxx.sql)并修改數(shù)據(jù)庫連接文件信息(/config/database.php)
QQ:6364544(客服)
{include file=***.html}
使用說明:
可以嵌套使用,如:index.html 嵌套一個head.html,同時head.html中嵌套comm.html
支持使用子目錄,如:{include file=comm/***.html}
style=*
如:內(nèi)容列表時間格式化[list:date style=Y-m-d]、內(nèi)容詳情頁時間格式化{content:date style=Y-m-d}
使用說明:
時間格式化標(biāo)簽和PHP時間格式化語法一致,分別用不同字母代替,中間可以穿插任意字符,如:Y-m-d、Y/m/d、Y年m月d日等等
注意:Y代表完整年份,y代表簡化年份,m代表月份,d代表日,H代表小時,i代表分,s代表秒,如完整時間:style='Y-m-d H:i:s',更多請參考PHP時間格式化語法 ,參考鏈接 :http://php.net/manual/zh/function.date.php
drophtml=1
如:內(nèi)容列表內(nèi)容[list:content drophtml=1]、內(nèi)容詳情頁內(nèi)容{content:content drophtml=1}
使用說明:
一般在首頁等特殊位置需要調(diào)取正文一段純文本時使用,這時一般會配合下面的內(nèi)容截取標(biāo)簽一起使用
長度截取使用len=* 或 lencn=* ,使用第二個將避免中英文長度不統(tǒng)一問題,一個英文字符算半個字
(V1.3.5+)內(nèi)容截取時可使用more='*'設(shè)置省略號內(nèi)容,設(shè)置more=''則不顯示省略號
如:內(nèi)容列表標(biāo)題截取[list:title len=10]、內(nèi)容詳情頁時間格式化{content:title len=10}
substr=x,y 截取一段
substr截取字符串長度,傳遞兩個數(shù)字,第一個為起始位置,第二個為截取長度,如只有一個數(shù)字則截取此數(shù)字起后面全部
使用說明:
使用內(nèi)容截取時要注意如果是html內(nèi)容需要先去除html再截取,否則可能導(dǎo)致html錯位,如:[list:content drophtml=1 len=50]
dropblank=1 ,去除空白字符,如換行符、制表符等
decode=1 解碼數(shù)據(jù)html字符,如果等于0.則不解碼(包括源碼已經(jīng)解碼的),此標(biāo)簽一般不使用
decimal=* 小數(shù)點(diǎn)位數(shù)
unit=* 容量單位,可以是kb,mb,gb,tb,pb,eb
{label:***}
使用說明:
在后臺”全局配置>定制標(biāo)簽“中定義,前臺使用對應(yīng)名字進(jìn)行調(diào)用即可
{pboot:position}
參數(shù)說明:
separator=* 分隔符,非必填,默認(rèn)為>>
separatoricon=* 分割圖標(biāo),非必填,如使用圖標(biāo)字體:separatoricon='fa fa-angle-double-right'
indextext=* 首頁文本,非必填,默認(rèn)為"首頁"
indexicon=* 首頁圖標(biāo),非必填,如使用圖標(biāo)字體:indexicon='fa fa-home'
{pboot:httpurl}
使用說明:
自適應(yīng)獲取當(dāng)前訪問網(wǎng)址,主要用于需要使用網(wǎng)站路徑前綴的情況,如輸出:https://www.d163.net
{pboot:pageurl}
使用說明:
自適應(yīng)獲取當(dāng)前訪問頁面完整地址
{pboot:qrcode string=***}
使用說明:
用于生成對應(yīng)文本的二維碼圖片,可用于產(chǎn)品列表頁或詳情頁為每個產(chǎn)品生成二維碼 :{pboot:qrcode string={pboot:httpurl}{content:link}}或{pboot:qrcode string={pboot:pageurl}
{pboot:runtime\}
使用說明:
用于輸出頁面運(yùn)行時間/緩存時間,使用時請將反斜杠去掉。
{pboot:checkcodestatus}
使用說明:
用于判斷留言驗(yàn)證碼是否開啟狀態(tài),方便頁面控制驗(yàn)證碼圖標(biāo)的顯示。
http://domain/index.php/sitemap
http://domain/index.php/sitemap.xml
使用說明:
系統(tǒng)使用動態(tài)站點(diǎn)地圖,不需要生成,訪問地址即為實(shí)時地圖,輸出格式為xml,當(dāng)然你也可以打開后另存為一個地圖文件。
如果你已經(jīng)開啟偽靜態(tài),那么地址中將可以不含有index.php。
圖片縮放及裁剪總共四個參數(shù):
參數(shù):width=* height=* maxwidth=* maxheight=*
使用方式,如:[list:ico width=100]
使用說明:
四個參數(shù)可以組合使用,此處會生成改變了圖片大小的緩存圖片,緩存圖片是裁切過后的圖片,但原上傳的圖片不變。
如果不想改變大小及裁切圖片,只是想縮放顯示,那么請使用CSS進(jìn)行控制即可。
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于調(diào)取網(wǎng)站的基本配置信息,對應(yīng)后臺的“基礎(chǔ)內(nèi)容>站點(diǎn)信息”
{pboot:siteindex} | 站點(diǎn)入口地址,用于地址前置引用 |
{pboot:sitepath} | 站點(diǎn)路徑,根目錄時值為空 |
{pboot:sitelanguage} | 站點(diǎn)語言 |
{pboot:sitetitle} | 站點(diǎn)標(biāo)題 |
{pboot:sitesubtitle} | 站點(diǎn)副標(biāo)題 |
{pboot:sitedomain} | 站點(diǎn)域名 |
{pboot:sitelogo} | 站點(diǎn)logo |
{pboot:sitekeywords} | 站點(diǎn)關(guān)鍵字 |
{pboot:sitedescription} | 站點(diǎn)描述 |
{pboot:siteicp} | 站點(diǎn)備案信息 |
{pboot:sitetplpath} | 站點(diǎn)模板路徑 |
{pboot:sitestatistical} | 站點(diǎn)統(tǒng)計 |
{pboot:sitecopyright} | 站點(diǎn)版權(quán) |
{pboot:pagetitle} 根據(jù)不同頁面自動顯示標(biāo)題
{pboot:pagekeywords} 根據(jù)不同頁面自動顯示關(guān)鍵字
{pboot:pagedescription} 根據(jù)不同頁面自動顯示描述
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于調(diào)取網(wǎng)站與公司相關(guān)的信息,對應(yīng)后臺的“基礎(chǔ)內(nèi)容>公司信息”
{pboot:companyname} | 公司名稱 |
{pboot:companyaddress} | 公司地址 |
{pboot:companypostcode} | 郵政編碼 |
{pboot:companycontact} | 聯(lián)系人 |
{pboot:companymobile} | 聯(lián)系手機(jī) |
{pboot:companyphone} | 聯(lián)系電話 |
{pboot:companyfax} | 傳真號碼 |
{pboot:companyemail} | 聯(lián)系郵箱 |
{pboot:companyqq} | QQ號碼 |
{pboot:companyweixin} | 微信圖標(biāo) |
{pboot:companyblicense} | 營業(yè)執(zhí)照號 |
{pboot:companyother} | 其它信息 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于調(diào)導(dǎo)航菜單欄目列表,對應(yīng)后臺的“基礎(chǔ)內(nèi)容>內(nèi)容欄目”
{pboot:nav}
<a href="[nav:link]">[nav:name]</a>
{/pboot:nav}
控制參數(shù):
num=* 數(shù)量,非必填,用于控制輸出的數(shù)量
parent=* 父菜單編碼,非必填,用于控制輸出列表的父菜單編碼,默認(rèn)0,即從一級菜單開始輸出
parent={sort:pcode} 可用于輸出當(dāng)前欄目的同級菜單
parent={sort:scode} 可用于輸出當(dāng)前欄目的子菜單
parent={sort:tcode} 可用于輸出當(dāng)前欄目頂級菜單的子菜單
[nav:n] | 序號,從0開始 |
[nav:i] | 序號,從1開始 |
[nav:pcode] | 父欄目編碼 |
[nav:scode] | 當(dāng)前欄目編碼 |
[nav:name] | 欄目名稱 |
[nav:subname] | 欄目副名稱 |
[nav:link] | 欄目鏈接 |
[nav:type] | 欄目類型,1單頁、2列表 |
[nav:outlink] | 后臺設(shè)置的跳轉(zhuǎn)鏈接 |
[nav:listtpl] | 列表頁模板 |
[nav:contenttpl] | 詳情頁模板 |
[nav:ico] | 欄目縮略圖 |
[nav:pic] | 欄目大圖 |
[nav:keywords] | 欄目關(guān)鍵字 |
[nav:description] | 欄目描述 |
[nav:soncount] | 當(dāng)前欄目子欄目的數(shù)量,無子欄目時為0 |
[nav:rows] | 輸出欄目下內(nèi)容數(shù)量(V1.3+) |
使用判斷語句:{pboot:if('[nav:scode]'=='{sort:tcode}')}class="active"{/pboot:if}
首頁特殊用法:{pboot:if(0=='{sort:scode}')}class="active"{/pboot:if}
二級嵌套
{pboot:nav}
<a href= "[nav:link]">[nav:name]</a>
{pboot:2nav parent=[nav:scode]}
<a href= "[2nav:link]">[2nav:name]</a>
{/pboot:2nav}
{/pboot:nav}
三級嵌套
{pboot:nav}
<a href= "[nav:link]">[nav:name]</a>
{pboot:2nav parent=[nav:scode]}
<a href= "[2nav:link]">[2nav:name]</a>
{pboot:3nav parent=[2nav:scode]}
<a href= "[3nav:link]">[3nav:name]</a>
{/pboot:3nav}
{/pboot:2nav}
{/pboot:nav}
如果有更多級別,以此類推,使用數(shù)字依層級套用,理論上不限級調(diào)用
適用范圍:在列表頁或詳情頁使用
標(biāo)簽作用:用于輸出當(dāng)前欄目的相關(guān)信息
{sort:tcode} | 當(dāng)前欄目的頂級欄目編碼 |
{sort:topname} | 當(dāng)前欄目的頂級欄目名稱 |
{sort:toplink} | 當(dāng)前欄目的頂級欄目鏈接 |
{sort:pcode} | 當(dāng)前欄目的父欄目編碼 |
{sort:parentname} | 當(dāng)前欄目的父欄目名稱 |
{sort:parentlink} | 當(dāng)前欄目的父欄目鏈接 |
{sort:scode} | 當(dāng)前欄目編碼 |
{sort:name} | 欄目名稱 |
{sort:subname} | 欄目副名稱 |
{sort:link} | 欄目鏈接 |
{sort:type} | 欄目類型,1單頁、2列表 |
{sort:outlink} | 后臺設(shè)置的跳轉(zhuǎn)鏈接 |
{sort:listtpl} | 列表頁模板 |
{sort:contenttpl} | 詳情頁模板 |
{sort:ico} | 欄目縮略圖 |
{sort:pic} | 欄目大圖 |
{sort:title} | 欄目標(biāo)題(V1.3+) |
{sort:keywords} | 欄目關(guān)鍵字 |
{sort:description} | 欄目描述 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于調(diào)導(dǎo)航菜單欄目列表,對應(yīng)后臺的“基礎(chǔ)內(nèi)容>內(nèi)容欄目”
{pboot:sort scode=*}
<a href= "[sort:link]">[sort:name]</a>
{/pboot:sort}
控制參數(shù):
scode=* 欄目編碼,必填,用于控制輸出的欄目,可以同時輸出多個(V1.1.6+),使用逗號隔開即可,如:1,2,3
scode={sort:pcode} 可用于輸出當(dāng)前欄目父菜單的信息
scode={sort:scode} 可用于輸出當(dāng)前欄目的信息
scode={sort:tcode} 可用于輸出當(dāng)前欄目頂級菜單的信息
[sort:n] | 序號,從0開始 |
[sort:i] | 序號,從1開始 |
[sort:pcode] | 父欄目編碼 |
[sort:parentname] | 父欄目名稱 |
[sort:scode] | 當(dāng)前欄目編碼 |
[sort:name] | 欄目名稱 |
[sort:subname] | 欄目副名稱 |
[sort:link] | 欄目鏈接 |
[sort:type] | 欄目類型,1單頁、2列表 |
[sort:outlink] | 后臺設(shè)置的跳轉(zhuǎn)鏈接 |
[sort:listtpl] | 列表頁模板 |
[sort:contenttpl] | 詳情頁模板 |
[sort:ico] | 欄目縮略圖 |
[sort:pic] | 欄目大圖 |
[sort:title] | 欄目標(biāo)題(V1.3+) |
[sort:keywords] | 欄目關(guān)鍵字 |
[sort:description] | 欄目描述 |
[sort:rows] | 欄目下內(nèi)容數(shù)量(V1.3+) |
[sort:toprows] | 頂級欄目下內(nèi)容數(shù)量(V1.3+) |
[sort:parentrows] | 父欄目下內(nèi)容數(shù)量(V1.3+) |
適用范圍:指定欄目編碼時全站可用,適用當(dāng)前列表
標(biāo)簽作用:用于調(diào)取指定欄目的內(nèi)容列表或自動當(dāng)前列表
{pboot:list}
<a href= "[list:link]">[list:title]</a>
{/pboot:list}
控制參數(shù):
num=* 每頁數(shù)量,非必填,用于控制分頁大小
order=* 排序方式,非必填,用于輸出內(nèi)容的排序方式,可選:date、sorting、istop、isrecommend、isheadline、visits、likes、oppose、等字段,其中sorting為按后臺填寫的排序,122版本開始支持自定義模式,如:order='date desc,id desc' 、order='sorting desc,id desc',(V1.3.7+)還支持random隨機(jī)排序
filter=*|x,y 數(shù)據(jù)過濾,非必填,用于對列表內(nèi)容進(jìn)行過濾篩選,如:filter=title|ASP,PHP 只顯示標(biāo)題含有ASP和PHP的內(nèi)容,如果需要只顯示推薦,可使用如下過濾參數(shù): filter=isrecommend|1 (V1.2.0+版本用下面的方式更好)
isico=*、ispics=*、istop=*、isrecommend=*、isheadline=* 用于對數(shù)據(jù)進(jìn)行特殊篩選,可選值1和0,非必填,比如只調(diào)取推薦內(nèi)容:isrecommend=1
tags=x,y tags方式數(shù)據(jù)過濾,非必填,用于對列表內(nèi)容進(jìn)行過濾篩選,如:tags='ASP,PHP',則為含有asp或php標(biāo)簽的內(nèi)容,那么可以用 tags={content:tags}來調(diào)用當(dāng)前文章的相關(guān)文章
start=* 起始數(shù)據(jù)(V1.3.2+),非必填,用于需要從第幾條開始
{pboot:list scode=*}
<a href= "[list:link]">[list:title]</a>
{/pboot:list}
控制參數(shù):
scode=* 欄目編碼,必填,用于指定需要調(diào)取的欄目編碼,讀取的內(nèi)容會同時包含該欄目下子菜單的內(nèi)容,支持多個欄目如:1,2,3
page=* 是否分頁,非必填,用于列表是否執(zhí)行分頁,可設(shè)置1或0,本功能適合首頁分頁等場景
start=* 起始數(shù)據(jù)(V1.3.2+),非必填,用于需要從第幾條開始
其余控制參數(shù)同上面當(dāng)前欄目內(nèi)容列表
[list:n] | 計數(shù)0開始 |
[list:i] | 計數(shù)1開始 |
[list:id] | 編號 |
[list:scode] | 分類編碼 |
[list:subscode] | 副分類編碼 |
[list:sortname] | 分類名稱 |
[list:subsortname] | 副分類名稱 |
[list:sortlink] | 分類鏈接 |
[list:subsortlink] | 副分類鏈接 |
[list:title] | 標(biāo)題 |
[list:titlecolor] | 標(biāo)題顏色 |
[list:subtitle] | 副標(biāo)題 |
[list:tags] | 直接輸出tags |
[list:author] | 作者 |
[list:source] | 來源 |
[list:link] | 鏈接 |
[list:outlink] | 外部鏈接 |
[list:date] | 發(fā)布日期 |
[list:ico] | 縮略圖,[list:isico]可用于判斷,返回1或0 |
[list:pics] | 多圖 |
[list:content] | 內(nèi)容 |
[list:enclosure] | 附件 |
[list:enclosuresize] | 附件大小 |
[list:keywords] | 關(guān)鍵詞 |
[list:description] | 描述 |
[list:istop] | 是否置頂 |
[list:isrecommend] | 是否推薦 |
[list:isheadline] | 是否頭條 |
[list:visits] | 訪問數(shù)量 |
[list:likes] | 點(diǎn)贊數(shù)量 |
[list:oppose] | 反對數(shù)量 |
[list:likeslink] | 點(diǎn)贊鏈接 |
[list:opposelink] | 反對鏈接 |
[list:ext_***] | 調(diào)取擴(kuò)展字段內(nèi)容 |
適用范圍:分頁條標(biāo)簽適用所有執(zhí)行了分頁的頁面
標(biāo)簽作用:用于輸出分頁代碼
{page:bar} | 系統(tǒng)內(nèi)置的完整分頁條 |
{page:current} | 當(dāng)前頁碼 |
{page:count} | 總頁數(shù) |
{page:rows} | 總數(shù)據(jù)行數(shù) |
{page:index} | 首頁鏈接 |
{page:pre} | 前一頁鏈接 |
{page:next} | 下一頁鏈接 |
{page:last} | 尾頁鏈接 |
{page:status} | 分頁狀態(tài)信息 |
{page:numbar} | 數(shù)字條,數(shù)字帶class名稱為page-num,當(dāng)前的同時還帶page-num-current |
{page:selectbar} | 下拉選擇條 |
狀態(tài):page-status
首頁:page-index
上一頁:page-pre
下一頁:page-next
尾頁:page-last
數(shù)字條:page-numbar ,數(shù)字條下面的數(shù)字:page-num ,如果是當(dāng)前頁,那么該數(shù)字還同時帶有:page-num-current
下拉條:page-select (默認(rèn)條已經(jīng)不顯示)
如果使用系統(tǒng)完整分頁條,則以上樣式名稱在輸出的HTML代碼中都帶,你可以直接使用對應(yīng)名稱在自己的css中定義具體樣式即可;
如果使用自定義方式,那么就按照自己寫的html代碼來定義,但是數(shù)字條下面的page-num 、page-num-current依然有效。
適用范圍:在內(nèi)容詳情頁使用,包括單頁和列表點(diǎn)擊后的詳情頁
標(biāo)簽作用:用于輸出當(dāng)前內(nèi)容的相關(guān)信息
{content:id} | 編號 |
{content:scode} | 分類編碼 |
{content:subscode} | 副分類編碼 |
{content:sortname} | 分類名稱 |
{content:subsortname} | 副分類名稱 |
{content:sortlink} | 分類鏈接 |
{content:subsortlink} | 副分類鏈接 |
{content:title} | 標(biāo)題 |
{content:titlecolor} | 標(biāo)題顏色 |
{content:subtitle} | 副標(biāo)題 |
{content:author} | 作者 |
{content:source} | 來源 |
{content:link} | 鏈接 |
{content:outlink} | 外部鏈接 |
{content:date} | 發(fā)布日期 |
{content:ico} | 縮略圖,{content:isico}可用于判斷,返回1或0 |
{content:pics} | 多圖 |
{content:content} | 內(nèi)容 |
{content:tags} | 直接輸出tags |
{content:enclosure} | 附件 |
{content:enclosuresize} | 附件大小 |
{content:keywords} | 關(guān)鍵詞 |
{content:description} | 描述 |
{content:istop} | 是否置頂 |
{content:isrecommend} | 是否推薦 |
{content:isheadline} | 是否頭條 |
{content:visits} | 訪問數(shù)量 |
{content:likes} | 點(diǎn)贊數(shù)量 |
{content:oppose} | 反對數(shù)量 |
{content:likeslink} | 點(diǎn)贊鏈接 |
{content:opposelink} | 反對鏈接 |
{content:ext_***} | 調(diào)取擴(kuò)展字段內(nèi)容 |
{content:precontent} | 上一篇內(nèi)容(帶鏈接) |
{content:nextcontent} | 下一篇內(nèi)容(帶鏈接) |
{content:prelink} | 上一篇內(nèi)容鏈接 |
{content:nextlink} | 下一篇內(nèi)容鏈接 |
{content:pretitle} | 上一篇內(nèi)容標(biāo)題 |
{content:nexttitle} | 下一篇內(nèi)容標(biāo)題 |
{content:nexttitle notext='no more'} | 設(shè)置“沒有了”文本,設(shè)置參數(shù)時如果帶空格,需要用單引號 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于調(diào)取指定id的內(nèi)容
{pboot:content id=*}
<a href= "[content:link]">[content:title]</a>
{/pboot:content}
控制參數(shù):
id=* 內(nèi)容的ID號,必填,用于控制輸出的內(nèi)容,適用單頁或列表頁內(nèi)容
scode=* 單頁的分類編碼,必填,用于控制輸出單頁的內(nèi)容,只適用單頁內(nèi)容
[content:id] | 編號 |
[content:scode] | 分類編碼 |
[content:subscode] | 副分類編碼 |
[content:sortname] | 分類名稱 |
[content:subsortname] | 副分類名稱 |
[content:sortlink] | 分類鏈接 |
[content:subsortlink] | 副分類鏈接 |
[content:title] | 標(biāo)題 |
[content:titlecolor] | 標(biāo)題顏色 |
[content:subtitle] | 副標(biāo)題 |
[content:author] | 作者 |
[content:source] | 來源 |
[content:link] | 鏈接 |
[content:outlink] | 外部鏈接 |
[content:date] | 發(fā)布日期 |
[content:ico] | 縮略圖 |
[content:pics] | 圖集 |
[content:content] | 內(nèi)容 |
[content:tags] | 直接輸出tags |
[content:enclosure] | 附件 |
[content:enclosuresize] | 附件大小 |
[content:keywords] | 關(guān)鍵詞 |
[content:description] | 描述 |
[content:istop] | 是否置頂 |
[content:isrecommend] | 是否推薦 |
[content:isheadline] | 是否頭條 |
[content:visits] | 訪問數(shù)量 |
[content:likes] | 點(diǎn)贊數(shù)量 |
[content:oppose] | 反對數(shù)量 |
[content:likeslink] | 點(diǎn)贊鏈接 |
[content:opposelink] | 反對鏈接 |
[content:ext_***] | 調(diào)取擴(kuò)展字段內(nèi)容 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于依次輸出指定內(nèi)容的多張圖片
{pboot:pics id=* num=*}
<img src="[pics:src]">
{/pboot:pics}
控制參數(shù):
id=* 內(nèi)容ID號,必填,用于控制需要輸出圖片的內(nèi)容,也可使用id={content:id}、id=[list:id]自適應(yīng)當(dāng)前內(nèi)容及列表
num=* 數(shù)量,非必填,用于控制需要輸出圖片得數(shù)量
[pics:n] | 序號從0開始 |
[pics:i] | 序號從1開始 |
[pics:src] | 圖片地址 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于依次輸出指定內(nèi)容的多選值,也可用于遍歷逗號隔開的字段,如tag
{pboot:checkbox id=* field=*}
[checkbox:text]
{/pboot:checkbox}
控制參數(shù):
id=* 內(nèi)容ID號,必填,用于控制需遍歷多選的內(nèi)容,也可使用id={content:id}、id=[list:id]自適應(yīng)當(dāng)前內(nèi)容及列表
field=* 字段,必填,用于控制需要遍歷的字段,如擴(kuò)展字段產(chǎn)品特色:ext_cpts
[checkbox:n] | 序號從0開始 |
[checkbox:i] | 序號從1開始 |
[checkbox:text] | 文本 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于依次輸出指定分組的幻燈片圖片
{pboot:slide gid=* num=*}
<img src="[slide:src]">
{/pboot:slide}
控制參數(shù):
gid=* 分組,必填,用于控制需要輸出的幻燈片分組
num=* 數(shù)量,非必填,用于控制需要輸出的數(shù)量,默認(rèn)為5個
[slide:n] | 序號從0開始 |
[slide:i] | 序號從1開始 |
[slide:id] | 編號 |
[slide:src] | 圖片地址 |
[slide:link] | 鏈接地址 |
[slide:title] | 標(biāo)題 |
[slide:subtitle] | 副標(biāo)題 |
適用范圍:全站任意地方均可使用
{pboot:tags scode=*,*}
<a href="[tags:link]">[tags:text]</a>
{/pboot:tags}
控制參數(shù):
scode=* 欄目編碼,用于控制需要輸出內(nèi)容的欄目編碼,多個用逗號隔開
num=* 數(shù)量,非必填,用于控制需要輸出的數(shù)量
{pboot:tags id=*}
<a href="[tags:link]">[tags:text]</a>
{/pboot:tags}
控制參數(shù):
id=* 內(nèi)容ID,用于控制需要輸出的內(nèi)容ID,如果與列表標(biāo)簽嵌套可以用id=[list:id]
num=* 數(shù)量,非必填,用于控制需要輸出的數(shù)量
{pboot:list scode=* tags='x,y'}
<p><a href="[list:link]">[list:title]</a></p>
{/pboot:list}
[tags:n] | 序號從0開始 |
[tags:i] | 序號從1開始 |
[tags:link] | 鏈接地址 |
[tags:text] | tags名稱 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于依次輸出指定分組的友情鏈接
{pboot:link gid=* num=*}
<a href="[link:link]" title="[link:name]"><img src="[link:logo]"></a>
{/pboot:link}
控制參數(shù):
gid=* 分組,必填,用于控制需要輸出的友情鏈接分組
num=* 數(shù)量,非必填,用于控制需要輸出的數(shù)量,默認(rèn)為10個
[link:n] | 序號從0開始 |
[link:i] | 序號從1開始 |
[link:id] | 編號 |
[link:name] | 鏈接名稱 |
[link:link] | 鏈接地址 |
[link:logo] | 鏈接Logo圖 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于用戶提交留言和調(diào)取留言記錄
<form action="{pboot:msgaction}" method="post">
聯(lián)系人:<input type="text" name="contacts" >
手機(jī):<input type="text" name="mobile" >
內(nèi)容:<input type="text" name="content" >
驗(yàn)證碼:<input type="text" name="checkcode" ><img title="點(diǎn)擊刷新" src="{pboot:checkcode}" onclick="this.src='{pboot:checkcode}?'+Math.round(Math.random()*10);" />
<button type="submit">提交</button>
</form>
標(biāo)簽說明:
{pboot:msgaction} 為留言表單接收地址
{pboot:checkcode} 為驗(yàn)證碼圖片地址
{pboot:message num=*}
<p>[message:contacts]</p>
<p>[message:content]</p>
{/pboot:message}
控制參數(shù):
num=* 數(shù)量,非必填,為調(diào)取的留言分頁大小
page=* 是否分頁1或0,非必填,用于關(guān)閉分頁
lg=* 調(diào)取指定語言留言,非必填,設(shè)置all則所有語言,不添加該參數(shù)則默認(rèn)為當(dāng)前語言(V1.3.7+)
[message:n] | 序號從0開始 |
[message:i] | 序號從1開始 |
[message:contacts] | 聯(lián)系人 |
[message:mobile] | 手機(jī) |
[message:content] | 內(nèi)容 |
[message:recontent] | 回復(fù)內(nèi)容 |
[message:ip] | 用戶IP |
[message:os] | 用戶操作系統(tǒng) |
[message:bs] | 用戶瀏覽器 |
[message:askdate] | 留言時間 |
[message:replydate] | 回復(fù)時間 |
[message:***] | 自定義的其它字段 |
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于用戶提交表單和調(diào)取表單記錄
問:為什么自定義表單后臺添加字段沒有類型選擇???
答:表單中字段類型只不過是頁面表現(xiàn)的形式,類型只需在前端模板中根據(jù)實(shí)際需要編寫對應(yīng)HTML表單字段類型即可,數(shù)據(jù)對于后端存儲來說均為文本,AndyCMS希望給前端開發(fā)者最大的開發(fā)自由,想什么類型模板說了算,這才是真正的前后端分離,那么AndyCMS的表單其實(shí)給與了最大的靈活性和通用性。
<form action="{pboot:form fcode=*}" method="post">
姓名(單行文本):<input type="text" name="name" >
性別(單選類型):
<input type="radio" value="男" name="sex" >男
<input type="radio" value="女" name="sex" >女
愛好(多選類型):
<input type="checkbox" value="籃球" name="like[]" >籃球
<input type="checkbox" value="足球" name="like[]" >足球
省份(下拉類型):
<select name="province">
<option value="北京">北京</option>
<option value="上海">上海</option>
</select>
簡介(多行文本):<textarea name="description" ></textarea>
<button type="submit">提交</button>
</form>
需要特別提醒的是,如果字段為多選類型,那么表單字段名稱需要用中括號,比如選擇愛好:
<input type="checkbox" value="籃球" name="like[]" >籃球
<input type="checkbox" value="足球" name="like[]" >足球
標(biāo)簽說明:
{pboot:form fcode=*} 為表單接收地址,fcode對應(yīng)后臺接收表單的編碼
注意:此處與留言板的提交地址不可混淆,內(nèi)置的留言表單使用專用地址{pboot:msgaction},其余自定義表單則按照此處規(guī)則定義提交地址。
{pboot:formlist fcode=* num=*}
<p>姓名:[form:name]</p>
<p>公司:[form:company]</p>
<p>職位:[form:position]</p>
{/pboot:formlist}
控制參數(shù):
fcode=* 表單編碼,必填,用于控制調(diào)取的表單
num=* 數(shù)量,非必填,用于控制調(diào)取的記錄分頁大小
page=* 是否分頁1或0,非必填,用于關(guān)閉分頁
[form:n] | 序號從0開始 |
[form:i] | 序號從1開始 |
[form:date] | 提交時間 |
[form:***] | 自定義的其它字段 |
適用范圍:內(nèi)容列表頁使用,其實(shí)也可以用在首頁等
標(biāo)簽作用:用于對內(nèi)容列表進(jìn)行篩選
1)全部標(biāo)簽
{pboot:selectall field=* text=* class=* active=*}
控制參數(shù):
field=* 篩選的字段,必填,用于控制調(diào)取的篩選字段名稱
text=* 顯示文字,非必填,用于控制顯示的文字,默認(rèn)顯示”全部“
class=* 非選中時樣式,非必填,用于設(shè)置為文字非選中時的class常規(guī)樣式
active=* 選中時樣式,非必填,用于設(shè)置為文字選中時的class高亮樣式
2)篩選值標(biāo)簽
{pboot:select field=*}
<a href= "[select:link]">[select:value]</a>
{/pboot:select}
控制參數(shù):
field=* 篩選的字段,必填,用于控制調(diào)取的篩選字段名稱
一般情況下我們會有多個字段,那么只要重復(fù)上面的代碼即可。
選中值高亮處理:{pboot:if('[select:value]'=='[select:current]')}class= "active" {/pboot:if}
2)篩選可用標(biāo)簽
[select:i] | 序號 |
[select:current] | 當(dāng)前選中值 |
[select:link] | 鏈接 |
[select:value] | 篩選值 |
<p>
類型:{pboot:selectall field=ext_leixing text=全部 class='btn btn-light' active='btnbtn-info'} |
{pboot:select field=ext_leixing}
{pboot:if([select:i]>1)}|{/pboot:if}
<a href="[select:link]"{pboot:if('[select:value]'=='[select:current]')}class="active" {/pboot:if}>[select:value]</a>
{/pboot:select}
</p>
<p>
顏色:{pboot:selectall field=ext_yanse text=全部 class='btn btn-light' active='btnbtn-info'} |
{pboot:select field=ext_yanse}
{pboot:if([select:i]>1)}|{/pboot:if}
<a href="[select:link]"{pboot:if('[select:value]'=='[select:current]')}class="active" {/pboot:if}>[select:value]</a>
{/pboot:select}
</p>
適用范圍:全站任意地方均可使用
標(biāo)簽作用:用于執(zhí)行站內(nèi)搜索功能
<form action="{pboot:scaction}" method="get">
關(guān)鍵字:<input type="text" name="keyword" >
<button type="submit">搜索</button>
</form>
使用說明:
{pboot:scaction} 為搜索提交地址
注意:表單提交方式為get,此表單默認(rèn)匹配title標(biāo)題字段
<form action="{pboot:scaction}" method="get">
關(guān)鍵字:<input type="text" name="keyword" >
<input type="hidden" name="field" value="title" >
<button type="submit">搜索</button>
</form>
或:
<form action="{pboot:scaction}" method="get">
<select name="field">
<option value="title">內(nèi)容標(biāo)題</option>
<option value="content">內(nèi)容詳情</option>
</select>
關(guān)鍵字:<input type="text" name="keyword" >
<button type="submit">搜索</button>
</form>
<form action="{pboot:scaction}" method="get">
關(guān)鍵字:<input type="text" name="keyword" >
<input type="hidden" name="field" value="title" >
<input type="hidden" name="scode" value="2,3" >
<button type="submit">搜索</button>
</form>
(V1.3.7+)如果有多個搜索表單想定義不同的結(jié)果頁模板,那么可以傳遞searchtpl字段來定義模板頁,如:
<input type="hidden" name="searchtpl" value="test.html" >
<form action="{pboot:scaction}" method="get">
內(nèi)容:<input type="text" name="content" >
標(biāo)題:<input type="text" name="title" >
作者:<input type="text" name="author" >
<input type="hidden" name="scode" value="2,3" >
<button type="submit">搜索</button>
</form>
{pboot:search}
<a href="[search:link]">[search:title]</a>
{/pboot:search}
使用說明:
搜索結(jié)果頁面使用模板search.html
num=* 每頁數(shù)量,非必填,用于控制分頁大小
order=* 排序方式,非必填,用于輸出內(nèi)容的排序方式,可選:date、sorting、istop、isrecommend、isheadline、visits、likes、oppose等字段,其中sorting為按后臺填寫的排序,122版本開始支持自定義模式,如:order='date desc,id desc' 、order='sorting desc,id desc',(V1.3.7+)還支持random隨機(jī)排序
scode=* 分類編碼,非必填,加前面說的方式,此作為第二種限制搜索分類的方式,多個分類用逗號隔開,如: scode='2,3,4'
field=* 字段限制,非必填,在使用了keyword時用于限定匹配的數(shù)據(jù)庫字段,多個字段用豎線隔開即可,如:field='title|content'
filter=*|x,y 數(shù)據(jù)過濾,非必填,用于對列表內(nèi)容進(jìn)行過濾篩選,如:filter=title|ASP,PHP 只顯示標(biāo)題含有ASP和PHP的內(nèi)容
fuzzy=* 是否模糊匹配,非必填,可選1或0,1時為默認(rèn)的模糊匹配,0則關(guān)閉
[search:n] | 序號從0開始 |
[search:i] | 序號從1開始 |
[search:id] | 編號 |
[search:scode] | 分類編碼 |
[search:subscode] | 副分類編碼 |
[search:sortname] | 分類名稱 |
[search:subsortname] | 副分類名稱 |
[search:sortlink] | 分類鏈接 |
[search:subsortlink] | 副分類鏈接 |
[search:title] | 標(biāo)題 |
[search:titlecolor] | 標(biāo)題顏色 |
[search:subtitle] | 副標(biāo)題 |
[search:author] | 作者 |
[search:source] | 來源 |
[search:link] | 鏈接 |
[search:outlink] | 外部鏈接 |
[search:date] | 發(fā)布日期 |
[search:ico] | 縮略圖 |
[search:pics] | 多圖 |
[search:content] | 內(nèi)容 |
[search:enclosure] | 附件 |
[search:enclosuresize] | 附件大小 |
[search:keywords] | 關(guān)鍵詞 |
[search:description] | 描述 |
[search:istop] | 是否置頂 |
[search:isrecommend] | 是否推薦 |
[search:isheadline] | 是否頭條 |
[search:visits] | 訪問數(shù)量 |
[search:likes] | 點(diǎn)贊數(shù)量 |
[search:oppose] | 反對數(shù)量 |
[search:likeslink] | 點(diǎn)贊鏈接 |
[search:opposelink] | 反對鏈接 |
標(biāo)簽作用:用于使用同一個后臺建立多國語言網(wǎng)站或多區(qū)域網(wǎng)站
<a href="{pboot:lgpath}?lg=cn">切換中文</a>
<a href="{pboot:lgpath}?lg=en">切換英文</a>
在按鈕上添加判斷語句:{pboot:if('{pboot:sitelanguage}'=='cn')}class="active"{/pboot:if}
標(biāo)簽作用:用于根據(jù)循環(huán)輸出一段內(nèi)容
{pboot:loop start=* end=*}
<p>這是第[loop:i]次,索引號為[loop:index]</p>
{/pboot:loop}
控制參數(shù):
start=* 起始數(shù)字,默認(rèn)1開始
end=* 結(jié)束數(shù)字,必填
標(biāo)簽作用:用于遠(yuǎn)程調(diào)取系統(tǒng)數(shù)據(jù)。
<script>
$(document).ready(function (e) {
var url='/api.php/cms/site';
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: {
appid: '{pboot:appid}',
timestamp: '{pboot:timestamp}',
signature: '{pboot:signature}'
},
success: function (response, status) {
if(response.code){
//獲取數(shù)據(jù)成功
alert(response.data.title);
}else{
//返回錯誤數(shù)據(jù)
alert(response.data);
}
},
error:function(xhr,status,error){
//返回數(shù)據(jù)異常
alert('返回數(shù)據(jù)異常!');
}
});
});
</script>
此處使用了三個站內(nèi)標(biāo)簽:{pboot:appid} 認(rèn)證用戶名、{pboot:timestamp} 時間戳、{pboot:signature} 認(rèn)證簽名
http://IP/api.php/cms/site
http://IP/api.php/cms/site/name/* 單個調(diào)用
http://IP/api.php/cms/company
http://IP/api.php/cms/company/name/* 單個調(diào)用
http://IP/api.php/cms/label
http://IP/api.php/cms/label/name/* 單個調(diào)用
http://IP/api.php/cms/nav
http://IP/api.php/cms/nav/scode/* 獲取指定分類的子類
http://IP/api.php/cms/position/scode/* 此處傳遞當(dāng)前欄目scode值
http://IP/api.php/cms/sort/scode/* 此處傳遞需要調(diào)用欄目的scode值
http://IP/api.php/cms/pics/id/* 此處傳遞內(nèi)容ID值
http://IP/api.php/cms/slide/gid/*/num/* 此處傳遞分組gid及調(diào)取的數(shù)量num值,默認(rèn)num為5
http://IP/api.php/cms/link/gid/*/num/* 此處傳遞分組gid及調(diào)取的數(shù)量num值,默認(rèn)num為10
http://IP/api.php/list/* 此處傳遞需要調(diào)用的欄目scode
http://IP/api.php/list/*/page/2 調(diào)取第二頁,如果數(shù)據(jù)已獲取完,返回類似{"code":0,"data":"已經(jīng)到底了!","rowtotal":"5"}
http://IP/api.php/content/* 傳遞需要調(diào)用的內(nèi)容ID(單頁一樣適用)
http://IP/api.php/about/* 傳遞需要調(diào)用的單頁scode
http://IP/api.php/cms/search 建議使用POST提交,keyword傳遞搜索關(guān)鍵字單條件搜索
同時支持傳遞num/*參數(shù)控制數(shù)量,傳遞order/* 控制排序方式,建議POST方式
可傳遞參數(shù) field指定字段,多個用|隔開;
可傳遞參數(shù) scode指定分類,多個用逗號隔開;
可傳遞參數(shù) fuzzy等于0關(guān)閉模糊匹配,另外也可使用多數(shù)據(jù)庫字段名稱傳遞值來多條件搜索
http://IP/api.php/cms/addmsg 要求POST提交,傳遞的字段同后臺自定義的留言字段
http://IP/api.php/cms/msg/num/* 傳遞num分頁大小
http://IP/api.php/cms/msg/num/*/page/2 調(diào)取第二頁
http://IP/api.php/cms/addform/fcode/* 要求POST提交,fcode為表單編碼,傳遞的字段同后臺自定義的字段
http://IP/api.php/cms/form/fcode/* 傳遞fcode表單編碼
http://IP/api.php/cms/form/fcode/*/num/*/page/* num控制條數(shù),page控制頁碼
以上接口對于多語言(區(qū)域)的情況,請地址中附加acode參數(shù)指定語言,否則調(diào)用默認(rèn)語言,如:http://IP/api.php/cms/site/acode/en
標(biāo)簽作用:用于自定義地址路由規(guī)則,美化URL地址。
'home/*' => 'home/about/index/scode/*'
例如"關(guān)于我們"頁面:'home/about-us' => 'home/about/index/scode/1'
使用說明:
'home/*' 美化后的訪問地址,例如上面例子訪問地址會變?yōu)椋篽ttp://域名/about-us.html
'home/about/index/scode/*' 為系統(tǒng)路由路徑,此時星號可以是欄目的編碼,如:關(guān)于我們的編碼1,當(dāng)然也可以是你在后臺自定義的欄目地址名稱
溫馨提示:自定義中about為保留關(guān)鍵字,不要使用。
'home/*' => 'home/list/index/scode/*'
例如"新聞中心"頁面:'home/news' => 'home/list/index/scode/2'
使用說明:
'home/*' 美化后的訪問地址,例如上面的示例訪問地址會變?yōu)椋篽ttp://域名/news.html
'home/list/index/scode/*' 為系統(tǒng)路由路徑,此時星號可以是欄目的編碼,如:新聞中心的編碼2,當(dāng)然也可以是你在后臺自定義的欄目地址名稱
'home/*' => 'home/content/index/id/*'
例如某篇新聞頁面:'home/test' => 'home/content/index/id/10'
使用說明:
'home/*' 美化后的訪問地址,例如上面的示例訪問地址會變?yōu)椋篽ttp://域名/test.html
'home/content/index/id/*' 為系統(tǒng)路由路徑,此時星號為內(nèi)容的ID,當(dāng)然也可以是你在后臺自定義的內(nèi)容地址名稱
標(biāo)簽作用:配置程序偽靜態(tài)后URL中將不再包含index.php,整個地址更美觀
1)安裝rewrite組件,如果使用空間一般空間商默認(rèn)已經(jīng)安裝;
2)到后臺配置參數(shù)中開啟偽靜態(tài)開關(guān)(老版本直接修改程序config/config.php文件url_type=2);
3)在站點(diǎn)目錄建立web.config文件(請到源碼包rewrite目錄下拷貝規(guī)則)
1)開啟Apache重寫模塊,具體請百度,如果使用空間一般空間商默認(rèn)已經(jīng)開啟;
2)到后臺配置參數(shù)中開啟偽靜態(tài)開關(guān)(老版本直接修改程序config/config.php文件url_type=2);
3)在站點(diǎn)目錄建立.htaccess文件(請到源碼包rewrite目錄下拷貝規(guī)則)。
1、到后臺配置參數(shù)中開啟偽靜態(tài)(老版本直接修改程序config/config.php文件url_type=2);
2、在nginx虛擬主機(jī)location配置中添加規(guī)則,規(guī)則如下:
location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; } }
location ~ \.php(.*)$ {
root D:/wwwroot; #你的網(wǎng)站目錄
fastcgi_pass 127.0.0.1:9000; #php-cgi監(jiān)聽地址
fastcgi_index index.php; #默認(rèn)頁
fastcgi_split_path_info ^(.+\.php)(.*)$; #分離路徑
fastcgi_param PATH_INFO $fastcgi_path_info; #添加PATH_INFO信息
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
啟用獨(dú)立手機(jī)版可以PC/移動分別設(shè)置模板