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