mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 02:46:30 +00:00
Empty commit
This commit is contained in:
parent
6cbf7e6beb
commit
bdb2e4fe12
@ -61,7 +61,7 @@ public static function get_group_votes($GroupID) {
|
||||
} else {
|
||||
$GroupVotes = $DB->next_record(MYSQLI_ASSOC, false);
|
||||
}
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes, 259200);
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes, 259200); // 3 days
|
||||
}
|
||||
return $GroupVotes;
|
||||
}
|
||||
@ -211,7 +211,7 @@ public static function get_rank_all($GroupID) {
|
||||
while (list($GID) = $DB->next_record()) {
|
||||
$Rankings[$GID] = ++$i;
|
||||
}
|
||||
$Cache->cache_value('voting_ranks_overall', $Rankings, 259200);
|
||||
$Cache->cache_value('voting_ranks_overall', $Rankings, 259200); // 3 days
|
||||
}
|
||||
|
||||
return isset($Rankings[$GroupID])?$Rankings[$GroupID]:false;
|
||||
@ -246,7 +246,7 @@ public static function get_rank_year($GroupID, $Year) {
|
||||
while (list($GID) = $DB->next_record()) {
|
||||
$Rankings[$GID] = ++$i;
|
||||
}
|
||||
$Cache->cache_value('voting_ranks_year_'.$Year , $Rankings, 259200);
|
||||
$Cache->cache_value('voting_ranks_year_'.$Year , $Rankings, 259200); // 3 days
|
||||
}
|
||||
|
||||
return isset($Rankings[$GroupID])?$Rankings[$GroupID]:false;
|
||||
@ -286,7 +286,7 @@ public static function get_rank_decade($GroupID, $Year) {
|
||||
while (list($GID) = $DB->next_record()) {
|
||||
$Rankings[$GID] = ++$i;
|
||||
}
|
||||
$Cache->cache_value('voting_ranks_decade_'.$Year , $Rankings, 259200);
|
||||
$Cache->cache_value('voting_ranks_decade_'.$Year , $Rankings, 259200); // 3 days
|
||||
}
|
||||
|
||||
return isset($Rankings[$GroupID])?$Rankings[$GroupID]:false;
|
||||
|
@ -102,13 +102,13 @@ function check_perms($PermissionName, $MinClass = 0) {
|
||||
*/
|
||||
|
||||
function json_die($Status, $Message) {
|
||||
if ($Status == "success" && $Message) {
|
||||
print json_encode(array('status' => $Status, 'response' => $Message));
|
||||
} else if ($Message) {
|
||||
print json_encode(array('status' => $Status, 'error' => $Message));
|
||||
} else {
|
||||
print json_encode(array('status' => $Status));
|
||||
}
|
||||
die();
|
||||
if ($Status == "success" && $Message) {
|
||||
print json_encode(array('status' => $Status, 'response' => $Message));
|
||||
} else if ($Message) {
|
||||
print json_encode(array('status' => $Status, 'error' => $Message));
|
||||
} else {
|
||||
print json_encode(array('status' => $Status));
|
||||
}
|
||||
die();
|
||||
}
|
||||
?>
|
||||
|
@ -75,8 +75,8 @@
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'announcements' => $JsonAnnouncements,
|
||||
'blogPosts' => $JsonBlog
|
||||
'announcements' => $JsonAnnouncements,
|
||||
'blogPosts' => $JsonBlog
|
||||
));
|
||||
|
||||
?>
|
||||
|
@ -8,12 +8,12 @@ function compare($X, $Y) {
|
||||
$Text = new TEXT;
|
||||
|
||||
if ($_GET['id'] && $_GET['artistname']) {
|
||||
json_die("failure", "bad parameters");
|
||||
json_die("failure", "bad parameters");
|
||||
}
|
||||
|
||||
$ArtistID = $_GET['id'];
|
||||
if ($ArtistID && !is_number($ArtistID)) {
|
||||
json_die("failure");
|
||||
json_die("failure");
|
||||
}
|
||||
|
||||
if (empty($ArtistID)) {
|
||||
@ -21,8 +21,7 @@ function compare($X, $Y) {
|
||||
$Name = db_string(trim($_GET['artistname']));
|
||||
$DB->query("SELECT ArtistID FROM artists_alias WHERE Name LIKE '$Name'");
|
||||
if (!(list($ArtistID) = $DB->next_record(MYSQLI_NUM, false))) {
|
||||
//if (list($ID) = $DB->next_record(MYSQLI_NUM, false)) {
|
||||
json_die("failure");
|
||||
json_die("failure");
|
||||
}
|
||||
// If we get here, we got the ID!
|
||||
}
|
||||
@ -70,7 +69,7 @@ function compare($X, $Y) {
|
||||
$DB->query($sql);
|
||||
|
||||
if ($DB->record_count() == 0) {
|
||||
json_die("failure");
|
||||
json_die("failure");
|
||||
}
|
||||
|
||||
list($Name, $Image, $Body, $VanityHouseArtist) = $DB->next_record(MYSQLI_NUM, array(0));
|
||||
@ -260,8 +259,8 @@ function compare($X, $Y) {
|
||||
}
|
||||
$NumSimilar = count($SimilarArray);
|
||||
} else {
|
||||
//If data already exists, use it
|
||||
foreach ($SimilarArray as $Similar) {
|
||||
//If data already exists, use it
|
||||
foreach ($SimilarArray as $Similar) {
|
||||
$JsonSimilar[] = array(
|
||||
'artistId' => (int) $Similar['ArtistID'],
|
||||
'name' => $Similar['Name'],
|
||||
@ -313,24 +312,24 @@ function compare($X, $Y) {
|
||||
$Cache->cache_value($Key, $Data, 3600);
|
||||
|
||||
json_die("success", array(
|
||||
'id' => (int) $ArtistID,
|
||||
'name' => $Name,
|
||||
'notificationsEnabled' => $notificationsEnabled,
|
||||
'hasBookmarked' => Bookmarks::has_bookmarked('artist', $ArtistID),
|
||||
'image' => $Image,
|
||||
'body' => $Text->full_format($Body),
|
||||
'vanityHouse' => $VanityHouseArtist == 1,
|
||||
'tags' => array_values($Tags),
|
||||
'similarArtists' => $JsonSimilar,
|
||||
'statistics' => array(
|
||||
'numGroups' => $NumGroups,
|
||||
'numTorrents' => $NumTorrents,
|
||||
'numSeeders' => $NumSeeders,
|
||||
'numLeechers' => $NumLeechers,
|
||||
'numSnatches' => $NumSnatches
|
||||
),
|
||||
'torrentgroup' => $JsonTorrents,
|
||||
'requests' => $JsonRequests
|
||||
'id' => (int) $ArtistID,
|
||||
'name' => $Name,
|
||||
'notificationsEnabled' => $notificationsEnabled,
|
||||
'hasBookmarked' => Bookmarks::has_bookmarked('artist', $ArtistID),
|
||||
'image' => $Image,
|
||||
'body' => $Text->full_format($Body),
|
||||
'vanityHouse' => $VanityHouseArtist == 1,
|
||||
'tags' => array_values($Tags),
|
||||
'similarArtists' => $JsonSimilar,
|
||||
'statistics' => array(
|
||||
'numGroups' => $NumGroups,
|
||||
'numTorrents' => $NumTorrents,
|
||||
'numSeeders' => $NumSeeders,
|
||||
'numLeechers' => $NumLeechers,
|
||||
'numSnatches' => $NumSnatches
|
||||
),
|
||||
'torrentgroup' => $JsonTorrents,
|
||||
'requests' => $JsonRequests
|
||||
));
|
||||
|
||||
?>
|
||||
|
@ -3,7 +3,7 @@
|
||||
$DB->query("
|
||||
SELECT
|
||||
t.ID AS TorrentID,
|
||||
t.GroupID AS GroupID
|
||||
t.GroupID AS GroupID
|
||||
FROM xbt_files_users AS x
|
||||
JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE t.Format='FLAC'
|
||||
|
@ -515,10 +515,10 @@ function header_link($SortKey,$DefaultWay = 'desc') {
|
||||
}
|
||||
|
||||
|
||||
json_die("success", array(
|
||||
'results' => array(),
|
||||
'youMightLike' => $JsonYouMightLike
|
||||
));
|
||||
json_die("success", array(
|
||||
'results' => array(),
|
||||
'youMightLike' => $JsonYouMightLike
|
||||
));
|
||||
}
|
||||
|
||||
$Bookmarks = Bookmarks::all_bookmarks('torrent');
|
||||
@ -710,7 +710,7 @@ function header_link($SortKey,$DefaultWay = 'desc') {
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'currentPage' => intval($Page),
|
||||
'pages' => ceil($TorrentCount / TORRENTS_PER_PAGE),
|
||||
'results' => $JsonGroups
|
||||
'currentPage' => intval($Page),
|
||||
'pages' => ceil($TorrentCount / TORRENTS_PER_PAGE),
|
||||
'results' => $JsonGroups
|
||||
));
|
||||
|
@ -60,16 +60,16 @@
|
||||
}
|
||||
|
||||
if (!isset($Forums[$ForumID])) {
|
||||
json_die("failure");
|
||||
json_die("failure");
|
||||
}
|
||||
// Make sure they're allowed to look at the page
|
||||
if (!check_perms('site_moderate_forums')) {
|
||||
if (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] === 0) {
|
||||
json_die("failure", "unsufficient permissions to view page");
|
||||
}
|
||||
json_die("failure", "unsufficient permissions to view page");
|
||||
}
|
||||
}
|
||||
if ($LoggedUser['CustomForums'][$ForumID] != 1 && $Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class']) {
|
||||
json_die("failure", "unsufficient permissions to view page");
|
||||
json_die("failure", "unsufficient permissions to view page");
|
||||
}
|
||||
|
||||
$ForumName = display_str($Forums[$ForumID]['Name']);
|
||||
|
@ -24,7 +24,7 @@
|
||||
$DB->query("SELECT TopicID FROM forums_posts WHERE ID = $_GET[postid]");
|
||||
list($ThreadID) = $DB->next_record();
|
||||
if ($ThreadID) {
|
||||
//Redirect postid to threadid when necessary.
|
||||
//Redirect postid to threadid when necessary.
|
||||
header("Location: ajax.php?action=forum&type=viewthread&threadid=$ThreadID&postid=$_GET[postid]");
|
||||
die();
|
||||
} else {
|
||||
|
@ -16,7 +16,7 @@
|
||||
$Limited_Pages = array('tcomments','user','forum','top10','browse','usersearch','requests','artist','inbox','subscriptions','bookmarks','announcements','notifications','request','better','similar_artists','userhistory','votefavorite','wiki','torrentgroup');
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
|
||||
// Enforce rate limiting everywhere except info.php
|
||||
if (isset($_GET['action']) && in_array($_GET['action'],$Limited_Pages)) {
|
||||
if (!$userrequests = $Cache->get_value('ajax_requests_'.$UserID)) {
|
||||
|
@ -92,24 +92,24 @@
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'username' => $LoggedUser['Username'],
|
||||
'id' => (int) $LoggedUser['ID'],
|
||||
'authkey' => $LoggedUser['AuthKey'],
|
||||
'passkey' => $LoggedUser['torrent_pass'],
|
||||
'notifications' => array(
|
||||
'messages' => (int) $NewMessages,
|
||||
'notifications' => (int) $NewNotifications,
|
||||
'newAnnouncement' => $MyNews < $CurrentNews,
|
||||
'newBlog' => $MyBlog < $CurrentBlog,
|
||||
'newSubscriptions' => $NewSubscriptions == 1
|
||||
),
|
||||
'userstats' => array(
|
||||
'uploaded' => (int) $LoggedUser['BytesUploaded'],
|
||||
'downloaded' => (int) $LoggedUser['BytesDownloaded'],
|
||||
'ratio' => (float) $Ratio,
|
||||
'requiredratio' => (float) $LoggedUser['RequiredRatio'],
|
||||
'class' => $ClassLevels[$LoggedUser['Class']]['Name']
|
||||
)
|
||||
'username' => $LoggedUser['Username'],
|
||||
'id' => (int) $LoggedUser['ID'],
|
||||
'authkey' => $LoggedUser['AuthKey'],
|
||||
'passkey' => $LoggedUser['torrent_pass'],
|
||||
'notifications' => array(
|
||||
'messages' => (int) $NewMessages,
|
||||
'notifications' => (int) $NewNotifications,
|
||||
'newAnnouncement' => $MyNews < $CurrentNews,
|
||||
'newBlog' => $MyBlog < $CurrentBlog,
|
||||
'newSubscriptions' => $NewSubscriptions == 1
|
||||
),
|
||||
'userstats' => array(
|
||||
'uploaded' => (int) $LoggedUser['BytesUploaded'],
|
||||
'downloaded' => (int) $LoggedUser['BytesDownloaded'],
|
||||
'ratio' => (float) $Ratio,
|
||||
'requiredratio' => (float) $LoggedUser['RequiredRatio'],
|
||||
'class' => $ClassLevels[$LoggedUser['Class']]['Name']
|
||||
)
|
||||
));
|
||||
|
||||
?>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?
|
||||
if (!check_perms('site_torrents_notify')) {
|
||||
json_die("failure");
|
||||
json_die("failure");
|
||||
}
|
||||
|
||||
define('NOTIFICATIONS_PER_PAGE', 50);
|
||||
@ -101,8 +101,8 @@
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'currentPages' => intval($Page),
|
||||
'pages' => ceil($TorrentCount / NOTIFICATIONS_PER_PAGE),
|
||||
'numNew' => $NumNew,
|
||||
'results' => $JsonNotifications
|
||||
'currentPages' => intval($Page),
|
||||
'pages' => ceil($TorrentCount / NOTIFICATIONS_PER_PAGE),
|
||||
'numNew' => $NumNew,
|
||||
'results' => $JsonNotifications
|
||||
));
|
||||
|
@ -101,7 +101,7 @@
|
||||
'producer' => $ArtistForm[7] == null ? array() : pullmediainfo($ArtistForm[7])
|
||||
);
|
||||
} else {
|
||||
$JsonMusicInfo = new stdClass; //json_encodes into an empty object: {}
|
||||
$JsonMusicInfo = new stdClass; //json_encodes into an empty object: {}
|
||||
}
|
||||
|
||||
$JsonTopContributors = array();
|
||||
@ -185,42 +185,42 @@
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'requestId' => (int) $RequestID,
|
||||
'requestorId' => (int) $RequestorID,
|
||||
'requestorName' => $RequestorName,
|
||||
'requestId' => (int) $RequestID,
|
||||
'requestorId' => (int) $RequestorID,
|
||||
'requestorName' => $RequestorName,
|
||||
'isBookmarked' => Bookmarks::has_bookmarked('request', $RequestID),
|
||||
'requestTax' => $RequestTax,
|
||||
'timeAdded' => $TimeAdded,
|
||||
'canEdit' => $CanEdit,
|
||||
'canVote' => $CanVote,
|
||||
'minimumVote' => $MinimumVote,
|
||||
'voteCount' => $VoteCount,
|
||||
'lastVote' => $LastVote,
|
||||
'topContributors' => $JsonTopContributors,
|
||||
'totalBounty' => (int) $RequestVotes['TotalBounty'],
|
||||
'categoryId' => (int) $CategoryID,
|
||||
'categoryName' => $CategoryName,
|
||||
'title' => $Title,
|
||||
'year' => (int) $Year,
|
||||
'image' => $Image,
|
||||
'description' => $Text->full_format($Description),
|
||||
'musicInfo' => $JsonMusicInfo,
|
||||
'catalogueNumber' => $CatalogueNumber,
|
||||
'releaseType' => (int) $ReleaseType,
|
||||
'releaseName' => $ReleaseName,
|
||||
'bitrateList' => $BitrateList,
|
||||
'formatList' => $FormatList,
|
||||
'mediaList' => $MediaList,
|
||||
'logCue' => $LogCue,
|
||||
'isFilled' => $IsFilled,
|
||||
'fillerId' => (int) $FillerID,
|
||||
'fillerName' => $FillerName,
|
||||
'torrentId' => (int) $TorrentID,
|
||||
'timeFilled' => $TimeFilled,
|
||||
'tags' => $JsonTags,
|
||||
'comments' => $JsonRequestComments,
|
||||
'commentPage' => (int) $Page,
|
||||
'commentPages' => (int) ceil($Results / TORRENT_COMMENTS_PER_PAGE)
|
||||
'requestTax' => $RequestTax,
|
||||
'timeAdded' => $TimeAdded,
|
||||
'canEdit' => $CanEdit,
|
||||
'canVote' => $CanVote,
|
||||
'minimumVote' => $MinimumVote,
|
||||
'voteCount' => $VoteCount,
|
||||
'lastVote' => $LastVote,
|
||||
'topContributors' => $JsonTopContributors,
|
||||
'totalBounty' => (int) $RequestVotes['TotalBounty'],
|
||||
'categoryId' => (int) $CategoryID,
|
||||
'categoryName' => $CategoryName,
|
||||
'title' => $Title,
|
||||
'year' => (int) $Year,
|
||||
'image' => $Image,
|
||||
'description' => $Text->full_format($Description),
|
||||
'musicInfo' => $JsonMusicInfo,
|
||||
'catalogueNumber' => $CatalogueNumber,
|
||||
'releaseType' => (int) $ReleaseType,
|
||||
'releaseName' => $ReleaseName,
|
||||
'bitrateList' => $BitrateList,
|
||||
'formatList' => $FormatList,
|
||||
'mediaList' => $MediaList,
|
||||
'logCue' => $LogCue,
|
||||
'isFilled' => $IsFilled,
|
||||
'fillerId' => (int) $FillerID,
|
||||
'fillerName' => $FillerName,
|
||||
'torrentId' => (int) $TorrentID,
|
||||
'timeFilled' => $TimeFilled,
|
||||
'tags' => $JsonTags,
|
||||
'comments' => $JsonRequestComments,
|
||||
'commentPage' => (int) $Page,
|
||||
'commentPages' => (int) ceil($Results / TORRENT_COMMENTS_PER_PAGE)
|
||||
));
|
||||
|
||||
?>
|
||||
|
@ -28,7 +28,7 @@
|
||||
if (!empty($_GET['userid'])) {
|
||||
if (is_number($_GET['userid'])) {
|
||||
if (!check_paranoia('requestsvoted_list', $UserInfo['Paranoia'], $Perms['Class'], $_GET['userid'])) {
|
||||
json_die("failure");
|
||||
json_die("failure");
|
||||
}
|
||||
$Title = "Requests voted for by ".$UserInfo['Username'];
|
||||
$SS->set_filter('voter', array($_GET['userid']));
|
||||
@ -290,11 +290,11 @@
|
||||
$Requests = $SphinxResults['matches'];
|
||||
|
||||
if ($NumResults == 0) {
|
||||
json_die("success", array(
|
||||
'currentPage' => 1,
|
||||
'pages' => 1,
|
||||
'results' => array()
|
||||
));
|
||||
json_die("success", array(
|
||||
'currentPage' => 1,
|
||||
'pages' => 1,
|
||||
'results' => array()
|
||||
));
|
||||
} else {
|
||||
$JsonResults = array();
|
||||
$TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18
|
||||
@ -353,10 +353,10 @@
|
||||
'timeFilled' => $TimeFilled == 0 ? '' : $TimeFilled
|
||||
);
|
||||
}
|
||||
json_die("success", array(
|
||||
'currentPage' => intval($Page),
|
||||
'pages' => ceil($NumResults / REQUESTS_PER_PAGE),
|
||||
'results' => $JsonResults
|
||||
));
|
||||
json_die("success", array(
|
||||
'currentPage' => intval($Page),
|
||||
'pages' => ceil($NumResults / REQUESTS_PER_PAGE),
|
||||
'results' => $JsonResults
|
||||
));
|
||||
}
|
||||
?>
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
if (!empty($LoggedUser['DisableForums'])) {
|
||||
json_die('failure');
|
||||
json_die('failure');
|
||||
}
|
||||
|
||||
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
||||
@ -104,6 +104,6 @@
|
||||
}
|
||||
|
||||
json_die('success', array(
|
||||
'threads' => $JsonPosts
|
||||
'threads' => $JsonPosts
|
||||
));
|
||||
?>
|
||||
|
@ -23,10 +23,12 @@
|
||||
echo 'badvote';
|
||||
die();
|
||||
}
|
||||
$Type = ($_REQUEST['vote'] == 'up')?"Up":"Down";
|
||||
$Type = ($_REQUEST['vote'] == 'up') ? 'Up' : 'Down';
|
||||
|
||||
// Update the two votes tables if needed
|
||||
$DB->query("INSERT IGNORE INTO users_votes (UserID, GroupID, Type) VALUES ($UserID, $GroupID, '$Type')");
|
||||
$DB->query("
|
||||
INSERT IGNORE INTO users_votes (UserID, GroupID, Type)
|
||||
VALUES ($UserID, $GroupID, '$Type')");
|
||||
if ($DB->affected_rows() == 0) {
|
||||
echo 'noaction';
|
||||
die();
|
||||
@ -34,7 +36,7 @@
|
||||
|
||||
// Update the group's cache key
|
||||
$GroupVotes['Total'] += 1;
|
||||
if ($Type == "Up") {
|
||||
if ($Type == 'Up') {
|
||||
$GroupVotes['Ups'] += 1;
|
||||
}
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes);
|
||||
@ -43,10 +45,10 @@
|
||||
// so we can cut corners and use the magic of INSERT...ON DUPLICATE KEY UPDATE...
|
||||
// to accomplish both in one query
|
||||
$DB->query("INSERT INTO torrents_votes (GroupID, Total, Ups, Score)
|
||||
VALUES ($GroupID, 1, ".($Type=='Up'?1:0).", 0)
|
||||
VALUES ($GroupID, 1, ".($Type == 'Up' ? 1 : 0).", 0)
|
||||
ON DUPLICATE KEY UPDATE Total = Total + 1,
|
||||
Score = IFNULL(binomial_ci(Ups".($Type=='Up'?'+1':'').",Total),0)".
|
||||
($Type=='Up'?', Ups = Ups+1':''));
|
||||
Score = IFNULL(binomial_ci(Ups".($Type == 'Up' ? '+1' : '').",Total),0)".
|
||||
($Type == 'Up' ? ', Ups = Ups+1' : ''));
|
||||
|
||||
$UserVotes[$GroupID] = array('GroupID' => $GroupID, 'Type' => $Type);
|
||||
|
||||
@ -72,8 +74,8 @@
|
||||
}
|
||||
} else {
|
||||
$VotePairs[$Vote['GroupID']] = array('GroupID'=>$Vote['GroupID'],
|
||||
'Total' => 1,
|
||||
'Ups'=>($Type == 'Up')?1:0);
|
||||
'Total' => 1,
|
||||
'Ups'=>($Type == 'Up') ? 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -101,8 +103,8 @@
|
||||
}
|
||||
} else {
|
||||
$VotePairs[$GroupID] = array('GroupID' => $GroupID,
|
||||
'Total' => 1,
|
||||
'Ups'=>($Type == 'Up')?1:0);
|
||||
'Total' => 1,
|
||||
'Ups'=>($Type == 'Up') ? 1 : 0);
|
||||
}
|
||||
$Cache->cache_value('vote_pairs_'.$VGID, $VotePairs);
|
||||
}
|
||||
@ -117,7 +119,10 @@
|
||||
}
|
||||
$Type = $UserVotes[$GroupID]['Type'];
|
||||
|
||||
$DB->query("DELETE FROM users_votes WHERE UserID=$UserID AND GroupID=$GroupID");
|
||||
$DB->query("
|
||||
DELETE FROM users_votes
|
||||
WHERE UserID=$UserID
|
||||
AND GroupID=$GroupID");
|
||||
|
||||
// Update personal cache key
|
||||
unset($UserVotes[$GroupID]);
|
||||
@ -125,15 +130,17 @@
|
||||
|
||||
// Update the group's cache key
|
||||
$GroupVotes['Total'] -= 1;
|
||||
if ($Type == "Up") {
|
||||
if ($Type == 'Up') {
|
||||
$GroupVotes['Ups'] -= 1;
|
||||
}
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes);
|
||||
|
||||
$DB->query("UPDATE torrents_votes SET Total = GREATEST(0, Total - 1),
|
||||
Score = IFNULL(binomial_ci(GREATEST(0,Ups".($Type == 'Up' ? '-1' : '')."),GREATEST(0, Total)),0)".
|
||||
($Type == 'Up' ? ', Ups = GREATEST(0, Ups - 1)' : '')."
|
||||
WHERE GroupID=$GroupID");
|
||||
$DB->query("
|
||||
UPDATE torrents_votes
|
||||
SET Total = GREATEST(0, Total - 1),
|
||||
Score = IFNULL(binomial_ci(GREATEST(0,Ups".($Type == 'Up' ? '-1' : '')."),GREATEST(0, Total)),0)".
|
||||
($Type == 'Up' ? ', Ups = GREATEST(0, Ups - 1)' : '')."
|
||||
WHERE GroupID=$GroupID");
|
||||
// Update paired cache keys
|
||||
// First update this album's paired votes. If this keys is magically not set,
|
||||
// our life just got a bit easier. We're only tracking paired votes on upvotes.
|
||||
|
@ -86,7 +86,7 @@
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'page' => (int) $Page,
|
||||
'pages' => ceil($Results / TORRENT_COMMENTS_PER_PAGE),
|
||||
'comments' => $JsonComments
|
||||
'page' => (int) $Page,
|
||||
'pages' => ceil($Results / TORRENT_COMMENTS_PER_PAGE),
|
||||
'comments' => $JsonComments
|
||||
));
|
||||
|
@ -10,34 +10,34 @@
|
||||
$TorrentHash = (string)$_GET['hash'];
|
||||
|
||||
if ($TorrentID && $TorrentHash) {
|
||||
json_die("failure", "bad parameters");
|
||||
json_die("failure", "bad parameters");
|
||||
}
|
||||
|
||||
if ($TorrentHash) {
|
||||
if (!is_valid_torrenthash($TorrentHash)) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
} else {
|
||||
$TorrentID = (int)torrenthash_to_torrentid($TorrentHash);
|
||||
if (!$TorrentID) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
}
|
||||
}
|
||||
if (!is_valid_torrenthash($TorrentHash)) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
} else {
|
||||
$TorrentID = (int)torrenthash_to_torrentid($TorrentHash);
|
||||
if (!$TorrentID) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($TorrentID <= 0) {
|
||||
json_die("failure", "bad id parameter");
|
||||
json_die("failure", "bad id parameter");
|
||||
}
|
||||
|
||||
$TorrentCache = get_torrent_info($TorrentID, true, 0, true, true);
|
||||
|
||||
if (!$TorrentCache) {
|
||||
json_die("failure", "bad id parameter");
|
||||
json_die("failure", "bad id parameter");
|
||||
}
|
||||
|
||||
list($TorrentDetails, $TorrentList) = $TorrentCache;
|
||||
|
||||
if (!isset($TorrentList[$TorrentID])) {
|
||||
json_die("failure", "bad id parameter");
|
||||
json_die("failure", "bad id parameter");
|
||||
}
|
||||
|
||||
$GroupID = $TorrentDetails['ID'];
|
||||
@ -85,37 +85,37 @@
|
||||
// Convert file list back to the old format
|
||||
$FileList = explode("\n", $Torrent['FileList']);
|
||||
foreach ($FileList as &$File) {
|
||||
$File = Torrents::filelist_old_format($File);
|
||||
$File = Torrents::filelist_old_format($File);
|
||||
}
|
||||
unset($File);
|
||||
$FileList = implode('|||', $FileList);
|
||||
$Userinfo = Users::user_info($Torrent['UserID']);
|
||||
$JsonTorrentList[] = array(
|
||||
'id' => (int) $Torrent['ID'],
|
||||
'media' => $Torrent['Media'],
|
||||
'format' => $Torrent['Format'],
|
||||
'encoding' => $Torrent['Encoding'],
|
||||
'remastered' => $Torrent['Remastered'] == 1,
|
||||
'remasterYear' => (int) $Torrent['RemasterYear'],
|
||||
'remasterTitle' => $Torrent['RemasterTitle'],
|
||||
'remasterRecordLabel' => $Torrent['RemasterRecordLabel'],
|
||||
'remasterCatalogueNumber' => $Torrent['RemasterCatalogueNumber'],
|
||||
'scene' => $Torrent['Scene'] == 1,
|
||||
'hasLog' => $Torrent['HasLog'] == 1,
|
||||
'hasCue' => $Torrent['HasCue'] == 1,
|
||||
'logScore' => (int) $Torrent['LogScore'],
|
||||
'fileCount' => (int) $Torrent['FileCount'],
|
||||
'size' => (int) $Torrent['Size'],
|
||||
'seeders' => (int) $Torrent['Seeders'],
|
||||
'leechers' => (int) $Torrent['Leechers'],
|
||||
'snatched' => (int) $Torrent['Snatched'],
|
||||
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
|
||||
'time' => $Torrent['Time'],
|
||||
'description' => $Torrent['Description'],
|
||||
'fileList' => $FileList,
|
||||
'filePath' => $Torrent['FilePath'],
|
||||
'userId' => (int) $Torrent['UserID'],
|
||||
'username' => $Userinfo['Username']
|
||||
'id' => (int) $Torrent['ID'],
|
||||
'media' => $Torrent['Media'],
|
||||
'format' => $Torrent['Format'],
|
||||
'encoding' => $Torrent['Encoding'],
|
||||
'remastered' => $Torrent['Remastered'] == 1,
|
||||
'remasterYear' => (int) $Torrent['RemasterYear'],
|
||||
'remasterTitle' => $Torrent['RemasterTitle'],
|
||||
'remasterRecordLabel' => $Torrent['RemasterRecordLabel'],
|
||||
'remasterCatalogueNumber' => $Torrent['RemasterCatalogueNumber'],
|
||||
'scene' => $Torrent['Scene'] == 1,
|
||||
'hasLog' => $Torrent['HasLog'] == 1,
|
||||
'hasCue' => $Torrent['HasCue'] == 1,
|
||||
'logScore' => (int) $Torrent['LogScore'],
|
||||
'fileCount' => (int) $Torrent['FileCount'],
|
||||
'size' => (int) $Torrent['Size'],
|
||||
'seeders' => (int) $Torrent['Seeders'],
|
||||
'leechers' => (int) $Torrent['Leechers'],
|
||||
'snatched' => (int) $Torrent['Snatched'],
|
||||
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
|
||||
'time' => $Torrent['Time'],
|
||||
'description' => $Torrent['Description'],
|
||||
'fileList' => $FileList,
|
||||
'filePath' => $Torrent['FilePath'],
|
||||
'userId' => (int) $Torrent['UserID'],
|
||||
'username' => $Userinfo['Username']
|
||||
);
|
||||
|
||||
json_die("success", array('group' => $JsonTorrentDetails, 'torrent' => array_pop($JsonTorrentList)));
|
||||
|
@ -12,28 +12,28 @@
|
||||
$TorrentHash = (string)$_GET['hash'];
|
||||
|
||||
if ($GroupID && $TorrentHash) {
|
||||
json_die("failure", "bad parameters");
|
||||
json_die("failure", "bad parameters");
|
||||
}
|
||||
|
||||
if ($TorrentHash) {
|
||||
if (!is_valid_torrenthash($TorrentHash)) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
} else {
|
||||
$GroupID = (int)torrenthash_to_groupid($TorrentHash);
|
||||
if (!$GroupID) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
}
|
||||
}
|
||||
if (!is_valid_torrenthash($TorrentHash)) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
} else {
|
||||
$GroupID = (int)torrenthash_to_groupid($TorrentHash);
|
||||
if (!$GroupID) {
|
||||
json_die("failure", "bad hash parameter");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($GroupID <= 0) {
|
||||
json_die("failure", "bad id parameter");
|
||||
json_die("failure", "bad id parameter");
|
||||
}
|
||||
|
||||
$TorrentCache = get_group_info($GroupID, true, 0, true, true);
|
||||
|
||||
if (!$TorrentCache) {
|
||||
json_die("failure", "bad id parameter");
|
||||
json_die("failure", "bad id parameter");
|
||||
}
|
||||
|
||||
list($TorrentDetails, $TorrentList) = $TorrentCache;
|
||||
|
@ -2,7 +2,9 @@
|
||||
require(SERVER_ROOT.'/sections/torrents/functions.php');
|
||||
|
||||
$GroupID = (int)$_GET['id'];
|
||||
if ($GroupID == 0) { error('bad id parameter', true); }
|
||||
if ($GroupID == 0) {
|
||||
error('bad id parameter', true);
|
||||
}
|
||||
|
||||
$TorrentDetails = get_group_info($GroupID, true, 0, false);
|
||||
$TorrentDetails = $TorrentDetails[0];
|
||||
@ -12,5 +14,5 @@
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'wikiImage' => $Image
|
||||
'wikiImage' => $Image
|
||||
));
|
@ -4,7 +4,7 @@
|
||||
$Text = new TEXT;
|
||||
|
||||
if (empty($_GET['id']) || !is_numeric($_GET['id'])) {
|
||||
json_die("failure", "bad id parameter");
|
||||
json_die("failure", "bad id parameter");
|
||||
}
|
||||
$UserID = $_GET['id'];
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
GROUP BY AuthorID");
|
||||
|
||||
if ($DB->record_count() == 0) { // If user doesn't exist
|
||||
json_die("failure", "no such user");
|
||||
json_die("failure", "no such user");
|
||||
}
|
||||
|
||||
list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $RequiredRatio, $Enabled, $Paranoia, $Invites, $CustomTitle, $torrent_pass, $DisableLeech, $JoinDate, $Info, $Avatar, $Country, $Donor, $Warned, $ForumPosts, $InviterID, $DisableInvites, $InviterName, $RatioWatchEnds, $RatioWatchDownload) = $DB->next_record(MYSQLI_NUM, array(9,11));
|
||||
@ -249,58 +249,58 @@ function check_paranoia_here($Setting) {
|
||||
|
||||
//Bugfix for no access time available
|
||||
if ($LastAccess == '0000-00-00 00:00:00') {
|
||||
$LastAccess = '';
|
||||
$LastAccess = '';
|
||||
}
|
||||
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
|
||||
json_die("success", array(
|
||||
'username' => $Username,
|
||||
'avatar' => $Avatar,
|
||||
'isFriend' => $Friend,
|
||||
'profileText' => $Text->full_format($Info),
|
||||
'stats' => array(
|
||||
'joinedDate' => $JoinDate,
|
||||
'lastAccess' => $LastAccess,
|
||||
'uploaded' => $Uploaded == null ? null : (int) $Uploaded,
|
||||
'downloaded' => $Downloaded == null ? null : (int) $Downloaded,
|
||||
'ratio' => $Ratio,
|
||||
'requiredRatio' => $RequiredRatio == null ? null : (float) $RequiredRatio
|
||||
),
|
||||
'ranks' => array(
|
||||
'uploaded' => $UploadedRank,
|
||||
'downloaded' => $DownloadedRank,
|
||||
'uploads' => $UploadsRank,
|
||||
'requests' => $RequestRank,
|
||||
'bounty' => $BountyRank,
|
||||
'posts' => $PostRank,
|
||||
'artists' => $ArtistsRank,
|
||||
'overall' => $OverallRank == null ? 0 : $OverallRank
|
||||
),
|
||||
'personal' => array(
|
||||
'class' => $ClassLevels[$Class]['Name'],
|
||||
'paranoia' => $ParanoiaLevel,
|
||||
'paranoiaText' => $ParanoiaLevelText,
|
||||
'donor' => $Donor == 1,
|
||||
'warned' => ($Warned != '0000-00-00 00:00:00'),
|
||||
'enabled' => ($Enabled == '1' || $Enabled == '0' || !$Enabled),
|
||||
'passkey' => $torrent_pass
|
||||
),
|
||||
'community' => array(
|
||||
'posts' => (int) $ForumPosts,
|
||||
'torrentComments' => (int) $NumComments,
|
||||
'collagesStarted' => $NumCollages == null ? null : (int) $NumCollages,
|
||||
'collagesContrib' => $NumCollageContribs == null ? null : (int) $NumCollageContribs,
|
||||
'requestsFilled' => $RequestsFilled == null ? null : (int) $RequestsFilled,
|
||||
'requestsVoted' => $RequestsVoted == null ? null : (int) $RequestsVoted,
|
||||
'perfectFlacs' => $PerfectFLACs == null ? null : (int) $PerfectFLACs,
|
||||
'uploaded' => $Uploads == null ? null : (int) $Uploads,
|
||||
'groups' => $UniqueGroups == null ? null : (int) $UniqueGroups,
|
||||
'seeding' => $Seeding == null ? null : (int) $Seeding,
|
||||
'leeching' => $Leeching == null ? null : (int) $Leeching,
|
||||
'snatched' => $Snatched == null ? null : (int) $Snatched,
|
||||
'invited' => $Invited == null ? null : (int) $Invited
|
||||
)
|
||||
'username' => $Username,
|
||||
'avatar' => $Avatar,
|
||||
'isFriend' => $Friend,
|
||||
'profileText' => $Text->full_format($Info),
|
||||
'stats' => array(
|
||||
'joinedDate' => $JoinDate,
|
||||
'lastAccess' => $LastAccess,
|
||||
'uploaded' => $Uploaded == null ? null : (int) $Uploaded,
|
||||
'downloaded' => $Downloaded == null ? null : (int) $Downloaded,
|
||||
'ratio' => $Ratio,
|
||||
'requiredRatio' => $RequiredRatio == null ? null : (float) $RequiredRatio
|
||||
),
|
||||
'ranks' => array(
|
||||
'uploaded' => $UploadedRank,
|
||||
'downloaded' => $DownloadedRank,
|
||||
'uploads' => $UploadsRank,
|
||||
'requests' => $RequestRank,
|
||||
'bounty' => $BountyRank,
|
||||
'posts' => $PostRank,
|
||||
'artists' => $ArtistsRank,
|
||||
'overall' => $OverallRank == null ? 0 : $OverallRank
|
||||
),
|
||||
'personal' => array(
|
||||
'class' => $ClassLevels[$Class]['Name'],
|
||||
'paranoia' => $ParanoiaLevel,
|
||||
'paranoiaText' => $ParanoiaLevelText,
|
||||
'donor' => $Donor == 1,
|
||||
'warned' => ($Warned != '0000-00-00 00:00:00'),
|
||||
'enabled' => ($Enabled == '1' || $Enabled == '0' || !$Enabled),
|
||||
'passkey' => $torrent_pass
|
||||
),
|
||||
'community' => array(
|
||||
'posts' => (int) $ForumPosts,
|
||||
'torrentComments' => (int) $NumComments,
|
||||
'collagesStarted' => $NumCollages == null ? null : (int) $NumCollages,
|
||||
'collagesContrib' => $NumCollageContribs == null ? null : (int) $NumCollageContribs,
|
||||
'requestsFilled' => $RequestsFilled == null ? null : (int) $RequestsFilled,
|
||||
'requestsVoted' => $RequestsVoted == null ? null : (int) $RequestsVoted,
|
||||
'perfectFlacs' => $PerfectFLACs == null ? null : (int) $PerfectFLACs,
|
||||
'uploaded' => $Uploads == null ? null : (int) $Uploads,
|
||||
'groups' => $UniqueGroups == null ? null : (int) $UniqueGroups,
|
||||
'seeding' => $Seeding == null ? null : (int) $Seeding,
|
||||
'leeching' => $Leeching == null ? null : (int) $Leeching,
|
||||
'snatched' => $Snatched == null ? null : (int) $Snatched,
|
||||
'invited' => $Invited == null ? null : (int) $Invited
|
||||
)
|
||||
));
|
||||
?>
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
**********************************************************************/
|
||||
|
||||
if (empty($_GET['search'])) {
|
||||
json_die("failure", "no search terms");
|
||||
json_die("failure", "no search terms");
|
||||
} else {
|
||||
$_GET['username'] = $_GET['search'];
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
json_die("success", array(
|
||||
'currentPage' => (int) $Page,
|
||||
'pages' => ceil($NumResults / USERS_PER_PAGE),
|
||||
'results' => $JsonUsers
|
||||
'currentPage' => (int) $Page,
|
||||
'pages' => ceil($NumResults / USERS_PER_PAGE),
|
||||
'results' => $JsonUsers
|
||||
));
|
||||
|
@ -10,7 +10,7 @@
|
||||
} elseif ($_GET['name'] != '') { //Retrieve article ID via alias.
|
||||
$ArticleID = $Alias->to_id($_GET['name']);
|
||||
} else {
|
||||
json_die("failure");
|
||||
json_die("failure");
|
||||
}
|
||||
|
||||
if (!$ArticleID) { //No article found
|
||||
@ -29,13 +29,13 @@
|
||||
$TextBody = $Text->full_format($Body, false);
|
||||
|
||||
json_die("success", array(
|
||||
'title' => $Title,
|
||||
'bbBody' => $Body,
|
||||
'body' => $TextBody,
|
||||
'aliases' => $Aliases,
|
||||
'authorID' => (int) $AuthorID,
|
||||
'authorName' => $AuthorName,
|
||||
'date' => $Date,
|
||||
'revision' => (int) $Revision
|
||||
'title' => $Title,
|
||||
'bbBody' => $Body,
|
||||
'body' => $TextBody,
|
||||
'aliases' => $Aliases,
|
||||
'authorID' => (int) $AuthorID,
|
||||
'authorName' => $AuthorName,
|
||||
'date' => $Date,
|
||||
'revision' => (int) $Revision
|
||||
));
|
||||
?>
|
@ -750,7 +750,7 @@ function compare($X, $Y) {
|
||||
$Tags = Requests::get_tags($RequestID);
|
||||
$ReqTagList = array();
|
||||
foreach ($Tags as $TagID => $TagName) {
|
||||
$ReqTagList[] = "<a href=\"requests.php?tags=".$TagName.'">'.display_str($TagName).'</a>';
|
||||
$ReqTagList[] = "<a href=\"requests.php?tags=".$TagName.'">'.display_str($TagName).'</a>';
|
||||
}
|
||||
$ReqTagList = implode(', ', $ReqTagList);
|
||||
?>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
if (!check_perms('users_warn')) { error(404);
|
||||
if (!check_perms('users_warn')) {
|
||||
error(404);
|
||||
}
|
||||
Misc::assert_isset_request($_POST, array('reason', 'privatemessage', 'body', 'length', 'artistid', 'postid', 'userid'));
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?
|
||||
if (($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
|
||||
$DB->query("SELECT t.ID AS TorrentID,
|
||||
t.GroupID AS GroupID
|
||||
$DB->query("SELECT
|
||||
t.ID AS TorrentID,
|
||||
t.GroupID AS GroupID
|
||||
FROM xbt_files_users AS x
|
||||
JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE t.Format='FLAC'
|
||||
|
@ -131,7 +131,9 @@
|
||||
$SQL .= " AND c.ID IN(".db_string(implode(',', $CollageIDs)).")";
|
||||
}
|
||||
} else {
|
||||
if (!check_paranoia('collages', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
|
||||
if (!check_paranoia('collages', $User['Paranoia'], $UserClass, $UserID)) {
|
||||
error(403);
|
||||
}
|
||||
$SQL .= " AND UserID='".$_GET['userid']."'";
|
||||
}
|
||||
$Categories[] = 0;
|
||||
|
@ -25,8 +25,14 @@ function btc_address($UserID, $GenAddress = false) {
|
||||
if (!empty($Addr)) { return $Addr; }
|
||||
elseif ($GenAddress) {
|
||||
|
||||
if (empty($NewAddr)) { error(0); }
|
||||
$DB->query("UPDATE users_info SET BitcoinAddress = '".db_string($NewAddr)."' WHERE UserID = '".$UserID."' AND BitcoinAddress IS NULL");
|
||||
if (empty($NewAddr)) {
|
||||
error(0);
|
||||
}
|
||||
$DB->query("
|
||||
UPDATE users_info
|
||||
SET BitcoinAddress = '".db_string($NewAddr)."'
|
||||
WHERE UserID = '$UserID'
|
||||
AND BitcoinAddress IS NULL");
|
||||
return $NewAddr;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -331,7 +331,7 @@
|
||||
if (count($Queries) > 0) {
|
||||
$Query = implode(' ',$Queries);
|
||||
} else {
|
||||
$Query='';
|
||||
$Query = '';
|
||||
}
|
||||
|
||||
$SS->set_index('requests requests_delta');
|
||||
@ -646,11 +646,11 @@
|
||||
<?=Format::get_size($RequestVotes['TotalBounty'])?>
|
||||
</td>
|
||||
<td>
|
||||
<? if ($IsFilled) { ?>
|
||||
<? if ($IsFilled) { ?>
|
||||
<a href="torrents.php?<?=(strtotime($TimeFilled) < $TimeCompare ? 'id=' : 'torrentid=').$TorrentID?>"><strong><?=time_diff($TimeFilled)?></strong></a>
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<strong>No</strong>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<td>
|
||||
<? if ($IsFilled) { ?>
|
||||
|
@ -21,45 +21,55 @@
|
||||
if ($Length != 'verbal') {
|
||||
$Time = ((int) $Length) * (7 * 24 * 60 * 60);
|
||||
Tools::warn_user($UserID, $Time, "$URL - " . $Reason);
|
||||
$Subject = "You have received a warning";
|
||||
$Subject = 'You have received a warning';
|
||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
||||
$WarnTime = time_plus($Time);
|
||||
$AdminComment = date("Y-m-d") . ' - Warned until ' . $WarnTime . ' by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
$AdminComment = date('Y-m-d') . ' - Warned until ' . $WarnTime . ' by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
} else {
|
||||
$Subject = "You have received a verbal warning";
|
||||
$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";
|
||||
$AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
}
|
||||
$DB->query("INSERT INTO users_warnings_forums (UserID, Comment) VALUES('$UserID', '" . db_string($AdminComment)
|
||||
. "')
|
||||
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
|
||||
$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);
|
||||
|
||||
$DB->query("SELECT
|
||||
rc.Body,
|
||||
rc.AuthorID,
|
||||
rc.RequestID,
|
||||
rc.AddedTime
|
||||
FROM requests_comments AS rc
|
||||
WHERE rc.ID='".db_string($_POST['post'])."'");
|
||||
$DB->query("
|
||||
SELECT
|
||||
rc.Body,
|
||||
rc.AuthorID,
|
||||
rc.RequestID,
|
||||
rc.AddedTime
|
||||
FROM requests_comments AS rc
|
||||
WHERE rc.ID='".db_string($_POST['post'])."'");
|
||||
list($OldBody, $AuthorID,$RequestID,$AddedTime)=$DB->next_record();
|
||||
|
||||
$DB->query("SELECT ceil(COUNT(ID) / ".POSTS_PER_PAGE.") AS Page FROM requests_comments WHERE RequestID = $GroupID AND ID <= $PostID");
|
||||
$DB->query("
|
||||
SELECT ceil(COUNT(ID) / ".POSTS_PER_PAGE.") AS Page
|
||||
FROM requests_comments
|
||||
WHERE RequestID = $GroupID AND ID <= $PostID");
|
||||
list($Page) = $DB->next_record();
|
||||
|
||||
if ($LoggedUser['ID']!=$AuthorID && !check_perms('site_moderate_forums')) { error(404); }
|
||||
if ($DB->record_count()==0) { error(404); }
|
||||
if ($LoggedUser['ID'] != $AuthorID && !check_perms('site_moderate_forums')) {
|
||||
error(404);
|
||||
}
|
||||
if ($DB->record_count() == 0) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE requests_comments SET
|
||||
Body = '" . db_string($Body) . "',
|
||||
EditedUserID = '".$LoggedUser['ID']."',
|
||||
EditedTime = '".sqltime()."'
|
||||
WHERE ID='".$PostID."'");
|
||||
$DB->query("
|
||||
UPDATE requests_comments
|
||||
SET
|
||||
Body = '" . db_string($Body) . "',
|
||||
EditedUserID = '".$LoggedUser['ID']."',
|
||||
EditedTime = '".sqltime()."'
|
||||
WHERE ID='".$PostID."'");
|
||||
|
||||
// Update the cache
|
||||
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
|
||||
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
|
||||
$Cache->begin_transaction('request_comments_'.$RequestID.'_catalogue_'.$CatalogueID);
|
||||
|
||||
$Cache->update_row($Key, array(
|
||||
@ -73,8 +83,9 @@
|
||||
));
|
||||
$Cache->commit_transaction(0);
|
||||
|
||||
$DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
|
||||
VALUES ('requests', ".$PostID.", ".db_string($LoggedUser['ID']).", '".sqltime()."', '".db_string($OldBody)."')");
|
||||
$DB->query("
|
||||
INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
|
||||
VALUES ('requests', $PostID, " . db_string($LoggedUser['ID']) . ", '" . sqltime() . "', '" . db_string($OldBody) . "')");
|
||||
|
||||
|
||||
header("Location: requests.php?id=$GroupID&postid=$PostID#post$PostID");
|
||||
|
@ -17,7 +17,7 @@
|
||||
$Err = 'You forgot to supply a link to the filling torrent';
|
||||
} else {
|
||||
$Link = $_POST['link'];
|
||||
if (preg_match("/".TORRENT_REGEX."/i", $Link, $Matches) < 1) {
|
||||
if (preg_match('/'.TORRENT_REGEX.'/i', $Link, $Matches) < 1) {
|
||||
$Err = "Your link didn't seem to be a valid torrent link";
|
||||
} else {
|
||||
$TorrentID = $Matches[0];
|
||||
@ -113,7 +113,7 @@
|
||||
}*/
|
||||
|
||||
//WEB has no ripping log. Ditto Vinyl - Actually ditto everything but CD
|
||||
//$WEBOverride = ((strpos($MediaList, 'WEB') !== false) && $Media == "WEB");
|
||||
//$WEBOverride = ((strpos($MediaList, 'WEB') !== false) && $Media == "WEB");
|
||||
//$VinylOverride = ((strpos($MediaList, 'Vinyl') !== false) && $Media == "Vinyl");
|
||||
//if ($Format == 'FLAC' && $LogCue && !$WEBOverride && !$VinylOverride) {
|
||||
if ($Format == 'FLAC' && $LogCue && $Media == 'CD') {
|
||||
@ -189,9 +189,10 @@
|
||||
Misc::write_log("Request $RequestID (".$FullName.") was filled by user $FillerID (".$FillerUsername.") with the torrent $TorrentID for a ".Format::get_size($RequestVotes['TotalBounty']).' bounty.');
|
||||
|
||||
// Give bounty
|
||||
$DB->query("UPDATE users_main
|
||||
SET Uploaded = (Uploaded + ".$RequestVotes['TotalBounty'].")
|
||||
WHERE ID = $FillerID");
|
||||
$DB->query("
|
||||
UPDATE users_main
|
||||
SET Uploaded = (Uploaded + ".$RequestVotes['TotalBounty'].")
|
||||
WHERE ID = $FillerID");
|
||||
|
||||
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
<?
|
||||
if (!check_perms('site_debug')) { error(403); }
|
||||
if (!check_perms('site_debug')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
if (!isset($_GET['case']) || !$Analysis = $Cache->get_value('analysis_'.$_GET['case'])) { error(404); }
|
||||
if (!isset($_GET['case']) || !$Analysis = $Cache->get_value('analysis_'.$_GET['case'])) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
View::show_header('Case Analysis');
|
||||
?>
|
||||
|
@ -1,22 +1,24 @@
|
||||
<?php
|
||||
|
||||
if (!check_perms('admin_manage_ipbans')) { error(403); }
|
||||
if (isset($_GET['perform'])) {
|
||||
$IPA = substr($_GET['ip'], 0, strcspn($_GET['ip'], '.'));
|
||||
if ($_GET['perform'] == 'delete') {
|
||||
if (!is_number($_GET['id']) || $_GET['id'] == '') {
|
||||
error(0);
|
||||
}
|
||||
$DB->query('DELETE FROM ip_bans WHERE ID='.$_GET['id']);
|
||||
$Bans = $Cache->delete_value('ip_bans_'.$IPA);
|
||||
} elseif ($_GET['perform'] == 'create') {
|
||||
$Notes = db_string($_GET['notes']);
|
||||
$IP = Tools::ip_to_unsigned($_GET['ip']); //Sanitized by Validation regex
|
||||
$DB->query("INSERT INTO ip_bans
|
||||
(FromIP, ToIP, Reason) VALUES
|
||||
('$IP','$IP', '$Notes')");
|
||||
$Cache->delete_value('ip_bans_'.$IPA);
|
||||
if (!check_perms('admin_manage_ipbans')) {
|
||||
error(403);
|
||||
}
|
||||
if (isset($_GET['perform'])) {
|
||||
$IPA = substr($_GET['ip'], 0, strcspn($_GET['ip'], '.'));
|
||||
if ($_GET['perform'] == 'delete') {
|
||||
if (!is_number($_GET['id']) || $_GET['id'] == '') {
|
||||
error(0);
|
||||
}
|
||||
$DB->query('DELETE FROM ip_bans WHERE ID='.$_GET['id']);
|
||||
$Bans = $Cache->delete_value('ip_bans_'.$IPA);
|
||||
} elseif ($_GET['perform'] == 'create') {
|
||||
$Notes = db_string($_GET['notes']);
|
||||
$IP = Tools::ip_to_unsigned($_GET['ip']); //Sanitized by Validation regex
|
||||
$DB->query("
|
||||
INSERT INTO ip_bans (FromIP, ToIP, Reason)
|
||||
VALUES ('$IP','$IP', '$Notes')");
|
||||
$Cache->delete_value('ip_bans_'.$IPA);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,9 @@
|
||||
ini_set('memory_limit', '5G');
|
||||
set_time_limit(0);
|
||||
|
||||
//if (!check_perms('site_debug')) { error(403); }
|
||||
//if (!check_perms('site_debug')) {
|
||||
// error(403);
|
||||
//}
|
||||
|
||||
View::show_header();
|
||||
|
||||
@ -12,32 +14,32 @@
|
||||
shell_exec('rm GeoLiteCity-latest.zip');
|
||||
|
||||
if (($Locations = file("GeoLiteCity_".date('Ym')."07/GeoLiteCity-Location.csv", FILE_IGNORE_NEW_LINES)) === false) {
|
||||
error("Download or extraction of maxmind database failed");
|
||||
error('Download or extraction of maxmind database failed');
|
||||
}
|
||||
array_shift($Locations);
|
||||
array_shift($Locations);
|
||||
|
||||
echo "There are ".count($Locations)." locations";
|
||||
echo "<br />";
|
||||
echo 'There are '.count($Locations).' locations';
|
||||
echo '<br />';
|
||||
|
||||
$CountryIDs = array();
|
||||
foreach ($Locations as $Location) {
|
||||
$Parts = explode(",", $Location);
|
||||
$Parts = explode(',', $Location);
|
||||
//CountryIDs[1] = "AP";
|
||||
$CountryIDs[trim($Parts[0], '"')] = trim($Parts[1], '"');
|
||||
}
|
||||
|
||||
echo "There are ".count($CountryIDs)." CountryIDs";
|
||||
echo "<br />";
|
||||
echo 'There are '.count($CountryIDs).' CountryIDs';
|
||||
echo '<br />';
|
||||
|
||||
if (($Blocks = file("GeoLiteCity_".date('Ym')."07/GeoLiteCity-Blocks.csv", FILE_IGNORE_NEW_LINES)) === false) {
|
||||
echo "Error";
|
||||
echo 'Error';
|
||||
}
|
||||
array_shift($Blocks);
|
||||
array_shift($Blocks);
|
||||
|
||||
echo "There are ".count($Blocks)." blocks";
|
||||
echo "<br />";
|
||||
echo 'There are '.count($Blocks).' blocks';
|
||||
echo '<br />';
|
||||
|
||||
//Because 4,000,000 rows is a lot for any server to handle, we split it into manageable groups of 10,000
|
||||
$SplitOn = 10000;
|
||||
@ -49,15 +51,19 @@
|
||||
$StartIP = trim($StartIP, '"');
|
||||
$EndIP = trim($EndIP, '"');
|
||||
$CountryID = trim($CountryID, '"');
|
||||
$Values[] = "('".$StartIP."', '".$EndIP."', '".$CountryIDs[$CountryID]."')";
|
||||
$Values[] = "('$StartIP', '$EndIP', '".$CountryIDs[$CountryID]."')";
|
||||
if ($Index % $SplitOn == 0) {
|
||||
$DB->query("INSERT INTO geoip_country (StartIP, EndIP, Code) VALUES ".implode(", ", $Values));
|
||||
$DB->query('
|
||||
INSERT INTO geoip_country (StartIP, EndIP, Code)
|
||||
VALUES '.implode(', ', $Values));
|
||||
$Values = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (count($Values) > 0) {
|
||||
$DB->query("INSERT INTO geoip_country (StartIP, EndIP, Code) VALUES ".implode(", ", $Values));
|
||||
$DB->query("
|
||||
INSERT INTO geoip_country (StartIP, EndIP, Code)
|
||||
VALUES ".implode(', ', $Values));
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +79,7 @@
|
||||
}
|
||||
enforce_login();
|
||||
|
||||
ini_set('memory_limit',1024*1024*1024);
|
||||
ini_set('memory_limit', 1024 * 1024 * 1024);
|
||||
ini_set('max_execution_time', 3600);
|
||||
|
||||
header('Content-type: text/plain');
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?
|
||||
$GroupID = $_GET['groupid'];
|
||||
if (!is_number($GroupID)) { error(404); }
|
||||
if (!is_number($GroupID)) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
View::show_header("History for Group $GroupID");
|
||||
|
||||
@ -27,8 +29,7 @@
|
||||
<?
|
||||
$Log = $DB->query("SELECT TorrentID, UserID, Info, Time FROM group_log WHERE GroupID = ".$GroupID." ORDER BY Time DESC");
|
||||
$LogEntries = $DB->to_array(false, MYSQL_NUM);
|
||||
foreach ($LogEntries AS $LogEntry)
|
||||
{
|
||||
foreach ($LogEntries AS $LogEntry) {
|
||||
list($TorrentID, $UserID, $Info, $Time) = $LogEntry;
|
||||
?>
|
||||
<tr class="rowa">
|
||||
@ -39,7 +40,7 @@
|
||||
list($Media, $Format, $Encoding) = $DB->next_record();
|
||||
if ($DB->record_count() == 0) { ?>
|
||||
<td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted)</td><?
|
||||
} elseif ($Media == "") { ?>
|
||||
} elseif ($Media == '') { ?>
|
||||
<td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td><?
|
||||
} else { ?>
|
||||
<td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a> (<?=$Format?>/<?=$Encoding?>/<?=$Media?>)</td>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?
|
||||
//Show the "This album is number x overall, etc. box for music only
|
||||
// Show the "This album is number x overall", etc. box for the "Music" category only
|
||||
if ($GroupCategoryID == 1) {
|
||||
$Rankings = Votes::get_ranking($GroupID, $GroupYear);
|
||||
$LIs = '';
|
||||
// Display information for the return categories of get_ranking()
|
||||
$GroupDecade = $GroupYear - ($GroupYear % 10);
|
||||
$names = array('overall'=>'<a href="top10.php?type=votes">overall</a>',
|
||||
'decade'=>check_perms('site_advanced_top10') ? 'for the <a href="top10.php?advanced=1&type=votes&year1='.$GroupDecade.'&year2='.($GroupDecade+9).'">'.$GroupDecade.'s</a>' : 'for the '.$GroupDecade.'s',
|
||||
'year'=>check_perms('site_advanced_top10') ? 'for <a href="top10.php?advanced=1&type=votes&year1='.$GroupYear.'&year2=">'.$GroupYear.'</a>' : "for $GroupYear");
|
||||
'decade'=>check_perms('site_advanced_top10') ? 'for the <a href="top10.php?advanced=1&type=votes&year1='.$GroupDecade.'&year2='.($GroupDecade+9).'">'.$GroupDecade.'s</a>' : 'for the '.$GroupDecade.'s',
|
||||
'year'=>check_perms('site_advanced_top10') ? 'for <a href="top10.php?advanced=1&type=votes&year1='.$GroupYear.'&year2=">'.$GroupYear.'</a>' : "for $GroupYear");
|
||||
|
||||
foreach ($names as $key => $text) {
|
||||
if ($Rank = $Rankings[$key]) {
|
||||
@ -19,7 +19,7 @@
|
||||
$Class = 'vr_top_50';
|
||||
}
|
||||
|
||||
$LIs .= '<li id="vote_rank_'.$key.'" class="'.$Class.'">No. '.$Rank.' '.$text.'</li>';
|
||||
$LIs .= "<li id=\"vote_rank_$key\" class=\"$Class\">No. $Rank $text</li>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -355,9 +355,9 @@ function checked($Checked) {
|
||||
<tr>
|
||||
<td class="label">Preset</td>
|
||||
<td>
|
||||
<button type="button" onclick="ParanoiaResetOff()">Show everything</button>
|
||||
<button type="button" onclick="ParanoiaResetStats()">Show stats only</button>
|
||||
<!--<button type="button" onclick="ParanoiaResetOn()">Show nothing</button>-->
|
||||
<input type="button" onclick="ParanoiaResetOff()">Show everything</input>
|
||||
<input type="button" onclick="ParanoiaResetStats()">Show stats only</input>
|
||||
<!--<input type="button" onclick="ParanoiaResetOn()">Show nothing</input>-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -477,7 +477,7 @@ function checked($Checked) {
|
||||
<tr>
|
||||
<td class="label"><strong>Reset passkey</strong></td>
|
||||
<td>
|
||||
<label><input type="checkbox" name="resetpasskey" />
|
||||
<label><input type="checkbox" name="resetpasskey" id="resetpasskey" />
|
||||
Any active torrents must be downloaded again to continue leeching/seeding.</label> <br />
|
||||
<a href="wiki.php?action=article&name=Passkey">See this wiki article for more information.</a>
|
||||
</td>
|
||||
@ -509,7 +509,7 @@ function checked($Checked) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="right">
|
||||
<input type="submit" value="Save Profile" />
|
||||
<input type="button" value="Save Profile" onclick="userform_submit();"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -590,8 +590,10 @@
|
||||
$Cache->delete_value('user_'.$Cur['torrent_pass']);
|
||||
//MUST come after the case for updating can_leech.
|
||||
|
||||
$DB->query("INSERT INTO users_history_passkeys
|
||||
(UserID, OldPassKey, NewPassKey, ChangerIP, ChangeTime) VALUES
|
||||
$DB->query("
|
||||
INSERT INTO users_history_passkeys
|
||||
(UserID, OldPassKey, NewPassKey, ChangerIP, ChangeTime)
|
||||
VALUES
|
||||
('$UserID', '".$Cur['torrent_pass']."', '$Passkey', '0.0.0.0', '".sqltime()."')");
|
||||
Tracker::update_tracker('change_passkey', array('oldpasskey' => $Cur['torrent_pass'], 'newpasskey' => $Passkey));
|
||||
}
|
||||
@ -621,10 +623,17 @@
|
||||
$DB->query("SELECT ID, Uploaded, Downloaded FROM users_main WHERE Username LIKE '".$MergeStatsFrom."'");
|
||||
if ($DB->record_count() > 0) {
|
||||
list($MergeID, $MergeUploaded, $MergeDownloaded) = $DB->next_record();
|
||||
$DB->query("UPDATE users_main AS um JOIN users_info AS ui ON um.ID=ui.UserID SET um.Uploaded = 0, um.Downloaded = 0, ui.AdminComment = CONCAT('".sqltime()." - Stats merged into https://".SSL_SITE_URL."/user.php?id=".$UserID." (".$Cur['Username'].") by ".$LoggedUser['Username']."\n\n', ui.AdminComment) WHERE ID = ".$MergeID);
|
||||
$DB->query("
|
||||
UPDATE users_main AS um
|
||||
JOIN users_info AS ui ON um.ID=ui.UserID
|
||||
SET
|
||||
um.Uploaded = 0,
|
||||
um.Downloaded = 0,
|
||||
ui.AdminComment = CONCAT('".sqltime()." - Stats (Uploaded: ".Format::get_size($MergeUploaded).", Downloaded: ".Format::get_size($MergeDownloaded).", Ratio: ".Format::get_ratio($MergeUploaded, $MergeDownloaded).") merged into https://".SSL_SITE_URL."/user.php?id=".$UserID." (".$Cur['Username'].") by ".$LoggedUser['Username']."\n\n', ui.AdminComment)
|
||||
WHERE ID = ".$MergeID);
|
||||
$UpdateSet[] = "Uploaded = Uploaded + '$MergeUploaded'";
|
||||
$UpdateSet[] = "Downloaded = Downloaded + '$MergeDownloaded'";
|
||||
$EditSummary[] = "stats merged from https://".SSL_SITE_URL."/user.php?id=".$MergeID." (".$MergeStatsFrom.")";
|
||||
$EditSummary[] = "stats merged from https://".SSL_SITE_URL."/user.php?id=".$MergeID." (".$MergeStatsFrom.") (previous stats: Uploaded: ".Format::get_size($Cur['Uploaded']).", Downloaded: ".Format::get_size($Cur['Downloaded']).", Ratio: ".Format::get_ratio($Cur['Uploaded'], $Cur['Downloaded']).")";
|
||||
$Cache->delete_value('users_stats_'.$UserID);
|
||||
$Cache->delete_value('users_stats_'.$MergeID);
|
||||
}
|
||||
|
@ -13,7 +13,9 @@
|
||||
} else {
|
||||
$UserID = $LoggedUser['ID'];
|
||||
}
|
||||
if (!is_number($UserID)) { error(404); }
|
||||
if (!is_number($UserID)) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
$UserInfo = Users::user_info($UserID);
|
||||
$Perms = Permissions::get_permissions($UserInfo['PermissionID']);
|
||||
@ -26,11 +28,15 @@
|
||||
}
|
||||
|
||||
if (isset($_GET['expire'])) {
|
||||
if (!check_perms('users_mod')) { error(403); }
|
||||
if (!check_perms('users_mod')) {
|
||||
error(403);
|
||||
}
|
||||
$UserID = $_GET['userid'];
|
||||
$TorrentID = $_GET['torrentid'];
|
||||
|
||||
if (!is_number($UserID) || !is_number($TorrentID)) { error(403); }
|
||||
if (!is_number($UserID) || !is_number($TorrentID)) {
|
||||
error(403);
|
||||
}
|
||||
$DB->query("SELECT info_hash FROM torrents where ID = $TorrentID");
|
||||
if (list($InfoHash) = $DB->next_record(MYSQLI_NUM, FALSE)) {
|
||||
$DB->query("UPDATE users_freeleeches SET Expired=TRUE WHERE UserID=$UserID AND TorrentID=$TorrentID");
|
||||
@ -44,27 +50,28 @@
|
||||
|
||||
list($Page,$Limit) = Format::page_limit(25);
|
||||
|
||||
$DB->query("SELECT SQL_CALC_FOUND_ROWS
|
||||
f.TorrentID,
|
||||
t.GroupID,
|
||||
f.Time,
|
||||
f.Expired,
|
||||
f.Downloaded,
|
||||
f.Uses,
|
||||
g.Name,
|
||||
t.Format,
|
||||
t.Encoding
|
||||
FROM users_freeleeches AS f
|
||||
JOIN torrents AS t ON t.ID = f.TorrentID
|
||||
JOIN torrents_group AS g ON g.ID = t.GroupID
|
||||
WHERE f.UserID = $UserID
|
||||
ORDER BY f.Time DESC
|
||||
LIMIT $Limit");
|
||||
$DB->query("
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
f.TorrentID,
|
||||
t.GroupID,
|
||||
f.Time,
|
||||
f.Expired,
|
||||
f.Downloaded,
|
||||
f.Uses,
|
||||
g.Name,
|
||||
t.Format,
|
||||
t.Encoding
|
||||
FROM users_freeleeches AS f
|
||||
JOIN torrents AS t ON t.ID = f.TorrentID
|
||||
JOIN torrents_group AS g ON g.ID = t.GroupID
|
||||
WHERE f.UserID = $UserID
|
||||
ORDER BY f.Time DESC
|
||||
LIMIT $Limit");
|
||||
$Tokens = $DB->to_array();
|
||||
|
||||
$DB->query("SELECT FOUND_ROWS()");
|
||||
list($NumResults) = $DB->next_record();
|
||||
$Pages=Format::get_pages($Page, $NumResults, 25);
|
||||
$Pages = Format::get_pages($Page, $NumResults, 25);
|
||||
|
||||
?>
|
||||
<div class="header">
|
||||
@ -97,10 +104,10 @@
|
||||
$Name = $ArtistName.$Name;
|
||||
}
|
||||
if ($Format && $Encoding) {
|
||||
$Name.=' ['.$Format.' / '.$Encoding.']';
|
||||
$Name.=" [$Format / $Encoding]";
|
||||
}
|
||||
?>
|
||||
<tr class="<?=($i?'rowa':'rowb')?>">
|
||||
<tr class="<?=($i ? 'rowa' : 'rowb')?>">
|
||||
<td><?=$Name?></td>
|
||||
<td><?=time_diff($Time)?></td>
|
||||
<td><?=($Expired ? 'Yes' : 'No')?><?=(check_perms('users_mod') && !$Expired)?" <a href=\"userhistory.php?action=token_history&expire=1&userid=$UserID&torrentid=$TorrentID\">(expire)</a>":''?>
|
||||
|
@ -19,7 +19,7 @@ function Vote(amount, requestid) {
|
||||
}
|
||||
|
||||
if (amount > 20*1024*1024) {
|
||||
upload = $('#current_uploaded').raw().value;
|
||||
upload = $('#current_uploaded').raw().value;
|
||||
download = $('#current_downloaded').raw().value;
|
||||
rr = $('#current_rr').raw().value;
|
||||
if (amount > .3*(upload - rr * download)) {
|
||||
|
@ -155,3 +155,15 @@ function ToggleIdenticons() {
|
||||
$('#identicons').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function userform_submit() {
|
||||
var userform = jQuery('#userform');
|
||||
if (jQuery('#resetpasskey').is(':checked')) {
|
||||
if (confirm('Are you sure you want to reset your passkey?')) {
|
||||
userform.submit();
|
||||
}
|
||||
}
|
||||
else {
|
||||
userform.submit();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user