diff --git a/upload/config.php b/upload/config.php index e5199d4c3..1523fdf98 100644 --- a/upload/config.php +++ b/upload/config.php @@ -52,9 +52,9 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); $bb_cfg = $tr_cfg = $page_cfg = array(); // Increase number of revision after update -$bb_cfg['tp_version'] = '2.1 Stable'; -$bb_cfg['tp_release_state'] = 'R300'; -$bb_cfg['tp_release_date'] = '15-10-2011'; +$bb_cfg['tp_version'] = '2.2 Beta'; +$bb_cfg['tp_release_state'] = 'R301'; +$bb_cfg['tp_release_date'] = '29-10-2011'; // Database $charset = 'utf8'; diff --git a/upload/config_mods.php b/upload/config_mods.php index 3d6a52619..2410e67d3 100644 --- a/upload/config_mods.php +++ b/upload/config_mods.php @@ -44,4 +44,7 @@ $bb_cfg['birthday']['check_day'] = 7; $bb_cfg['gender'] = true; // CallSeed -$bb_cfg['callseed'] = false; \ No newline at end of file +$bb_cfg['callseed'] = false; + +// Tracker stats +$bb_cfg['tor_stats'] = true; \ No newline at end of file diff --git a/upload/includes/datastore/build_stats.php b/upload/includes/datastore/build_stats.php index 7ecdd0b78..1a7a96e5f 100644 --- a/upload/includes/datastore/build_stats.php +++ b/upload/includes/datastore/build_stats.php @@ -2,6 +2,8 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); +global $bb_cfg; + $data = array(); // usercount @@ -17,19 +19,21 @@ $row = DB()->fetch_row("SELECT SUM(forum_topics) AS topiccount, SUM(forum_posts) $data['postcount'] = number_format($row['postcount']); $data['topiccount'] = number_format($row['topiccount']); -// torrents stat -$row = DB()->fetch_row("SELECT COUNT(topic_id) AS torrentcount, SUM(size) AS size FROM ". BB_BT_TORRENTS); -$data['torrentcount'] = number_format($row['torrentcount']); -$data['size'] = $row['size']; +// Tracker stats +if ($bb_cfg['tor_stats']) +{ + // torrents stat + $row = DB()->fetch_row("SELECT COUNT(topic_id) AS torrentcount, SUM(size) AS size FROM ". BB_BT_TORRENTS); + $data['torrentcount'] = number_format($row['torrentcount']); + $data['size'] = $row['size']; -// peers stat -$row = DB()->fetch_row("SELECT SUM(seeders) AS seeders, SUM(leechers) AS leechers, ((SUM(speed_up) + SUM(speed_down))/2) AS speed FROM ". BB_BT_TRACKER_SNAP); -$data['seeders'] = number_format($row['seeders']); -$data['leechers'] = number_format($row['leechers']); -$data['peers'] = number_format($row['seeders'] + $row['leechers']); -$data['speed'] = $row['speed']; - -global $bb_cfg; + // peers stat + $row = DB()->fetch_row("SELECT SUM(seeders) AS seeders, SUM(leechers) AS leechers, ((SUM(speed_up) + SUM(speed_down))/2) AS speed FROM ". BB_BT_TRACKER_SNAP); + $data['seeders'] = number_format($row['seeders']); + $data['leechers'] = number_format($row['leechers']); + $data['peers'] = number_format($row['seeders'] + $row['leechers']); + $data['speed'] = $row['speed']; +} // gender stat if ($bb_cfg['gender']) diff --git a/upload/index.php b/upload/index.php index 6b383de67..233d971ab 100644 --- a/upload/index.php +++ b/upload/index.php @@ -209,9 +209,9 @@ $template->assign_vars(array( 'NEWEST_USER' => sprintf($lang['NEWEST_USER'], '', $stats['newestuser']['username'], ''), // Tracker stats - 'TORRENTS_STAT' => sprintf($lang['TORRENTS_STAT'], $stats['torrentcount'], humn_size($stats['size'])), - 'PEERS_STAT' => sprintf($lang['PEERS_STAT'], $stats['peers'], $stats['seeders'], $stats['leechers']), - 'SPEED_STAT' => sprintf($lang['SPEED_STAT'], humn_size($stats['speed']) .'/s'), + 'TORRENTS_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['TORRENTS_STAT'], $stats['torrentcount'], humn_size($stats['size'])) : '', + 'PEERS_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['PEERS_STAT'], $stats['peers'], $stats['seeders'], $stats['leechers']) : '', + 'SPEED_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['SPEED_STAT'], humn_size($stats['speed']) .'/s') : '', 'FORUM_IMG' => $images['forum'], 'FORUM_NEW_IMG' => $images['forum_new'], diff --git a/upload/templates/default/index.tpl b/upload/templates/default/index.tpl index b205969dc..862545a97 100644 --- a/upload/templates/default/index.tpl +++ b/upload/templates/default/index.tpl @@ -171,11 +171,12 @@
{TOTAL_GENDER}
{NEWEST_USER}
+ -{TORRENTS_STAT}
{PEERS_STAT}
{SPEED_STAT}
+