2011-03-28 14:21:28 +00:00
|
|
|
<?
|
|
|
|
if(!check_perms('site_view_flow')) { error(403); }
|
2012-10-11 08:00:15 +00:00
|
|
|
View::show_header('Torrents');
|
2011-03-28 14:21:28 +00:00
|
|
|
|
|
|
|
if (!$TorrentStats = $Cache->get_value('new_torrent_stats')) {
|
|
|
|
$DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents");
|
|
|
|
list($TorrentCount, $TotalSize, $TotalFiles) = $DB->next_record();
|
|
|
|
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1'");
|
|
|
|
list($NumUsers) = $DB->next_record();
|
|
|
|
$DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE('".sqltime()."', INTERVAL 1 DAY)");
|
|
|
|
list($DayNum, $DaySize, $DayFiles) = $DB->next_record();
|
|
|
|
$DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE('".sqltime()."', INTERVAL 7 DAY)");
|
|
|
|
list($WeekNum, $WeekSize, $WeekFiles) = $DB->next_record();
|
|
|
|
$DB->query("SELECT COUNT(ID), SUM(Size), SUM(FileCount) FROM torrents WHERE Time > SUBDATE('".sqltime()."', INTERVAL 30 DAY)");
|
|
|
|
list($MonthNum, $MonthSize, $MonthFiles) = $DB->next_record();
|
|
|
|
$Cache->cache_value('new_torrent_stats',array($TorrentCount,$TotalSize,$TotalFiles,
|
|
|
|
$NumUsers,$DayNum,$DaySize,$DayFiles,
|
|
|
|
$WeekNum,$WeekSize,$WeekFiles,$MonthNum,
|
|
|
|
$MonthSize,$MonthFiles),3600);
|
|
|
|
} else {
|
|
|
|
list($TorrentCount,$TotalSize,$TotalFiles,$NumUsers,$DayNum,$DaySize,$DayFiles,
|
|
|
|
$WeekNum,$WeekSize,$WeekFiles,$MonthNum,$MonthSize,$MonthFiles) = $TorrentStats;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div class="thin">
|
|
|
|
<div class="box">
|
|
|
|
<div class="head">Overall stats</div>
|
|
|
|
<div class="pad">
|
|
|
|
<ul class="stats nobullet">
|
|
|
|
<li><strong>Total torrents: </strong><?=number_format($TorrentCount)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Total size: </strong><?=Format::get_size($TotalSize)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
<li><strong>Total files: </strong><?=number_format($TotalFiles)?></li>
|
|
|
|
<br />
|
|
|
|
<li><strong>Mean torrents per user: </strong><?=number_format($TorrentCount/$NumUsers)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Mean torrent size: </strong><?=Format::get_size($TotalSize/$TorrentCount)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
<li><strong>Mean files per torrent: </strong><?=number_format($TotalFiles/$TorrentCount)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Mean filesize: </strong><?=Format::get_size($TotalSize/$TotalFiles)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br />
|
|
|
|
<div class="box">
|
|
|
|
<div class="head">Upload frequency</div>
|
|
|
|
<div class="pad">
|
|
|
|
<ul class="stats nobullet">
|
|
|
|
<li><strong>Torrents today: </strong><?=number_format($DayNum)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Size today: </strong><?=Format::get_size($DaySize)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
<li><strong>Files today: </strong><?=number_format($DayFiles)?></li>
|
|
|
|
<br />
|
|
|
|
<li><strong>Torrents this week: </strong><?=number_format($WeekNum)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Size this week: </strong><?=Format::get_size($WeekSize)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
<li><strong>Files this week: </strong><?=number_format($WeekFiles)?></li>
|
|
|
|
<br />
|
|
|
|
<li><strong>Torrents per day this week: </strong><?=number_format($WeekNum/7)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Size per day this week: </strong><?=Format::get_size($WeekSize/7)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
<li><strong>Files per day this week: </strong><?=number_format($WeekFiles/7)?></li>
|
|
|
|
<br />
|
|
|
|
<li><strong>Torrents this month: </strong><?=number_format($MonthNum)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Size this month: </strong><?=Format::get_size($MonthSize)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
<li><strong>Files this month: </strong><?=number_format($MonthFiles)?></li>
|
|
|
|
<br />
|
|
|
|
<li><strong>Torrents per day this month: </strong><?=number_format($MonthNum/30)?></li>
|
2012-10-11 08:00:15 +00:00
|
|
|
<li><strong>Size per day this month: </strong><?=Format::get_size($MonthSize/30)?></li>
|
2011-03-28 14:21:28 +00:00
|
|
|
<li><strong>Files per day this month: </strong><?=number_format($MonthFiles/30)?></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?
|
2012-10-11 08:00:15 +00:00
|
|
|
View::show_footer();
|
2011-03-28 14:21:28 +00:00
|
|
|
?>
|