在自定義函數文件中 api\extend.func.php 中加入以下代碼
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'];
}
函數說明:
//根據文章id獲取分表內容
//第一個參數$moduleid 如果是在非當前模塊使用需要寫死,如在站點首頁: {getContentbyId(21,$t[itemid])}
//如果是當前模塊,可以直接用$moduleid,如在資訊頁面: {getContentbyId($moduleid,$t[itemid])}
//如果不分表的話可以多傳一個0,{getContentbyId($moduleid,$t[itemid],0)},
//當前模塊還可以直接{getContentbyId($moduleid,$t[itemid],$MOD['split'])},
//不傳第三個參數默認為分表模式(dt后臺模塊設置里可以開啟,可以起到優化的作用)
信息免費發布平臺:商務之家網
destoon模板定制、技術服務、網站假設、SEO優化布局請聯系:(QQ:3293560 手機:187 0399 5109)