帝國(guó)CMS靈動(dòng)標(biāo)簽調(diào)用外部數(shù)據(jù),學(xué)會(huì)這招你就是帝國(guó)cms高手了。帝國(guó)CMS的標(biāo)簽結(jié)合SQL查詢,支持調(diào)用所有數(shù)據(jù)庫(kù)數(shù)據(jù),以后想調(diào)用什么就調(diào)用什么。
[e:loop={"select tid,subject,dateline from discuzdb.cdb_threads order by tid desc limit 10",10,24,0}] [/e:loop]
discuzdb.cdb_threads為Discuz的貼子表名,其中“discuzdb”為Discuz的數(shù)據(jù)庫(kù)名稱。
limit 10為顯示貼子數(shù)量。
如果用偽靜態(tài)地址可以用:/bbs/thread--1-1.html
如果指定單個(gè)版塊的貼子,SQL用:select tid,subject,dateline from discuzdb.cdb_threads where fid=版塊IDorder by tid desc limit 10如果指定多個(gè)版塊的貼子,SQL用:select tid,subject,dateline from discuzdb.cdb_threads where fid in (1,2,3)order by tid desc limit 10
[e:loop={"select tid,subject,dateline,fid from discuzdb.cdb_threads order by tid desc limit 10",10,24,0}] $fr=$empire->fetch1("select name from discuzdb.cdb_forums where fid='$bqr[fid]'"); ?> [/e:loop]
discuzdb.cdb_forums為Discuz的版塊表名,其中“discuzdb”為Discuz的數(shù)據(jù)庫(kù)名稱。
[e:loop={"select tid,subject,postdate from phpwinddb.pw_threads order by tid desc limit 10",10,24,0}] [/e:loop]
phpwinddb.pw_threads為phpwind的貼子表名,其中“phpwinddb”為phpwind的數(shù)據(jù)庫(kù)名稱。
limit 10為顯示貼子數(shù)量。
如果用偽靜態(tài)地址可以用:/bbs/read-htm-tid-.html
如果指定單個(gè)版塊的貼子,SQL用:select tid,subject,postdate from phpwinddb.pw_threads where fid=版塊ID order by tid desc limit 10如果指定多個(gè)版塊的貼子,SQL用:select tid,subject,postdate from phpwinddb.pw_threads where fid in (1,2,3) order by tid desc limit 10
[e:loop={"select tid,subject,postdate,fid from phpwinddb.pw_threads order by tid desc limit 10",10,24,0}] $fr=$empire->fetch1("select name from phpwinddb.pw_forums where fid='$bqr[fid]'"); ?> [/e:loop]
phpwinddb.pw_forums為phpwind的版塊表名,其中“phpwinddb”為phpwind的數(shù)據(jù)庫(kù)名稱。
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 帝國(guó)CMS二次開(kāi)發(fā)靈動(dòng)標(biāo)簽調(diào)用外部數(shù)據(jù)