Empty commit

This commit is contained in:
Git 2012-10-20 08:00:36 +00:00
parent 9b52af5dc1
commit 0eb0c64e23
2 changed files with 21 additions and 2 deletions

View File

@ -476,6 +476,7 @@ public static function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLe
}
}
/**
* Convenience function to allow for passing groups to Torrents::freeleech_torrents()
*
@ -497,13 +498,13 @@ public static function freeleech_groups($GroupIDs, $FreeNeutral = 1, $FreeLeechT
}
}
/**
* Check if the logged in user has an active freeleech token
*
* @param int $TorrentID
* @return true if an active token exists
*/
public static function has_token($TorrentID) {
global $DB, $Cache, $LoggedUser;
if (empty($LoggedUser) || empty($LoggedUser['ID'])) {
@ -523,5 +524,23 @@ public static function has_token($TorrentID) {
return isset($TokenTorrents[$TorrentID]);
}
/**
* Check if the logged in user can use a freeleech token on this torrent
*
* @param int $Torrent
* @return true if user is allowed to use a token
*/
public static function can_use_token($Torrent) {
global $LoggedUser;
if (empty($LoggedUser) || empty($LoggedUser['ID'])) {
return false;
}
return ($LoggedUser['FLTokens'] > 0
&& $Torrent['Size'] < 1073741824
&& !$Torrent['PersonalFL']
&& empty($Torrent['FreeTorrent'])
&& $LoggedUser['CanLeech'] == '1');
}
}
?>

View File

@ -32,11 +32,11 @@
$Subject = "You have received a verbal warning";
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
$AdminComment = date("Y-m-d") . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
Tools::update_user_notes($UserID, $AdminComment);
}
$DB->query("INSERT INTO users_warnings_forums (UserID, Comment) VALUES('$UserID', '" . db_string($AdminComment) . "')
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
Tools::update_user_notes($UserID, $AdminComment);
Misc::send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
//edit the post