發(fā)表日期:2019-09 文章編輯:小燈 瀏覽次數(shù):3338
destoon 內(nèi)容頁(yè)批量調(diào)用所有自定義字段的方法
一個(gè)一個(gè)的在模板里調(diào),是不是太麻煩了,下面的方法就是批量循環(huán)出當(dāng)前頻道所有不為空的自定義字段內(nèi)容。
api/extend.func.php 中添加以下函數(shù)
function getfileds($tb){global $db;$result = $db->query("select name,title from {$db->pre}fields where tb='$tb' order by listorder asc");$tags = array();while($r = $db->fetch_array($result)){$tags[] = $r;}return $tags;}
{php $atts = getfileds('mall');} {loop $atts $i $v}{if $$v[name]}<li>{$v[title]}:{$$v[name]}</li>{/if}{/loop}
日期:2019-09 瀏覽次數(shù):3910
日期:2019-09 瀏覽次數(shù):3698
日期:2019-09 瀏覽次數(shù):3697
日期:2019-09 瀏覽次數(shù):3611
日期:2019-09 瀏覽次數(shù):3610
日期:2019-09 瀏覽次數(shù):3613
日期:2019-09 瀏覽次數(shù):3657
日期:2019-09 瀏覽次數(shù):3712
日期:2019-09 瀏覽次數(shù):4042
日期:2019-09 瀏覽次數(shù):3532
日期:2019-09 瀏覽次數(shù):3619
日期:2019-09 瀏覽次數(shù):3311
日期:2019-09 瀏覽次數(shù):3322
日期:2019-09 瀏覽次數(shù):2994
日期:2019-09 瀏覽次數(shù):3031
日期:2019-09 瀏覽次數(shù):3013
日期:2019-09 瀏覽次數(shù):2998
日期:2019-09 瀏覽次數(shù):3119
日期:2019-09 瀏覽次數(shù):3065
日期:2019-09 瀏覽次數(shù):3266
日期:2019-09 瀏覽次數(shù):3154
日期:2019-09 瀏覽次數(shù):3337
日期:2019-09 瀏覽次數(shù):3050
日期:2019-09 瀏覽次數(shù):3387
日期:2019-09 瀏覽次數(shù):3252
日期:2019-09 瀏覽次數(shù):3246
日期:2019-09 瀏覽次數(shù):3127
日期:2019-09 瀏覽次數(shù):3164
日期:2019-09 瀏覽次數(shù):3024
日期:2019-09 瀏覽次數(shù):2970
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.