From 95fa6cceee32d7bc08a13db1e74ea6082b893ae0 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Thu, 23 Sep 2021 21:50:18 +0200 Subject: [PATCH 1/2] [ticket/16881] Fix ACP statistics PHPBB3-16881 --- phpBB/includes/acp/acp_main.php | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 3c27b68ac2..1705142db6 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -544,20 +544,13 @@ class acp_main $files_per_day = $total_files; } - if ($config['allow_attachments'] || $config['allow_pm_attach']) - { - $sql = 'SELECT COUNT(attach_id) AS total_orphan - FROM ' . ATTACHMENTS_TABLE . ' - WHERE is_orphan = 1 - AND filetime < ' . (time() - 3*60*60); - $result = $db->sql_query($sql); - $total_orphan = (int) $db->sql_fetchfield('total_orphan'); - $db->sql_freeresult($result); - } - else - { - $total_orphan = false; - } + $sql = 'SELECT COUNT(attach_id) AS total_orphan + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 1 + AND filetime < ' . (time() - 3*60*60); + $result = $db->sql_query($sql); + $total_orphan = (int) $db->sql_fetchfield('total_orphan'); + $db->sql_freeresult($result); $dbsize = get_database_size(); @@ -575,7 +568,7 @@ class acp_main 'DBSIZE' => $dbsize, 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'TOTAL_ORPHAN' => $total_orphan, - 'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true, + 'S_TOTAL_ORPHAN' => (bool) !$total_orphan, 'GZIP_COMPRESSION' => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'], 'DATABASE_INFO' => $db->sql_server_info(), 'PHP_VERSION_INFO' => PHP_VERSION, From 1862992ca756c570055f7bf2125e5a93c5166703 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Fri, 24 Sep 2021 00:39:33 +0200 Subject: [PATCH 2/2] [ticket/16881] Fix ACP statistics PHPBB3-16881 --- phpBB/adm/style/acp_main.html | 5 ++--- phpBB/includes/acp/acp_main.php | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index 0c87ed65b4..05ccd10605 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -140,7 +140,6 @@ {{ PHP_VERSION_INFO }} - {% if S_TOTAL_ORPHAN %} {{ lang('NUMBER_ORPHAN') ~ lang('COLON') }} {% if TOTAL_ORPHAN > 0 %} @@ -149,8 +148,6 @@ {{ TOTAL_ORPHAN }} {% endif %} - {% else %} - {% endif %} {% if S_VERSIONCHECK %} @@ -204,10 +201,12 @@ {{ lang('FILES_PER_DAY') ~ lang('COLON') }} {{ FILES_PER_DAY }} + {% if S_VERSIONCHECK %}     + {% endif %} diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 1705142db6..395e721464 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -568,7 +568,6 @@ class acp_main 'DBSIZE' => $dbsize, 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'TOTAL_ORPHAN' => $total_orphan, - 'S_TOTAL_ORPHAN' => (bool) !$total_orphan, 'GZIP_COMPRESSION' => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'], 'DATABASE_INFO' => $db->sql_server_info(), 'PHP_VERSION_INFO' => PHP_VERSION,