Location: PHPKode > projects > PhpMyForum > phpmyforum_4_1_1/admin/index.php
<?php
define('PMF_INCLUDE', 1);
require('head.php');


#
#
### Statistik Werte
// install time & days
$Daten['install_date'] = pmf_date($_config['INSTALL_TIME']);
$Daten['install_time'] = pmf_time($_config['INSTALL_TIME']);
$Daten['install_days'] = (PMF_TIME-$_config['INSTALL_TIME']) / 86400;
// counts
$stat_forum = $_db->fetch_first('SELECT COUNT(f.id) AS boards,
                                        SUM(f.topics) AS topics,
                                        SUM(f.posts) AS posts
                                 FROM `'.$_cfg['DB_PREFIX'].'board` AS f');
$Daten['boards'] = $stat_forum['boards'];
$Daten['topics'] = $stat_forum['topics'];
$Daten['topics_day'] = ($Daten['topics'] && $Daten['install_days'] >= 1) ? round($Daten['topics'] / $Daten['install_days'], 2) : number_format($Daten['topics'], 2);
$Daten['posts'] = $stat_forum['posts'];
$Daten['posts_day'] = ($Daten['posts'] && $Daten['install_days'] >= 1) ? round($Daten['posts'] / $Daten['install_days'], 2) : number_format($Daten['posts'], 2);
unset($stat_forum);

// users
$user_anz = $_db->fetch_first('SELECT COUNT(id) AS anz FROM `'.$_cfg['DB_PREFIX'].'user`');
$Daten['users'] = $user_anz['anz'];
unset($user_anz);

// sessions
$session_anz = $_db->fetch_first('SELECT COUNT(user_id) AS anz FROM `'.$_cfg['DB_PREFIX'].'session`');
$Daten['online'] = $session_anz['anz'];
unset($session_anz);

// Auslastung
if ($usage = @exec('uptime')) {
    if (preg_match("/averages?: ([0-9\.]+),\s?([0-9\.]+),\s?([0-9\.]+)/", $usage, $matches)) {
        $Daten['usage'][1] = $matches[1]*100;
        $Daten['usage'][5] = $matches[2]*100;
        $Daten['usage'][15] = $matches[3]*100;
    }
}

#
#
### manuelle Freischaltungen
$Daten['reg_manuell'] = implode('', $_db->fetch_first('SELECT COUNT(*)
                                                       FROM `'.$_cfg['DB_PREFIX'].'user`
                                                       WHERE group_id = '.$_config["REG_USER_GROUP"]));

    
eval ('echo "'.$_style->get('acp_index').'";');
?>
Return current item: PhpMyForum