1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-29 12:43:15 +01:00

Merge pull request #6299 from 3D-I/ticket/16881

[ticket/16881] Fix ACP statistics
This commit is contained in:
Marc Alexander 2021-10-03 17:34:28 +02:00
commit 9a7d88362f
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
2 changed files with 9 additions and 18 deletions

View File

@ -140,7 +140,6 @@
<td class="tabled"><strong>{{ PHP_VERSION_INFO }}</strong></td>
</tr>
<tr>
{% if S_TOTAL_ORPHAN %}
<td class="tabled">{{ lang('NUMBER_ORPHAN') ~ lang('COLON') }}</td>
<td class="tabled">
{% if TOTAL_ORPHAN > 0 %}
@ -149,8 +148,6 @@
<strong>{{ TOTAL_ORPHAN }}</strong>
{% endif %}
</td>
{% else %}
{% endif %}
</tr>
{% if S_VERSIONCHECK %}
<tr>
@ -204,10 +201,12 @@
<td class="tabled">{{ lang('FILES_PER_DAY') ~ lang('COLON') }}</td>
<td class="tabled"><strong>{{ FILES_PER_DAY }}</strong></td>
</tr>
{% if S_VERSIONCHECK %}
<tr>
<td class="tabled">&nbsp;</td>
<td class="tabled">&nbsp;</td>
</tr>
{% endif %}
</tbody>
</table>
</div>

View File

@ -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,6 @@ class acp_main
'DBSIZE' => $dbsize,
'UPLOAD_DIR_SIZE' => $upload_dir_size,
'TOTAL_ORPHAN' => $total_orphan,
'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true,
'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,