帝国cms灵动标签调用全站作者,并且统计作者发布的文章

时间:2023年07月22日

/

来源:网络

/

编辑:佚名

帝国cms调用全站作者,并且统计作者发布的文章,难点就在于统计同一个作者的文章,用灵动标签通过查询作者发布文章的记录数来实现效果可以参考下面是78模板网整理的解决方案和思路,方便新手站长们在利用帝国cms建网站的时候,可以少走一些弯路。

方案一,调用全站新闻系统模型的排名前30作者
[e:loop={"select count(writer) as number,writer from [!db.pre!]ecms_news temp_tnameCount where writer<>' ' group by writer order by number desc limit 30",10,24,1}]
<li><a href="[!--news.url--]e/action/ListInfo.php?ph=1&mid=7&tempid=2&writer=<?=$bqr[writer]?>" target="_blank" title="<?=$bqr[writer]?>"><?=$bqr[writer]?><span> (<?=$bqr[number]?>)</span></a></li>
[/e:loop]
方案二:在列表模板调用当前父栏目下所有的作者
<?
$bclassid = $class_r[$GLOBALS[navclassid]][bclassid]; //获取当前父栏目ID
?>
[e:loop={"select count(writer) as number,writer,classid from  [!db.pre!]ecms_article  temp_tnameCount where writer<>' ' and  classid
in (select classid from [!db.pre!]enewsclass where bclassid ='$bclassid') group by writer order by number desc  limit 30",10,24,1}]
<li><a href="[!--news.url--]e/action/ListInfo.php?ph=1&mid=1&tempid=2&writer=<?=$bqr[writer]?>" target="_blank" title="<?=$bqr[writer]?>"><?=$bqr[writer]?><span> (<?=$bqr[number]?>)</span></a></li>
[/e:loop]
说明:
①、查询[!db.pre!]ecms_article表中作者不为空的记录,并且以作者writer字段统计数量,按照数量降序排序,调用30条数据。
②、系统模型管理,将writer字段的“结合项”勾选上。
③、[!--news.url--]e/action/ListInfo.php?ph=1&mid=7&tempid=2&writer=<?=$bqr[writer]?>,ph=1为声名要使用结合项,mid=1指定系统模型,tempid=2指定的模板id。
以上就是关于帝国cms常见问题中"帝国cms灵动标签调用全站作者,并且统计作者发布的文章"的全部内容,如果有遇到帝国cms常见问题其他问题的,可以在评论留言,或者加微信咨询。
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。