get_value("user_statgraphs_$UserID"); if ($Charts == false) { $Charts = [ ['Name' => 'Daily', 'Interval' => 1, 'Count' => 24], ['Name' => 'Monthly', 'Interval' => 24, 'Count' => 30], ['Name' => 'Yearly', 'Interval' => 24 * 7, 'Count' => 52] ]; $Stats = ['Uploaded', 'Downloaded', 'BonusPoints', 'Torrents', 'PerfectFLACs']; $Query = " SELECT Time, Uploaded, Downloaded, BonusPoints, Torrents, PerfectFLACs FROM users_stats_%s WHERE UserID = ? ORDER BY Time DESC LIMIT %d"; foreach ($Charts as &$Chart) { $Chart['name'] = strtolower($Chart['Name']); $DB->prepared_query(sprintf($Query, $Chart['name'], $Chart['Count']), $UserID); $Chart['Stats'] = $DB->has_results() ? array_reverse($DB->to_array(false, MYSQLI_ASSOC)) : []; $Chart['Start'] = count($Chart['Stats']) > 0 ? $Chart['Stats'][0]['Time'] : NULL; foreach ($Stats as $Stat) { $Chart[$Stat] = array_map(function($a) use ($Stat) { return sprintf("[%d, %s]", strtotime($a['Time']) * 1000, $a[$Stat]); }, $Chart['Stats']); } $Chart['Buffer'] = array_map(function($a) { return sprintf("[%d, %s]", strtotime($a['Time']) * 1000, $a['Uploaded'] - $a['Downloaded']); }, $Chart['Stats']); unset($Chart['Stats']); unset($Chart); } $Cache->cache_value("user_statgraphs_$UserID", $Charts, 3600); } View::show_header('User Stats'); ?>

Stats
1) { ?>


No stats available.