Used datastore to show statistic for more performance (#1309)

* Used datastore to show statistic for more performance

* Update admin_forums.php
This commit is contained in:
Roman Kelesidis 2024-01-06 14:07:27 +07:00 committed by GitHub
commit 6bf987edb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 46 deletions

View file

@ -9,6 +9,12 @@
require __DIR__ . '/pagestart.php';
// Statistics
if (!$stats = $datastore->get('stats')) {
$datastore->update('stats');
$stats = $datastore->get('stats');
}
// Generate relevant output
if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
$module = [];
@ -71,9 +77,9 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
]);
// Get forum statistics
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$total_posts = $stats['postcount'];
$total_topics = $stats['topiccount'];
$total_users = $stats['usercount'];
$start_date = bb_date($bb_cfg['board_startdate']);
$boarddays = (TIMENOW - $bb_cfg['board_startdate']) / 86400;