<?php
If (!defined("in_astat")) {
    die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
} 

$result=$db->query("SELECT count(uid) as users FROM `" . $config["prefix"] . "users`");
$row = $db->fetch_array($result);
$stats['users']=$row['users'];

$result=$db->query("SELECT username FROM `" . $config["prefix"] . "users` ORDER BY uid DESC LIMIT 1");
$row = $db->fetch_array($result);
$stats['lastusername']=$row['username'];

$stat=$cache->read('review_stats');
$stats['reviewcount']=$stat['reviews'];
$stats['titlecount']=$stat['titles'];
$stats['queued']=$stat['queue'];

$result=$db->query("SELECT count(id) as comments FROM `" . $config["prefix"] . "comments`");
$row = $db->fetch_array($result);
$stats['comments']=$row['comments'];

$result=$db->query("SELECT sum(chattime) as time FROM `v_yac_users`");
$row = $db->fetch_array($result);
$stats['time']=$row['time'];
$plugin->run_hook("nav_stats",&$stats);

$navtpl -> assign('stats', $stats);
$navrow .= $navtpl->fetch('nav_stats.tpl');

?>
