destoon根据itemid调用改信息的content函数
生活随笔
收集整理的這篇文章主要介紹了
destoon根据itemid调用改信息的content函数
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
在自定義函數(shù)中\(zhòng)api\extend.func.php中加入以下代碼
//根據(jù)文章id獲取分表內(nèi)容
//第一個參數(shù)$moduleid 如果是在非當(dāng)前模塊使用需要寫死,如在站點首頁: {getContentbyId(21,$t[itemid])}
//如果是當(dāng)前模塊,可以直接用$moduleid,如在資訊頁面: {getContentbyId($moduleid,$t[itemid])}
//如果不分表的話可以多傳一個0,{getContentbyId($moduleid,$t[itemid],0)},
//當(dāng)前模塊還可以直接{getContentbyId($moduleid,$t[itemid],$MOD['split'])},
//不傳第三個參數(shù)默認(rèn)為分表模式(dt后臺模塊設(shè)置里可以開啟,可以起到優(yōu)化的作用)
//調(diào)取當(dāng)前id對應(yīng)的內(nèi)容
function getContentbyId($moduleid,$itemid,$split=1){
global $db;
$content_table = content_table($moduleid, $itemid,$split);
$t = $db->get_one("select content from {$content_table} where itemid=$itemid");
return $t['content'];
}
總結(jié)
以上是生活随笔為你收集整理的destoon根据itemid调用改信息的content函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: destoon发布信息的时候让浏览次数随
- 下一篇: destoon用户在申请VIP的同时短信