dede后台content_list.php如何调用自定义字段?
dede后台content_list.php如何调用自定义字段?在后台调用非前台$orderby=empty($orderby)?'id':preg_replace("#...
dede后台content_list.php如何调用自定义字段?在后台调用 非前台
$orderby = empty($orderby) ? 'id' : preg_replace("#[^a-z0-9]#", "", $orderby);
$orderbyField = 'arc.'.$orderby;
$query = "SELECT arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,arc.writer,
arc.channel,arc.arcrank,arc.click,arc.title,arc.color,arc.litpic,arc.pubdate,arc.mid
FROM `$maintable` arc
$whereSql
ORDER BY $orderbyField DESC"; 展开
$orderby = empty($orderby) ? 'id' : preg_replace("#[^a-z0-9]#", "", $orderby);
$orderbyField = 'arc.'.$orderby;
$query = "SELECT arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,arc.writer,
arc.channel,arc.arcrank,arc.click,arc.title,arc.color,arc.litpic,arc.pubdate,arc.mid
FROM `$maintable` arc
$whereSql
ORDER BY $orderbyField DESC"; 展开
2018-01-22
展开全部
下面就是解决方法: 找到dede/content_list.PHP文件 第165行 注释掉这行
$whereSql = empty($channelid) ? " WHERE arc.channel > 0 AND arc.arcrank > -2 " : " WHERE arc.channel = '$channelid' AND arc.arcrank > -2 ";
然后找到208行的
$query = "SELECT arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,
arc.channel,arc.arcrank,arc.click,arc.title,arc.color,arc.litpic,
arc.pubdate,arc.mid
FROM `$maintable` arc
$whereSql
ORDER BY $orderbyField DESC";
更换为
$query = "SELECT arc.id,arc.typeid,addon.huohao,arc.flag,arc.ismake,arc.channel,
arc.arcrank,arc.click,arc.title,arc.color,arc.litpic,arc.pubdate,arc.mid
FROM `$maintable` arc,`dede_addonarticle` addon,`dede_arctype` act where (arc.id=addon.aid) and (arc.typeid=act.id)$whereSql
ORDER BY $orderbyField DESC";
这个就可以了 调用方法 在dede/templets里面找到content_list.htm 直接使用 {dede:field.huohao/}标签就可以显示了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询