diff --git a/sections/artist/add_alias.php b/sections/artist/add_alias.php index 1f00699a..1f79ecef 100644 --- a/sections/artist/add_alias.php +++ b/sections/artist/add_alias.php @@ -23,7 +23,7 @@ * 3. For foo, there's two, same ArtistID, diff names, no redirect */ -$DB->query("SELECT AliasID, ArtistID FROM artists_alias WHERE Name='".$AliasName."'"); +$DB->query("SELECT AliasID, ArtistID FROM artists_alias WHERE Name LIKE '".$AliasName."'"); list($CloneAliasID, $CloneArtistID) = $DB->next_record(); if($CloneAliasID) { if($Redirect == 0) { diff --git a/sections/index/private.php b/sections/index/private.php index 4347b913..477cdab4 100644 --- a/sections/index/private.php +++ b/sections/index/private.php @@ -179,12 +179,10 @@ ?>cache_value('stats_peers_lock', '1', 10); - $DB->query("SELECT COUNT(uid) FROM xbt_files_users WHERE remaining>0 AND active>0"); - list($LeecherCount) = $DB->next_record(); - if(!$LeecherCount) { $LeecherCount = 0; } - $DB->query("SELECT COUNT(uid) FROM xbt_files_users WHERE remaining=0 AND active>0"); - list($SeederCount) = $DB->next_record(); - if(!$SeederCount) { $SeederCount = 0; } + $DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(uid) FROM xbt_files_users WHERE active=1 GROUP BY Type"); + $PeerCount = $DB->to_array(0, MYSQLI_NUM, false); + $SeederCount = isset($PeerCount['Seeding'][1]) ? $PeerCount['Seeding'][1] : 0; + $LeecherCount = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0; $Cache->cache_value('stats_peers',array($LeecherCount,$SeederCount),0); } } else { diff --git a/sections/schedule/index.php b/sections/schedule/index.php index b255cb64..a740b0a5 100644 --- a/sections/schedule/index.php +++ b/sections/schedule/index.php @@ -119,10 +119,10 @@ function next_hour() { $Cache->cache_value('stats_snatches',$SnatchStats,0); } - $DB->query("SELECT COUNT(uid) FROM xbt_files_users WHERE remaining>0"); - list($LeecherCount) = $DB->next_record(); - $DB->query("SELECT COUNT(uid) FROM xbt_files_users WHERE remaining=0"); - list($SeederCount) = $DB->next_record(); + $DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(uid) FROM xbt_files_users WHERE active=1 GROUP BY Type"); + $PeerCount = $DB->to_array(0, MYSQLI_NUM, false); + $SeederCount = isset($PeerCount['Seeding'][1]) ? $PeerCount['Seeding'][1] : 0; + $LeecherCount = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0; $Cache->cache_value('stats_peers',array($LeecherCount,$SeederCount),0); $DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1' AND LastAccess>'".time_minus(3600*24)."'"); diff --git a/sections/tools/misc/update_geoip.php b/sections/tools/misc/update_geoip.php index 2f48ac77..91d1d133 100644 --- a/sections/tools/misc/update_geoip.php +++ b/sections/tools/misc/update_geoip.php @@ -1,5 +1,5 @@ "; -if(($Blocks = file("GeoLiteCity_".date('Ym')."04/GeoLiteCity-Blocks.csv", FILE_IGNORE_NEW_LINES)) === false) { +if(($Blocks = file("GeoLiteCity_".date('Ym')."01/GeoLiteCity-Blocks.csv", FILE_IGNORE_NEW_LINES)) === false) { echo "Error"; } array_shift($Blocks); diff --git a/sections/user/user.php b/sections/user/user.php index 4bba6888..2a66d19f 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -511,13 +511,11 @@ function check_paranoia_here($Setting) { query("SELECT COUNT(x.uid) FROM xbt_files_users AS x INNER JOIN torrents AS t ON t.ID=x.fid WHERE x.uid='$UserID' AND x.active=1 AND x.remaining=0"); - list($Seeding) = $DB->next_record(); -} -if (check_paranoia_here('leeching+')) { - $DB->query("SELECT COUNT(x.uid) FROM xbt_files_users AS x INNER JOIN torrents AS t ON t.ID=x.fid WHERE x.uid='$UserID' AND x.active=1 AND x.remaining>0"); - list($Leeching) = $DB->next_record(); +if (check_paranoia_here('seeding+') || check_paranoia_here('leeching+')) { + $DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(x.uid) FROM xbt_files_users AS x INNER JOIN torrents AS t ON t.ID=x.fid WHERE x.uid='$UserID' AND x.active=1 GROUP BY Type"); + $PeerCount = $DB->to_array(0, MYSQLI_NUM, false); + $Seeding = isset($PeerCount['Seeding'][1]) ? $PeerCount['Seeding'][1] : 0; + $Leeching = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0; } ?> diff --git a/static/styles/mono/style.css b/static/styles/mono/style.css index e05758a7..ca9b27ed 100644 --- a/static/styles/mono/style.css +++ b/static/styles/mono/style.css @@ -207,7 +207,7 @@ h1.hidden { position: relative; float: right; width: 217px; - height: 38px; + height: 62px; padding: 10px 14px; -webkit-border-radius: 4px; -moz-border-radius: 4px; @@ -227,7 +227,7 @@ h1.hidden { color: #fff !important; } -#userinfo_stats li:nth-child(even) { +#userinfo_stats li:last-child { border: none !important; } @@ -239,6 +239,11 @@ h1.hidden { left: 128px; } +#fl_tokens { + top: 5.4em; + left: 128px; +} + #userinfo_stats { font-weight: bold; } @@ -768,7 +773,7 @@ span.last_read a:hover { padding: 15px; } -body#forums table.forum_post td.body > div { /* Wide main column (forums) */ +body#forums table.forum_post td.body > div, body#userhistory table.forum_post td.body > div { /* Wide main column (forums, user history) */ width: 787px; }