Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Zero108

Как в виджет статистики форума добавить суммарное количество просмотров всех тем?

Recommended Posts

Как в виджет статистики приложения Форумы добавить суммарное количество просмотров всех тем всех форумов?

 

Виджет статистики форума:

qBNanc7.jpg

По аналогии, как делали с блогами:

gTUBDFD.jpg

Edited by Zero108

Share this post


Link to post

как делали с блогами:

Почти также. Только редактировать нужно шаблон forumStatistics и файл \applications\forums\widgets\forumStatistics.php

$stats['total_topics']	= \IPS\Db::i()->select( "COUNT(*)", 'forums_topics', array( 'approved = ?', 1 ) )->first();

заменить на

$stats = array_merge($stats, \IPS\Db::i()->select( "COUNT(*) as total_topics, SUM(views) AS total_topics_views", 'forums_topics', array( 'approved = ?', 1 ) )->first());

 

В шаблоне использовать

$stats['total_topics_views']

  • Upvote 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...