方案二:在列表模板调用当前父栏目下所有的作者
- [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灵动标签调用全站作者,并且统计作者发布的文章06-10
小学语文优秀课件:《放飞蜻蜓》02-21
高考后如何留学英国06-13
经典的爱情哲学格言警句01-22
[学校租车协议合同]学校临时租车协议08-27
美容师个人年度工作总结三篇02-18