Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

@@ -1,13 +1,12 @@
<?php
/**
* @brief downloadStats Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Downloads
* @since 09 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\downloads\widgets;
@@ -58,11 +57,8 @@ class _downloadStats extends \IPS\Widget\PermissionCache
*/
public function render()
{
$stats = array();
$stats['totalFiles'] = \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files' )->first();
$stats = \IPS\Db::i()->select( 'COUNT(*) AS totalFiles, SUM(file_comments) AS totalComments, SUM(file_reviews) AS totalReviews', 'downloads_files', array( "file_open=?", 1 ) )->first();
$stats['totalAuthors'] = \IPS\Db::i()->select( 'COUNT(DISTINCT file_submitter)', 'downloads_files' )->first();
$stats['totalComments'] = \IPS\Db::i()->select( 'COUNT(*)', 'downloads_comments' )->first();
$stats['totalReviews'] = \IPS\Db::i()->select( 'COUNT(*)', 'downloads_reviews' )->first();
$latestFile = NULL;
foreach ( \IPS\downloads\File::getItemsWithPermission( array(), NULL, 1 ) as $latestFile )