From 4cdf909ff1e2ef468360836b895f022cced4145b Mon Sep 17 00:00:00 2001 From: Git Date: Fri, 13 Jan 2012 08:00:27 +0000 Subject: [PATCH] Empty commit --- sections/schedule/index.php | 48 +++++++++++----------------- sections/tools/misc/update_geoip.php | 10 +++--- sections/user/user.php | 6 ++-- 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/sections/schedule/index.php b/sections/schedule/index.php index 8dfac02a..8ba73170 100644 --- a/sections/schedule/index.php +++ b/sections/schedule/index.php @@ -949,42 +949,26 @@ function next_hour() { //------------- Give out invites! ---------------------------------------// /* - Every month, on the 8th, each Power User gets one invite (max of 4). - Every month, on the 8th and the 22nd, each Elite User gets one invite (max of 4). - Every month, on the 8th and the 22nd, each TorrentMaster gets two invites (max of 8). + PUs have a cap of 2 invites. Elites have a cap of 4. + Every month, on the 8th and the 22nd, each PU/Elite User gets one invite up to their max. Then, every month, on the 8th and the 22nd, we give out bonus invites like this: - Every Power User, Elite User or TorrentMaster whose total invitee ratio is above 0.75 and total invitee upload is over 2 gigs gets one invite. - Every Power User, Elite User or TorrentMaster whose total invitee ratio is above 2.0 and total invitee upload is over 10 gigs gets one invite. - Every Power User, Elite User or TorrentMaster whose total invitee ratio is above 3.0 and total invitee upload is over 20 gigs gets one invite. - + Every Power User or Elite whose total invitee ratio is above 0.75 and total invitee upload is over 2 gigs gets one invite. + Every Elite whose total invitee ratio is above 2.0 and total invitee upload is over 10 gigs gets one more invite. + Every Elite whose total invitee ratio is above 3.0 and total invitee upload is over 20 gigs gets yet one more invite. This cascades, so if you qualify for the last bonus group, you also qualify for the first two and will receive three bonus invites. - So a TorrentMaster who fits in the last bonus category gets 5 invites every month on the 8th and the 22nd, whereas a power user who fits in the first category gets two invites on the 8th and one on the 22nd. A power user whose invitees suck only gets one invite per month. - - There is a hard maximum of 10 invites for all classes, that cannot be exceeded by bonus invites. + The bonus invites cannot put a user over their cap. + */ - // Power users - if($BiWeek == 8){ - - $DB->query("SELECT ID FROM users_main AS um JOIN users_info AS ui on ui.UserID=um.ID WHERE PermissionID=".POWER." AND um.Enabled='1' AND ui.DisableInvites = '0' AND um.Invites<4"); - $UserIDs = $DB->collect('ID'); - if (count($UserIDs) > 0) { - foreach($UserIDs as $UserID) { - $Cache->begin_transaction('user_info_heavy_'.$UserID); - $Cache->update_row(false, array('Invites' => '+1')); - $Cache->commit_transaction(0); - } - $DB->query("UPDATE users_main SET Invites=Invites+1 WHERE ID IN(".implode(',',$UserIDs).")"); - } - - } - - // Elite users - $DB->query("SELECT ID FROM users_main AS um JOIN users_info AS ui on ui.UserID=um.ID WHERE PermissionID=".ELITE." AND um.Enabled='1' AND ui.DisableInvites = '0' AND um.Invites<4"); + $DB->query("SELECT ID + FROM users_main AS um + JOIN users_info AS ui on ui.UserID=um.ID + WHERE um.Enabled='1' AND ui.DisableInvites = '0' + AND ((um.PermissionID = ".POWER." AND um.Invites < 2) OR (um.PermissionID = ".ELITE." AND um.Invites < 4))"); $UserIDs = $DB->collect('ID'); if (count($UserIDs) > 0) { foreach($UserIDs as $UserID) { @@ -1009,7 +993,13 @@ function next_hour() { foreach ($BonusReqs as $BonusReq) { list($Ratio, $Upload) = $BonusReq; - $DB->query("SELECT ID FROM users_main AS um JOIN users_info AS ui on ui.UserID=um.ID JOIN temp_sections_schedule_index AS u ON u.Inviter = um.ID WHERE u.Upload>$Upload AND u.Upload/u.Download>$Ratio AND um.PermissionID IN (".POWER.", ".ELITE.") AND um.Enabled = '1' AND ui.DisableInvites = '0' AND um.Invites<10"); + $DB->query("SELECT ID + FROM users_main AS um + JOIN users_info AS ui ON ui.UserID=um.ID + JOIN temp_sections_schedule_index AS u ON u.Inviter = um.ID + WHERE u.Upload>$Upload AND u.Upload/u.Download>$Ratio + AND um.Enabled = '1' AND ui.DisableInvites = '0' + AND ((um.PermissionID = ".POWER." AND um.Invites < 2) OR (um.PermissionID = ".ELITE." AND um.Invites < 4))"); $UserIDs = $DB->collect('ID'); if (count($UserIDs) > 0) { foreach($UserIDs as $UserID) { diff --git a/sections/tools/misc/update_geoip.php b/sections/tools/misc/update_geoip.php index 64969c69..66195bea 100644 --- a/sections/tools/misc/update_geoip.php +++ b/sections/tools/misc/update_geoip.php @@ -7,12 +7,12 @@ show_header(); //requires wget, unzip commands to be installed -shell_exec('wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity_'.date('Ym').'06.zip'); +shell_exec('wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity_CSV/GeoLiteCity_'.date('Ym').'03.zip'); //shell_exec('wget http://debug.what.cd/GeoLiteCity_'.date('Ym').'01.zip'); -shell_exec('unzip GeoLiteCity_'.date('Ym').'06.zip'); -shell_exec('rm GeoLiteCity_'.date('Ym').'06.zip'); +shell_exec('unzip GeoLiteCity_'.date('Ym').'03.zip'); +shell_exec('rm GeoLiteCity_'.date('Ym').'03.zip'); -if(($Locations = file("GeoLiteCity_".date('Ym')."06/GeoLiteCity-Location.csv", FILE_IGNORE_NEW_LINES)) === false) { +if(($Locations = file("GeoLiteCity_".date('Ym')."03/GeoLiteCity-Location.csv", FILE_IGNORE_NEW_LINES)) === false) { error("Download or extraction of maxmind database failed"); } array_shift($Locations); @@ -31,7 +31,7 @@ echo "There are ".count($CountryIDs)." CountryIDs"; echo "
"; -if(($Blocks = file("GeoLiteCity_".date('Ym')."06/GeoLiteCity-Blocks.csv", FILE_IGNORE_NEW_LINES)) === false) { +if(($Blocks = file("GeoLiteCity_".date('Ym')."03/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 111fce4d..6585ac07 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -255,7 +255,7 @@ function check_paranoia_here($Setting) { $ArtistsAdded = 0; } -include(SERVER_ROOT.'/classes/class_user_rank.php'); +/*include(SERVER_ROOT.'/classes/class_user_rank.php'); $Rank = new USER_RANK; $UploadedRank = $Rank->get_rank('uploaded', $Uploaded); @@ -264,7 +264,7 @@ function check_paranoia_here($Setting) { $RequestRank = $Rank->get_rank('requests', $RequestsFilled); $PostRank = $Rank->get_rank('posts', $ForumPosts); $BountyRank = $Rank->get_rank('bounty', $TotalSpent); -$ArtistsRank = $Rank->get_rank('artists', $ArtistsAdded); +$ArtistsRank = $Rank->get_rank('artists', $ArtistsAdded);*/ if($Downloaded == 0) { $Ratio = 1; @@ -273,7 +273,7 @@ function check_paranoia_here($Setting) { } else { $Ratio = round($Uploaded/$Downloaded, 2); } -$OverallRank = $Rank->overall_score($UploadedRank, $DownloadedRank, $UploadsRank, $RequestRank, $PostRank, $BountyRank, $ArtistsRank, $Ratio); +/*$OverallRank = $Rank->overall_score($UploadedRank, $DownloadedRank, $UploadsRank, $RequestRank, $PostRank, $BountyRank, $ArtistsRank, $Ratio);*/ ?>