dsh12544 2014-06-26 20:38
浏览 32

的Joomla! K2 - 如何获取用户页面的作者项目计数?

I have several authors on my website and each of them has a page of his own with his image, description and a list of all his items. I would like to add an "Item Counter" to their pages, so the page will look like this:

author name, number of posts -> author description -> author items.

The only thing i miss here is the number of posts by the author.

Thank you so much for the answers!

  • 写回答

1条回答 默认 最新

  • dongnong3019 2014-06-30 17:27
    关注

    You will need to slightly modify the K2 view (we did this to one of our clients). You will need to create a query that resembles the following in the view:

    SELECT count(*) FROM #__k2_items WHERE authorid='id';
    

    Now you should pass the result of that query to the template (using the assignRef function on the $this object. That's it!

    Note: not sure about the field name authorid, I'm sure it's something else but I can't remember it on top of my head.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大