mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Fixed: [Deprecated] number_format(): Passing null to parameter (#729)
This commit is contained in:
parent
de076c80ef
commit
0c5f584bbd
5 changed files with 28 additions and 12 deletions
|
@ -17,7 +17,7 @@ $data = array();
|
|||
|
||||
// usercount
|
||||
$row = DB()->fetch_row("SELECT COUNT(*) AS usercount FROM " . BB_USERS . " WHERE user_id NOT IN(" . EXCLUDED_USERS . ")");
|
||||
$data['usercount'] = number_format($row['usercount']);
|
||||
$data['usercount'] = commify($row['usercount']);
|
||||
|
||||
// newestuser
|
||||
$row = DB()->fetch_row("SELECT user_id, username, user_rank FROM " . BB_USERS . " WHERE user_active = 1 ORDER BY user_id DESC LIMIT 1");
|
||||
|
@ -25,21 +25,21 @@ $data['newestuser'] = $row;
|
|||
|
||||
// post/topic count
|
||||
$row = DB()->fetch_row("SELECT SUM(forum_topics) AS topiccount, SUM(forum_posts) AS postcount FROM " . BB_FORUMS);
|
||||
$data['postcount'] = number_format($row['postcount']);
|
||||
$data['topiccount'] = number_format($row['topiccount']);
|
||||
$data['postcount'] = commify($row['postcount']);
|
||||
$data['topiccount'] = commify($row['topiccount']);
|
||||
|
||||
// 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['torrentcount'] = commify($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['seeders'] = commify($row['seeders']);
|
||||
$data['leechers'] = commify($row['leechers']);
|
||||
$data['peers'] = commify($row['seeders'] + $row['leechers']);
|
||||
$data['speed'] = $row['speed'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue