mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
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:
parent
f48e7121df
commit
6bf987edb0
4 changed files with 11 additions and 46 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue