mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 12:11:36 +00:00
Empty commit
This commit is contained in:
parent
0e601692de
commit
b43965b123
@ -84,13 +84,14 @@ public static function donate($UserID, $Args) {
|
||||
$AdjustedRank = $Rank >= MAX_EXTRA_RANK ? MAX_EXTRA_RANK : $Rank;
|
||||
G::$DB->query("
|
||||
INSERT INTO users_donor_ranks
|
||||
(UserID, Rank, TotalRank, DonationTime)
|
||||
(UserID, Rank, TotalRank, DonationTime, RankExpirationTime)
|
||||
VALUES
|
||||
('$UserID', '$AdjustedRank', '$TotalRank', '$Date')
|
||||
('$UserID', '$AdjustedRank', '$TotalRank', '$Date', '$Date')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
Rank = '$AdjustedRank',
|
||||
TotalRank = '$TotalRank',
|
||||
DonationTime = '$Date'");
|
||||
DonationTime = '$Date',
|
||||
RankExpirationTime = '$Date'");
|
||||
}
|
||||
else {
|
||||
// Donations from the store get donor points directly, no need to calculate them
|
||||
@ -114,13 +115,14 @@ public static function donate($UserID, $Args) {
|
||||
}
|
||||
G::$DB->query("
|
||||
INSERT INTO users_donor_ranks
|
||||
(UserID, Rank, TotalRank, DonationTime)
|
||||
(UserID, Rank, TotalRank, DonationTime, RankExpirationTime)
|
||||
VALUES
|
||||
('$UserID', '$AdjustedRank', '$DonorPoints', '$Date')
|
||||
('$UserID', '$AdjustedRank', '$DonorPoints', '$Date', '$Date')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
Rank = '$AdjustedRank',
|
||||
TotalRank = TotalRank + '$DonorPoints',
|
||||
DonationTime = '$Date'");
|
||||
DonationTime = '$Date',
|
||||
RankExpirationTime = '$Date'");
|
||||
}
|
||||
// Donor cache key is outdated
|
||||
G::$Cache->delete_value("donor_info_$UserID");
|
||||
@ -216,7 +218,7 @@ public static function schedule() {
|
||||
self::$IsSchedule = true;
|
||||
|
||||
DonationsBitcoin::find_new_donations();
|
||||
//self::expire_ranks();
|
||||
self::expire_ranks();
|
||||
self::get_new_conversion_rates();
|
||||
}
|
||||
|
||||
@ -227,18 +229,20 @@ public static function expire_ranks() {
|
||||
FROM users_donor_ranks
|
||||
WHERE Rank > 1
|
||||
AND SpecialRank != 3
|
||||
AND DonationTime < NOW() - INTERVAL 32 DAY");
|
||||
AND RankExpirationTime < NOW() - INTERVAL 32 DAY");
|
||||
|
||||
if (G::$DB->record_count() > 0) {
|
||||
$UserIDs = array();
|
||||
while (list($UserID, $Rank) = G::$DB->next_record()) {
|
||||
G::$Cache->delete_value("donor_info_$UserID");
|
||||
G::$Cache->delete_value("donor_title_$UserID");
|
||||
G::$Cache->delete_value("donor_profile_rewards_$UserID");
|
||||
$UserIDs[] = $UserID;
|
||||
}
|
||||
$In = implode(',', $UserIDs);
|
||||
G::$DB->query("
|
||||
UPDATE users_donor_ranks
|
||||
SET Rank = Rank - IF(Rank = " . MAX_RANK . ", 2, 1)
|
||||
SET Rank = Rank - IF(Rank = " . MAX_RANK . ", 2, 1), RankExpirationTime = NOW()
|
||||
WHERE UserID IN ($In)");
|
||||
}
|
||||
G::$DB->set_query_id($QueryID);
|
||||
|
@ -1,5 +1,14 @@
|
||||
CHANGE LOG
|
||||
|
||||
2013-12-23 by alderaan
|
||||
Clear "user_info_$UserID" for each user that gets disabled for having never logged in
|
||||
|
||||
2013-12-23 by alderaan
|
||||
Clear "num_staff_pms_$UserID" cache key when reassigning a Staff PM
|
||||
|
||||
2013-12-22 by Ajax
|
||||
Donor rank expiration
|
||||
|
||||
2013-12-16 by alderaan
|
||||
Remove code to check for public torrents
|
||||
|
||||
|
@ -1348,6 +1348,7 @@ CREATE TABLE `users_donor_ranks` (
|
||||
`TotalRank` int(10) NOT NULL DEFAULT '0',
|
||||
`SpecialRank` tinyint(2) DEFAULT '0',
|
||||
`InvitesRecievedRank` tinyint(4) DEFAULT '0',
|
||||
`RankExpirationTime` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`UserID`),
|
||||
KEY `DonationTime` (`DonationTime`),
|
||||
KEY `SpecialRank` (`SpecialRank`),
|
||||
|
@ -847,6 +847,17 @@ function next_hour() {
|
||||
|
||||
//------------- Disable unconfirmed users ------------------------------//
|
||||
sleep(10);
|
||||
// get a list of user IDs for clearing cache keys
|
||||
$DB->query("
|
||||
SELECT UserID
|
||||
FROM users_info AS ui
|
||||
JOIN users_main AS um ON um.ID = ui.UserID
|
||||
WHERE um.LastAccess = '0000-00-00 00:00:00'
|
||||
AND ui.JoinDate < '".time_minus(60 * 60 * 24 * 7)."'
|
||||
AND um.Enabled != '2'");
|
||||
$UserIDs = $DB->collect('UserID');
|
||||
|
||||
// disable the users
|
||||
$DB->query("
|
||||
UPDATE users_info AS ui
|
||||
JOIN users_main AS um ON um.ID = ui.UserID
|
||||
@ -856,10 +867,14 @@ function next_hour() {
|
||||
ui.AdminComment = CONCAT('$sqltime - Disabled for inactivity (never logged in)\n\n', ui.AdminComment)
|
||||
WHERE um.LastAccess = '0000-00-00 00:00:00'
|
||||
AND ui.JoinDate < '".time_minus(60 * 60 * 24 * 7)."'
|
||||
AND um.Enabled != '2'
|
||||
");
|
||||
AND um.Enabled != '2'");
|
||||
$Cache->decrement('stats_user_count', $DB->affected_rows());
|
||||
|
||||
// clear the appropriate cache keys
|
||||
foreach ($UserIDs as $UserID) {
|
||||
$Cache->delete_value("user_info_$UserID");
|
||||
}
|
||||
|
||||
echo "disabled unconfirmed\n";
|
||||
|
||||
//------------- Demote users --------------------------------------------//
|
||||
|
@ -33,6 +33,7 @@
|
||||
SET Status = 'Unanswered',
|
||||
Level = $Level
|
||||
WHERE ID = $ConvID");
|
||||
$Cache->delete_value("num_staff_pms_$LoggedUser[ID]");
|
||||
header('Location: staffpm.php');
|
||||
} else {
|
||||
error(404);
|
||||
|
@ -28,12 +28,11 @@
|
||||
$DB->query($Query);
|
||||
}
|
||||
// Clear cache for user
|
||||
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value("staff_pm_new_$LoggedUser[ID]");
|
||||
$Cache->delete_value("num_staff_pms_$LoggedUser[ID]");
|
||||
|
||||
// Done! Return to inbox
|
||||
header("Location: staffpm.php");
|
||||
|
||||
} else {
|
||||
// No ID
|
||||
header("Location: staffpm.php");
|
||||
|
@ -11,10 +11,10 @@
|
||||
// Conversation belongs to user or user is staff, resolve it
|
||||
$DB->query("
|
||||
UPDATE staff_pm_conversations
|
||||
SET Status = 'Resolved', ResolverID = ".$LoggedUser['ID']."
|
||||
SET Status = 'Resolved', ResolverID = $LoggedUser[ID]
|
||||
WHERE ID = $ID");
|
||||
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value("staff_pm_new_$LoggedUser[ID]");
|
||||
$Cache->delete_value("num_staff_pms_$LoggedUser[ID]");
|
||||
|
||||
header('Location: staffpm.php');
|
||||
} else {
|
||||
|
@ -43,20 +43,24 @@
|
||||
// FLS/Staff
|
||||
$DB->query("
|
||||
UPDATE staff_pm_conversations
|
||||
SET Date = '".sqltime()."', Unread = true, Status = 'Open'
|
||||
SET Date = '".sqltime()."',
|
||||
Unread = true,
|
||||
Status = 'Open'
|
||||
WHERE ID = $ConvID");
|
||||
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value("num_staff_pms_$LoggedUser[ID]");
|
||||
} else {
|
||||
// User
|
||||
$DB->query("
|
||||
UPDATE staff_pm_conversations
|
||||
SET Date = '".sqltime()."', Unread = true, Status = 'Unanswered'
|
||||
SET Date = '".sqltime()."',
|
||||
Unread = true,
|
||||
Status = 'Unanswered'
|
||||
WHERE ID = $ConvID");
|
||||
}
|
||||
|
||||
// Clear cache for user
|
||||
$Cache->delete_value("staff_pm_new_$UserID");
|
||||
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value("staff_pm_new_$LoggedUser[ID]");
|
||||
|
||||
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
||||
} else {
|
||||
@ -71,11 +75,8 @@
|
||||
} elseif ($ConvID = (int)$_POST['convid']) {
|
||||
// No message, but conversation ID
|
||||
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
||||
|
||||
} else {
|
||||
// No message or conversation ID
|
||||
header('Location: staffpm.php');
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
@ -22,7 +22,7 @@
|
||||
SET Status = 'Unanswered'
|
||||
WHERE ID = $ID");
|
||||
// Clear cache for user
|
||||
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value("num_staff_pms_$LoggedUser[ID]");
|
||||
|
||||
header('Location: staffpm.php');
|
||||
} else {
|
||||
|
@ -22,7 +22,7 @@
|
||||
SET Unread = false
|
||||
WHERE ID = $ConvID");
|
||||
// Clear cache for user
|
||||
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
||||
$Cache->delete_value("staff_pm_new_$LoggedUser[ID]");
|
||||
}
|
||||
|
||||
View::show_header('Staff PM', 'staffpm,bbcode');
|
||||
|
@ -225,6 +225,15 @@ function isNumberKey(e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function sleep(milliseconds) {
|
||||
var start = new Date().getTime();
|
||||
for (var i = 0; i < 1e7; i++) {
|
||||
if ((new Date().getTime() - start) > milliseconds){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.extend({
|
||||
results: function () {
|
||||
return this.size();
|
||||
|
@ -193,6 +193,12 @@ div#AddArtists a {
|
||||
height: 180px;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.rippywrap div.rippy {
|
||||
@ -202,8 +208,15 @@ div#AddArtists a {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
|
||||
td.label {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user