1、如何調用另一資料庫的內容 帝國cms
如何調用另一資料庫的內容
帝國 CMS首頁調用tipask的其實並不難,帝國CMS的tipask問題表是ask_quertion,只需調用表中的欄位。
以下是靈動標簽實現,
[e:loop={"select id,title from ask_question order by id desc limit 10",10,24,0}]
<li><a href="/tipask/?q-<?=$bqr[id]?>" target="_blank" title="<?=$bqr[title]?>" ><?=esub($bqr[title],30)?></a>
</li>
[/e:loop]
說明:tipask.ask_question 里的「tipask」要替換成你的資料庫名稱。
2、帝國CMS中怎麼調用遠程資料庫?
有個資料庫連接地址的,改下就好
3、求助帝國CMS操作調用MSSQL資料庫.帝國cms
首先,做下准備工作:
在e目錄下建立測試目錄,例如我建立的是e/trylife/td-test/
在1中目錄下建立個PHP文件,例如我建立的是e/trylife/td/test-db_sql.php
文件中寫入代碼如下:
<?php
/*引用文件*/
include("../../class/connect.php");
include("../../class/db_sql.php");
/*建立資料庫鏈接 與 實例化類*/
$link=db_connect();
$empire=new mysqlquery();
/*中間的這個位置用於我們測試代碼*/
/*關閉資料庫連接 與 釋放類*/
db_close();
$empire=null;
?>
第一個測試的對象:query
query()執行的是mysql_query()
返回值同樣遵循PHP手冊中對mysql_query()的解釋,不過執行失敗的情況下是和mysq_query不一樣地
測試代碼如下(去除了篇幅比較大的注釋):
<?php
include("../../class/connect.php");
include("../../class/db_sql.php");
$link=db_connect();
$empire=new mysqlquery();
function hr(){
echo '
<hr /-->';
}
4、帝國cms列表圖文調用
前提:需要在列表模板列表內容模板(list.var) (*)初打勾使用程序代碼
$img='<dt><a target=」_blank」 href=」[!–titleurl–]」><img alt=」[!–title–]」 title=」[!–title–]」 width=」120″ height=」100″ src=」[!–titlepic–]」/></a></dt>
<dd>
<h2><a id=」newstitle」 name=」newstitle」 target=」_blank」 href=」[!–titleurl–]」>[!–title–]</a></h2>
<span id=」newsresume」 name=」newsresume」>[!–smalltext–]</span><a target=」_blank」 href=」[!–titleurl–]」 style=」color:#178AC1″>[查看原文]</a><br />
<em class=」em02″>時間:[!–newstime–]</em><em class=」em01″>來源:<span >大連銀網</span></em>
</dd>
</dl>
<div class=」Bre_line」></div>';
if(empty($r[titlepic]))
{
$img='<dd>
<h2><a id=」newstitle」 name=」newstitle」 target=」_blank」 href=」[!–titleurl–]」>[!–title–]</a></h2>
<span id=」newsresume」 name=」newsresume」>[!–smalltext–]</span><a target=」_blank」 href=」[!–titleurl–]」 style=」color:#178AC1″>[查看原文]</a><br />
<em class=」em02″>時間:[!–newstime–]</em><em class=」em01″>來源:<span >大連銀網</span></em>
</dd>
</dl>
<div class=」Bre_line」></div>';
}
$listtemp='<li>』.$img.'</li>';
5、帝國CMS如何實現多表信息調用
這里是模板樣式[/e:loop]最新調用:[e:loop={'select title,titleurl,titlepic from [!db.pre!]ecms_photoz where classid in(46,47,51) Union All select title,titleurl,titlepic from [!db.pre!]ecms_downloadz ',0,24,0}]這里是模板樣式[/e:loop]以上兩例是調用圖片和下載模型中的。。[!db.pre!]ecms_photoz 圖片數據表(註:系統默認是[!db.pre!]ecms_photo)[!db.pre!]ecms_downloadz下載數據表(註:系統默認是[!db.pre!]ecms_download)參數classid in(46,47,51) 這里是調用的欄目多個用,分開and isgood=1 條件其他參數和靈動標簽一樣最新5條記錄[e:loop={'select title,titleurl,jiage from [!db.pre!]ecms_a where classid in(7) and jiage>=100 and jiage<=2000 Union All select title,titleurl,jiage from [!db.pre!]ecms_b where classid in(19) and jiage>=100 and jiage<=2000 limit 5',0,24,0}]<li><a href="<?=$bqsr[titleurl]?>"><?=$bqr[title]?>--<?></a></li>[/e:loop]關鍵字:帝國CMS教程相關文章:帝國cms縮略圖:網站不同地方生成不同的縮略圖帝國CMS遠程保存圖片功能失效帝國CMS7.0新版本增加信息管理許可權分配,許可權控制更靈活教你如何給帝國CMS系統添加登陸失敗次數限制實現帝國CMS在登錄和注冊點擊刷新驗證碼相關下載:沒有相關軟體
6、怎麼用SQL調出帝國CMS數據表裡的欄位內容
select intro,ztimg from phome_enewszt where ID=1;
7、帝國CMS自己增加的數據表欄位如何調用
你好,我寫了一篇詳細的介紹可供參考帝國CMS自己增加的數據表欄位如何調用,希望能幫到更多人!
8、帝國cms自定義的欄位,怎麼在列表頁中調用?
你是要在哪裡調用自定義欄位? 假如自定義欄位為:fields 如果是在列表頁模版中的中調用的話:[!--fields--] 如果是在內容頁模版中調用的話:[!--fields--] 如果是在靈動標簽中調用的話: