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
b7ca8d3cf6
commit
b8d11cc6b0
@ -66,7 +66,7 @@ public static function blacklisted($Url, $ShowError = true) {
|
||||
foreach (self::$Blacklist as &$Value) {
|
||||
if (stripos($Url, $Value)) {
|
||||
$ParsedUrl = parse_url($Url);
|
||||
if($ShowError) {
|
||||
if ($ShowError) {
|
||||
error($ParsedUrl['host'] . ' is not an allowed image host. Please use a different host.');
|
||||
}
|
||||
return true;
|
||||
|
@ -14,7 +14,7 @@
|
||||
if ($ForumCats === false) {
|
||||
$DB->query("SELECT ID, Name FROM forums_categories");
|
||||
$ForumCats = array();
|
||||
while (list($ID, $Name) = $DB->next_record()) {
|
||||
while (list($ID, $Name) = $DB->next_record()) {
|
||||
$ForumCats[$ID] = $Name;
|
||||
}
|
||||
$Cache->cache_value('forums_categories', $ForumCats, 0); //Inf cache.
|
||||
@ -50,7 +50,10 @@
|
||||
$Forums = $DB->to_array('ID', MYSQLI_ASSOC, false);
|
||||
foreach ($Forums as $ForumID => $Forum) {
|
||||
if (count($Forum['SpecificRules'])) {
|
||||
$DB->query("SELECT ThreadID FROM forums_specific_rules WHERE ForumID = ".$ForumID);
|
||||
$DB->query("
|
||||
SELECT ThreadID
|
||||
FROM forums_specific_rules
|
||||
WHERE ForumID = $ForumID");
|
||||
$ThreadIDs = $DB->collect('ThreadID');
|
||||
$Forums[$ForumID]['SpecificRules'] = $ThreadIDs;
|
||||
}
|
||||
|
@ -56,8 +56,8 @@
|
||||
$Cache->cache_value('voted_albums_'.$LoggedUser['ID'], $UserVotes);
|
||||
|
||||
// Update the paired cache keys for "people who liked"
|
||||
// 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.
|
||||
// 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.
|
||||
if ($Type == 'Up') {
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID, true);
|
||||
if ($VotePairs !== false) {
|
||||
@ -135,15 +135,15 @@
|
||||
}
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes);
|
||||
|
||||
$DB->query("
|
||||
$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)".
|
||||
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.
|
||||
// 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.
|
||||
if ($Type == 'Up') {
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID, true);
|
||||
if ($VotePairs !== false) {
|
||||
|
@ -8,8 +8,12 @@
|
||||
|
||||
$GenreTags = $Cache->get_value('genre_tags');
|
||||
if (!$GenreTags) {
|
||||
$DB->query('SELECT Name FROM tags WHERE TagType=\'genre\' ORDER BY Name');
|
||||
$GenreTags = $DB->collect('Name');
|
||||
$DB->query('
|
||||
SELECT Name
|
||||
FROM tags
|
||||
WHERE TagType=\'genre\'
|
||||
ORDER BY Name');
|
||||
$GenreTags = $DB->collect('Name');
|
||||
$Cache->cache_value('genre_tags', $GenreTags, 3600 * 24);
|
||||
}
|
||||
|
||||
|
@ -808,7 +808,7 @@ function compare($X, $Y) {
|
||||
</td>
|
||||
<td>
|
||||
<span id="vote_count_<?=$RequestID?>"><?=$Votes?></span>
|
||||
<? if (check_perms('site_vote')) { ?>
|
||||
<? if (check_perms('site_vote')) { ?>
|
||||
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<a href="javascript:Vote(0, <?=$RequestID?>)" class="brackets"><strong>+</strong></a>
|
||||
<? } ?>
|
||||
|
@ -4,7 +4,7 @@
|
||||
* $_GET['filter'] determines which torrents should be shown and can be empty/all (default), uploaded, snatched or seeding
|
||||
* $_GET['target'] further filters which transcodes one would like to do and can be empty/any (default), v0, v2, 320 or all
|
||||
* Here, 'any' means that at least one of the formats V0, V2 and 320 is missing and 'all' means that all of them are missing.
|
||||
* 'v0' etc mean that this specific format is missing (but others might be present).
|
||||
* 'v0', etc. mean that this specific format is missing (but others might be present).
|
||||
*
|
||||
* Furthermore, there's $_GET['userid'] which allows to see the page as a different user would see it (specifically relevant for uploaded/snatched/seeding).
|
||||
*/
|
||||
@ -304,7 +304,7 @@ function transcode_parse_groups($Groups) {
|
||||
foreach ($Group['Editions'] as $RemIdent => $Edition) {
|
||||
// TODO: point to the correct FLAC (?)
|
||||
$FlacID = array_search(true, $Edition['FlacIDs']);
|
||||
$DisplayName = $ArtistNames . '<a href="torrents.php?id='.$GroupID.'&torrentid='.$FlacID.'#torrent'.$FlacID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
$DisplayName = $ArtistNames . "<a href=\"torrents.php?id=$GroupID&torrentid=$FlacID#torrent$FlacID\" title=\"View Torrent\">$GroupName</a>";
|
||||
if ($GroupYear > 0) {
|
||||
$DisplayName .= " [$GroupYear]";
|
||||
}
|
||||
@ -315,7 +315,7 @@ function transcode_parse_groups($Groups) {
|
||||
$DisplayName .= ' ' . Format::torrent_label('Snatched!');
|
||||
}
|
||||
?>
|
||||
<tr<?=$Edition['FLACIsSnatched'] ? ' class="snatched_torrent"' : ''?>>
|
||||
<tr<?=($Edition['FLACIsSnatched'] ? ' class="snatched_torrent"' : '')?>>
|
||||
<td>
|
||||
<span class="torrent_links_block">
|
||||
<a href="torrents.php?action=download&id=<?=$Edition['FlacID']?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a>
|
||||
@ -324,9 +324,9 @@ function transcode_parse_groups($Groups) {
|
||||
<div class="torrent_info"><?=$Edition['EditionName']?></div>
|
||||
<div class="tags"><?=$TorrentTags->format('better.php?action=transcode&tags=')?></div>
|
||||
</td>
|
||||
<td><strong <?=isset($Edition['MP3s']['V2 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['MP3s']['V0 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['MP3s']['320']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=(isset($Edition['MP3s']['V2 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO')?></strong></td>
|
||||
<td><strong <?=(isset($Edition['MP3s']['V0 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO')?></strong></td>
|
||||
<td><strong <?=(isset($Edition['MP3s']['320']) ? 'class="important_text_alt">YES' : 'class="important_text">NO')?></strong></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
$UserClass = $Perms['Class'];
|
||||
if (!check_paranoia('torrentcomments', $UserInfo['Paranoia'], $UserClass, $UserID))
|
||||
error(403);
|
||||
} else {
|
||||
} else {
|
||||
$UserID = $LoggedUser['ID'];
|
||||
$Username = $LoggedUser['Username'];
|
||||
$Self = true;
|
||||
|
@ -73,32 +73,38 @@
|
||||
$DB->query("
|
||||
UPDATE forums
|
||||
SET
|
||||
NumPosts = NumPosts+1,
|
||||
NumTopics = NumTopics+1,
|
||||
LastPostID = '$PostID',
|
||||
LastPostAuthorID = '".$LoggedUser['ID']."',
|
||||
LastPostTopicID = '$TopicID',
|
||||
LastPostTime = '".sqltime()."'
|
||||
NumPosts = NumPosts + 1,
|
||||
NumTopics = NumTopics + 1,
|
||||
LastPostID = '$PostID',
|
||||
LastPostAuthorID = '".$LoggedUser['ID']."',
|
||||
LastPostTopicID = '$TopicID',
|
||||
LastPostTime = '".sqltime()."'
|
||||
WHERE ID = '$ForumID'");
|
||||
|
||||
$DB->query("
|
||||
UPDATE forums_topics
|
||||
SET
|
||||
NumPosts = NumPosts+1,
|
||||
LastPostID = '$PostID',
|
||||
LastPostAuthorID = '".$LoggedUser['ID']."',
|
||||
LastPostTime = '".sqltime()."'
|
||||
NumPosts = NumPosts + 1,
|
||||
LastPostID = '$PostID',
|
||||
LastPostAuthorID = '".$LoggedUser['ID']."',
|
||||
LastPostTime = '".sqltime()."'
|
||||
WHERE ID = '$TopicID'");
|
||||
|
||||
if (isset($_POST['subscribe'])) {
|
||||
$DB->query("INSERT INTO users_subscriptions VALUES ($LoggedUser[ID], $TopicID)");
|
||||
$DB->query("
|
||||
INSERT INTO users_subscriptions
|
||||
VALUES ($LoggedUser[ID], $TopicID)");
|
||||
$Cache->delete_value('subscriptions_user_'.$LoggedUser['ID']);
|
||||
}
|
||||
|
||||
//auto subscribe
|
||||
/*
|
||||
if (check_perms('users_mod')) {
|
||||
$DB->query("SELECT SubscriberID FROM subscribed_forums WHERE ForumID = '$ForumID' AND SubscriberID != '$LoggedUser[ID]'");
|
||||
$DB->query("
|
||||
SELECT SubscriberID
|
||||
FROM subscribed_forums
|
||||
WHERE ForumID = '$ForumID'
|
||||
AND SubscriberID != '$LoggedUser[ID]'");
|
||||
while (list($SubscriberID) = $DB->next_record()) {
|
||||
$DB->query("INSERT INTO users_subscriptions VALUES ($SubscriberID, $TopicID)");
|
||||
// $DB->query("INSERT INTO forums_last_read_topics
|
||||
@ -118,9 +124,11 @@
|
||||
$Answers = array();
|
||||
$Votes = array();
|
||||
|
||||
//This can cause polls to have answer ids of 1 3 4 if the second box is empty
|
||||
//This can cause polls to have answer IDs of 1 3 4 if the second box is empty
|
||||
foreach ($_POST['answers'] as $i => $Answer) {
|
||||
if ($Answer == '') { continue; }
|
||||
if ($Answer == '') {
|
||||
continue;
|
||||
}
|
||||
$Answers[$i + 1] = $Answer;
|
||||
$Votes[$i + 1] = 0;
|
||||
}
|
||||
@ -131,26 +139,30 @@
|
||||
error('You cannot create a poll with greater than 25 answers.');
|
||||
}
|
||||
|
||||
$DB->query('INSERT INTO forums_polls (TopicID, Question, Answers) VALUES (\''.$TopicID.'\',\''.db_string($Question).'\',\''.db_string(serialize($Answers)).'\')');
|
||||
$Cache->cache_value('polls_'.$TopicID, array($Question,$Answers,$Votes,'0000-00-00 00:00:00','0'), 0);
|
||||
$DB->query("
|
||||
INSERT INTO forums_polls
|
||||
(TopicID, Question, Answers)
|
||||
VALUES
|
||||
('$TopicID', '".db_string($Question)."', '".db_string(serialize($Answers))."')");
|
||||
$Cache->cache_value('polls_'.$TopicID, array($Question, $Answers, $Votes, '0000-00-00 00:00:00', '0'), 0);
|
||||
|
||||
if ($ForumID == STAFF_FORUM) {
|
||||
send_irc("PRIVMSG ".ADMIN_CHAN." :!mod Poll created by ".$LoggedUser['Username'].': "'.$Question.'" https://'.SSL_SITE_URL.'/forums.php?action=viewthread&threadid='.$TopicID);
|
||||
send_irc('PRIVMSG '.ADMIN_CHAN.' :!mod Poll created by '.$LoggedUser['Username'].": \"$Question\" https://".SSL_SITE_URL.'/forums.php?action=viewthread&threadid='.$TopicID);
|
||||
}
|
||||
}
|
||||
|
||||
//if cache exists modify it, if not, then it will be correct when selected next, and we can skip this block
|
||||
// if cache exists modify it, if not, then it will be correct when selected next, and we can skip this block
|
||||
if ($Forum = $Cache->get_value('forums_'.$ForumID)) {
|
||||
list($Forum,,,$Stickies) = $Forum;
|
||||
|
||||
//Remove the last thread from the index
|
||||
// Remove the last thread from the index
|
||||
if (count($Forum) == TOPICS_PER_PAGE && $Stickies < TOPICS_PER_PAGE) {
|
||||
array_pop($Forum);
|
||||
}
|
||||
|
||||
if ($Stickies > 0) {
|
||||
$Part1 = array_slice($Forum, 0, $Stickies, true); //Stickies
|
||||
$Part3 = array_slice($Forum, $Stickies, TOPICS_PER_PAGE - $Stickies - 1, true); //Rest of page
|
||||
$Part1 = array_slice($Forum, 0, $Stickies, true); // Stickies
|
||||
$Part3 = array_slice($Forum, $Stickies, TOPICS_PER_PAGE - $Stickies - 1, true); // Rest of page
|
||||
} else {
|
||||
$Part1 = array();
|
||||
$Part3 = $Forum;
|
||||
|
@ -3,7 +3,7 @@
|
||||
if (empty($Return)) {
|
||||
$ToID = $_GET['to'];
|
||||
if ($ToID == $LoggedUser['ID']) {
|
||||
error("You cannot start a conversation with yourself!");
|
||||
error('You cannot start a conversation with yourself!');
|
||||
header('Location: inbox.php');
|
||||
}
|
||||
}
|
||||
@ -36,7 +36,7 @@
|
||||
<h3>Subject</h3>
|
||||
<input type="text" class="required" name="subject" size="95" value="<?=(!empty($Subject) ? $Subject : '')?>" /><br />
|
||||
<h3>Body</h3>
|
||||
<textarea id="body" class="required" name="body" cols="95" rows="10" onkeyup="resize('body')"><?=(!empty($Body) ? $Body : '')?></textarea>
|
||||
<textarea id="body" class="required" name="body" cols="95" rows="10" onkeyup="resize('body')"><?=(!empty($Body) ? $Body : '')?></textarea>
|
||||
</div>
|
||||
<div id="preview" class="hidden"></div>
|
||||
<div id="buttons" class="center">
|
||||
|
@ -27,7 +27,10 @@
|
||||
error(403);
|
||||
}
|
||||
|
||||
$DB->query("SELECT Username FROM users_main WHERE ID='$ToID'");
|
||||
$DB->query("
|
||||
SELECT Username
|
||||
FROM users_main
|
||||
WHERE ID='$ToID'");
|
||||
list($ComposeToUsername) = $DB->next_record();
|
||||
if (!$ComposeToUsername) {
|
||||
error(404);
|
||||
@ -36,108 +39,164 @@
|
||||
|
||||
// $TypeLink is placed directly in the <textarea> when composing a PM
|
||||
switch ($Type) {
|
||||
case "user" :
|
||||
$DB->query("SELECT Username FROM users_main WHERE ID=".$ThingID);
|
||||
case 'user':
|
||||
$DB->query("
|
||||
SELECT Username
|
||||
FROM users_main
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No user with the reported ID found";
|
||||
$Error = 'No user with the reported ID found';
|
||||
} else {
|
||||
list($Username) = $DB->next_record();
|
||||
$TypeLink = "the user [user]".$Username."[/user]";
|
||||
$Subject = "User Report: ".display_str($Username);
|
||||
$TypeLink = "the user [user]{$Username}[/user]";
|
||||
$Subject = 'User Report: '.display_str($Username);
|
||||
}
|
||||
break;
|
||||
case "request" :
|
||||
case "request_update" :
|
||||
$DB->query("SELECT Title FROM requests WHERE ID=".$ThingID);
|
||||
case 'request':
|
||||
case 'request_update':
|
||||
$DB->query("
|
||||
SELECT Title
|
||||
FROM requests
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No request with the reported ID found";
|
||||
$Error = 'No request with the reported ID found';
|
||||
} else {
|
||||
list($Name) = $DB->next_record();
|
||||
$TypeLink = "the request [url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$ThingID."]".display_str($Name)."[/url]";
|
||||
$Subject = "Request Report: ".display_str($Name);
|
||||
$TypeLink = 'the request [url=https://'.SSL_SITE_URL."/requests.php?action=view&id=$ThingID]".display_str($Name).'[/url]';
|
||||
$Subject = 'Request Report: '.display_str($Name);
|
||||
}
|
||||
break;
|
||||
case "collage" :
|
||||
$DB->query("SELECT Name FROM collages WHERE ID=".$ThingID);
|
||||
case 'collage':
|
||||
$DB->query("
|
||||
SELECT Name
|
||||
FROM collages
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No collage with the reported ID found";
|
||||
$Error = 'No collage with the reported ID found';
|
||||
} else {
|
||||
list($Name) = $DB->next_record();
|
||||
$TypeLink = "the collage [url=https://".SSL_SITE_URL."/collage.php?id=".$ThingID."]".display_str($Name)."[/url]";
|
||||
$Subject = "Collage Report: ".display_str($Name);
|
||||
$TypeLink = 'the collage [url=https://'.SSL_SITE_URL."/collage.php?id=$ThingID]".display_str($Name).'[/url]';
|
||||
$Subject = 'Collage Report: '.display_str($Name);
|
||||
}
|
||||
break;
|
||||
case "thread" :
|
||||
$DB->query("SELECT Title FROM forums_topics WHERE ID=".$ThingID);
|
||||
case 'thread':
|
||||
$DB->query("
|
||||
SELECT Title
|
||||
FROM forums_topics
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No forum thread with the reported ID found";
|
||||
$Error = 'No forum thread with the reported ID found';
|
||||
} else {
|
||||
list($Title) = $DB->next_record();
|
||||
$TypeLink = "the forum thread [url=https://".SSL_SITE_URL."/forums.php?action=viewthread&threadid=".$ThingID."]".display_str($Title)."[/url]";
|
||||
$Subject = "Forum Thread Report: ".display_str($Title);
|
||||
$TypeLink = 'the forum thread [url=https://'.SSL_SITE_URL."/forums.php?action=viewthread&threadid=$ThingID]".display_str($Title).'[/url]';
|
||||
$Subject = 'Forum Thread Report: '.display_str($Title);
|
||||
}
|
||||
break;
|
||||
case "post" :
|
||||
case 'post':
|
||||
if (isset($LoggedUser['PostsPerPage'])) {
|
||||
$PerPage = $LoggedUser['PostsPerPage'];
|
||||
} else {
|
||||
$PerPage = POSTS_PER_PAGE;
|
||||
}
|
||||
$DB->query("SELECT p.ID, p.Body, p.TopicID, (SELECT COUNT(ID) FROM forums_posts WHERE forums_posts.TopicID = p.TopicID AND forums_posts.ID<=p.ID) AS PostNum FROM forums_posts AS p WHERE ID=".$ThingID);
|
||||
$DB->query("
|
||||
SELECT
|
||||
p.ID,
|
||||
p.Body,
|
||||
p.TopicID,
|
||||
( SELECT COUNT(ID)
|
||||
FROM forums_posts
|
||||
WHERE forums_posts.TopicID = p.TopicID
|
||||
AND forums_posts.ID<=p.ID
|
||||
) AS PostNum
|
||||
FROM forums_posts AS p
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No forum post with the reported ID found";
|
||||
$Error = 'No forum post with the reported ID found';
|
||||
} else {
|
||||
list($PostID,$Body,$TopicID,$PostNum) = $DB->next_record();
|
||||
$TypeLink = "this [url=https://".SSL_SITE_URL."/forums.php?action=viewthread&threadid=".$TopicID."&post=".$PostNum."#post".$PostID."]forum post[/url]";
|
||||
$Subject = "Forum Post Report: Post ID #".display_str($PostID);
|
||||
list($PostID, $Body, $TopicID, $PostNum) = $DB->next_record();
|
||||
$TypeLink = 'this [url=https://'.SSL_SITE_URL."/forums.php?action=viewthread&threadid=$TopicID&post=$PostNum#post$PostID]forum post[/url]";
|
||||
$Subject = 'Forum Post Report: Post ID #'.display_str($PostID);
|
||||
}
|
||||
break;
|
||||
case "requests_comment" :
|
||||
$DB->query("SELECT rc.RequestID, rc.Body, (SELECT COUNT(ID) FROM requests_comments WHERE ID <= ".$ThingID." AND requests_comments.RequestID = rc.RequestID) AS CommentNum FROM requests_comments AS rc WHERE ID=".$ThingID);
|
||||
case 'requests_comment':
|
||||
$DB->query("
|
||||
SELECT
|
||||
rc.RequestID,
|
||||
rc.Body,
|
||||
( SELECT COUNT(ID)
|
||||
FROM requests_comments
|
||||
WHERE ID <= $ThingID
|
||||
AND requests_comments.RequestID = rc.RequestID
|
||||
) AS CommentNum
|
||||
FROM requests_comments AS rc
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No request comment with the reported ID found";
|
||||
$Error = 'No request comment with the reported ID found';
|
||||
} else {
|
||||
list($RequestID, $Body, $PostNum) = $DB->next_record();
|
||||
$PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE);
|
||||
$TypeLink = "this [url=https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID."&page=".$PageNum."#post".$ThingID."]request comment[/url]";
|
||||
$Subject = "Request Comment Report: ID #".display_str($ThingID);
|
||||
$TypeLink = 'this [url=https://'.SSL_SITE_URL."/requests.php?action=view&id=$RequestID&page=$PageNum#post$ThingID]request comment[/url]";
|
||||
$Subject = 'Request Comment Report: ID #'.display_str($ThingID);
|
||||
}
|
||||
break;
|
||||
case "torrents_comment" :
|
||||
$DB->query("SELECT tc.GroupID, tc.Body, (SELECT COUNT(ID) FROM torrents_comments WHERE ID <= ".$ThingID." AND torrents_comments.GroupID = tc.GroupID) AS CommentNum FROM torrents_comments AS tc WHERE ID=".$ThingID);
|
||||
case 'torrents_comment':
|
||||
$DB->query("
|
||||
SELECT
|
||||
tc.GroupID,
|
||||
tc.Body,
|
||||
( SELECT COUNT(ID)
|
||||
FROM torrents_comments
|
||||
WHERE ID <= $ThingID
|
||||
AND torrents_comments.GroupID = tc.GroupID
|
||||
) AS CommentNum
|
||||
FROM torrents_comments AS tc
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No torrent comment with the reported ID found";
|
||||
$Error = 'No torrent comment with the reported ID found';
|
||||
} else {
|
||||
list($GroupID, $Body, $PostNum) = $DB->next_record();
|
||||
$PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE);
|
||||
$TypeLink = "this [url=https://".SSL_SITE_URL."/torrents.php?id=".$GroupID."&page=".$PageNum."#post".$ThingID."]torrent comment[/url]";
|
||||
$Subject = "Torrent Comment Report: ID #".display_str($ThingID);
|
||||
$TypeLink = 'this [url=https://'.SSL_SITE_URL."/torrents.php?id=$GroupID&page=$PageNum#post$ThingID]torrent comment[/url]";
|
||||
$Subject = 'Torrent Comment Report: ID #'.display_str($ThingID);
|
||||
}
|
||||
break;
|
||||
case "collages_comment" :
|
||||
$DB->query("SELECT cc.CollageID, cc.Body, (SELECT COUNT(ID) FROM collages_comments WHERE ID <= ".$ThingID." AND collages_comments.CollageID = cc.CollageID) AS CommentNum FROM collages_comments AS cc WHERE ID=".$ThingID);
|
||||
case 'collages_comment':
|
||||
$DB->query("
|
||||
SELECT
|
||||
cc.CollageID,
|
||||
cc.Body,
|
||||
( SELECT COUNT(ID)
|
||||
FROM collages_comments
|
||||
WHERE ID <= $ThingID
|
||||
AND collages_comments.CollageID = cc.CollageID
|
||||
) AS CommentNum
|
||||
FROM collages_comments AS cc
|
||||
WHERE ID=$ThingID");
|
||||
if ($DB->record_count() < 1) {
|
||||
$Error = "No collage comment with the reported ID found";
|
||||
$Error = 'No collage comment with the reported ID found';
|
||||
} else {
|
||||
list($CollageID, $Body, $PostNum) = $DB->next_record();
|
||||
$PerPage = POSTS_PER_PAGE;
|
||||
$PageNum = ceil($PostNum / $PerPage);
|
||||
$TypeLink = "this [url=https://".SSL_SITE_URL."/collage.php?action=comments&collageid=".$CollageID."&page=".$PageNum."#post".$ThingID."]collage comment[/url]";
|
||||
$Subject = "Collage Comment Report: ID #".display_str($ThingID);
|
||||
$TypeLink = 'this [url=https://'.SSL_SITE_URL."/collage.php?action=comments&collageid=$CollageID&page=$PageNum#post$ThingID]collage comment[/url]";
|
||||
$Subject = 'Collage Comment Report: ID #'.display_str($ThingID);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error("Incorrect type");
|
||||
error('Incorrect type');
|
||||
break;
|
||||
}
|
||||
if (isset($Error)) {
|
||||
error($Error);
|
||||
}
|
||||
|
||||
$DB->query("SELECT r.Reason FROM reports AS r WHERE r.ID = $ReportID");
|
||||
$DB->query("
|
||||
SELECT r.Reason
|
||||
FROM reports AS r
|
||||
WHERE r.ID = $ReportID");
|
||||
list($Reason) = $DB->next_record();
|
||||
|
||||
$Body = "You reported $TypeLink for the reason:\n[quote]".$Reason."[/quote]";
|
||||
$Body = "You reported $TypeLink for the reason:\n[quote]{$Reason}[/quote]";
|
||||
|
||||
?>
|
||||
<div class="thin">
|
||||
@ -166,7 +225,6 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?
|
||||
View::show_footer();
|
||||
?>
|
||||
|
@ -19,7 +19,7 @@
|
||||
header('Location: reports.php?action=report&type=request_update&id='.$ID);
|
||||
die();
|
||||
}
|
||||
$Reason = '[b]Year[/b]: '.$_POST['year'].".\n\n";
|
||||
$Reason = '[b]Year[/b]: '.$_POST['year'].".\n\n";
|
||||
// If the release type is somehow invalid, return "Not given"; otherwise, return the release type.
|
||||
$Reason .= '[b]Release type[/b]: '.((empty($_POST['releasetype']) || !is_number($_POST['releasetype']) || $_POST['releasetype'] == 0) ? 'Not given' : $ReleaseTypes[$_POST['releasetype']]).". \n\n";
|
||||
$Reason .= '[b]Additional comments[/b]: '.$_POST['comment'];
|
||||
|
@ -308,7 +308,7 @@
|
||||
<?=($First ? '' : '<br />')?>
|
||||
<?=$ExtraLinkName?>
|
||||
<a href="torrents.php?action=download&id=<?=$ExtraID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a>
|
||||
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
|
||||
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
|
||||
<?
|
||||
$First = false;
|
||||
}
|
||||
|
@ -466,7 +466,7 @@
|
||||
<?=($First ? '' : '<br />')?>
|
||||
<?=$ExtraLinkName?>
|
||||
<a href="torrents.php?action=download&id=<?=$ExtraID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a>
|
||||
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
|
||||
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
|
||||
<?
|
||||
$First = false;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Yeah, that's right, edit and new are the same place again.
|
||||
@ -89,12 +89,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
$Tags = implode(", ", $Request['Tags']);
|
||||
$Tags = implode(', ', $Request['Tags']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($NewRequest && !empty($_GET['artistid']) && is_number($_GET['artistid'])) {
|
||||
$DB->query("SELECT Name FROM artists_group WHERE artistid = ".$_GET['artistid']." LIMIT 1");
|
||||
$DB->query("
|
||||
SELECT Name
|
||||
FROM artists_group
|
||||
WHERE artistid = ".$_GET['artistid']."
|
||||
LIMIT 1");
|
||||
list($ArtistName) = $DB->next_record();
|
||||
$ArtistForm = array(
|
||||
1 => array(array('name' => trim($ArtistName))),
|
||||
@ -103,36 +107,38 @@
|
||||
);
|
||||
} elseif ($NewRequest && !empty($_GET['groupid']) && is_number($_GET['groupid'])) {
|
||||
$ArtistForm = Artists::get_artist($_GET['groupid']);
|
||||
$DB->query("SELECT tg.Name,
|
||||
tg.Year,
|
||||
tg.ReleaseType,
|
||||
tg.WikiImage,
|
||||
GROUP_CONCAT(t.Name SEPARATOR ', '),
|
||||
tg.CategoryID
|
||||
FROM torrents_group AS tg
|
||||
JOIN torrents_tags AS tt ON tt.GroupID=tg.ID
|
||||
JOIN tags AS t ON t.ID=tt.TagID
|
||||
WHERE tg.ID = ".$_GET['groupid']);
|
||||
$DB->query("
|
||||
SELECT
|
||||
tg.Name,
|
||||
tg.Year,
|
||||
tg.ReleaseType,
|
||||
tg.WikiImage,
|
||||
GROUP_CONCAT(t.Name SEPARATOR ', '),
|
||||
tg.CategoryID
|
||||
FROM torrents_group AS tg
|
||||
JOIN torrents_tags AS tt ON tt.GroupID=tg.ID
|
||||
JOIN tags AS t ON t.ID=tt.TagID
|
||||
WHERE tg.ID = ".$_GET['groupid']);
|
||||
if (list($Title, $Year, $ReleaseType, $Image, $Tags, $CategoryID) = $DB->next_record()) {
|
||||
$GroupID = trim($_REQUEST['groupid']);
|
||||
}
|
||||
}
|
||||
|
||||
View::show_header(($NewRequest ? "Create a request" : "Edit a request"), 'requests');
|
||||
View::show_header(($NewRequest ? 'Create a request' : 'Edit a request'), 'requests');
|
||||
?>
|
||||
<div class="thin">
|
||||
<div class="header">
|
||||
<h2><?=($NewRequest ? "Create a request" : "Edit a request")?></h2>
|
||||
<h2><?=($NewRequest ? 'Create a request' : 'Edit a request')?></h2>
|
||||
</div>
|
||||
|
||||
<div class="box pad">
|
||||
<form action="" method="post" id="request_form" onsubmit="Calculate();">
|
||||
<div>
|
||||
<? if (!$NewRequest) { ?>
|
||||
<? if (!$NewRequest) { ?>
|
||||
<input type="hidden" name="requestid" value="<?=$RequestID?>" />
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="action" value="<?=$NewRequest ? 'takenew' : 'takeedit'?>" />
|
||||
<input type="hidden" name="action" value="<?=($NewRequest ? 'takenew' : 'takeedit')?>" />
|
||||
</div>
|
||||
|
||||
<table class="layout">
|
||||
@ -147,7 +153,7 @@
|
||||
<td>
|
||||
<select id="categories" name="type" onchange="Categories()">
|
||||
<? foreach (Misc::display_array($Categories) as $Cat) { ?>
|
||||
<option value="<?=$Cat?>"<?=(!empty($CategoryName) && ($CategoryName == $Cat) ? ' selected="selected"' : '')?>><?=$Cat?></option>
|
||||
<option value="<?=$Cat?>"<?=(!empty($CategoryName) && ($CategoryName == $Cat) ? ' selected="selected"' : '')?>><?=$Cat?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
</td>
|
||||
@ -239,9 +245,13 @@
|
||||
<?
|
||||
$GenreTags = $Cache->get_value('genre_tags');
|
||||
if (!$GenreTags) {
|
||||
$DB->query('SELECT Name FROM tags WHERE TagType=\'genre\' ORDER BY Name');
|
||||
$GenreTags = $DB->collect('Name');
|
||||
$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
|
||||
$DB->query('
|
||||
SELECT Name
|
||||
FROM tags
|
||||
WHERE TagType=\'genre\'
|
||||
ORDER BY Name');
|
||||
$GenreTags = $DB->collect('Name');
|
||||
$Cache->cache_value('genre_tags', $GenreTags, 3600 * 6);
|
||||
}
|
||||
?>
|
||||
<select id="genre_tags" name="genre_tags" onchange="add_tag();return false;" >
|
||||
|
@ -638,7 +638,7 @@
|
||||
</td>
|
||||
<td class="nobr">
|
||||
<span id="vote_count_<?=$RequestID?>"><?=number_format($VoteCount)?></span>
|
||||
<? if (!$IsFilled && check_perms('site_vote')) { ?>
|
||||
<? if (!$IsFilled && check_perms('site_vote')) { ?>
|
||||
<a href="javascript:Vote(0, <?=$RequestID?>)" class="brackets"><strong>+</strong></a>
|
||||
<? } ?>
|
||||
</td>
|
||||
|
@ -113,7 +113,7 @@
|
||||
}
|
||||
}*/
|
||||
|
||||
//WEB has no ripping log. Ditto Vinyl - Actually ditto everything but CD
|
||||
//WEB has no ripping log. Ditto Vinyl - Actually ditto everything but CD
|
||||
//$WEBOverride = ((strpos($MediaList, 'WEB') !== false) && $Media == "WEB");
|
||||
//$VinylOverride = ((strpos($MediaList, 'Vinyl') !== false) && $Media == "Vinyl");
|
||||
//if ($Format == 'FLAC' && $LogCue && !$WEBOverride && !$VinylOverride) {
|
||||
|
@ -5,7 +5,7 @@
|
||||
authorize();
|
||||
|
||||
|
||||
if ($_POST['action'] != 'takenew' && $_POST['action'] != 'takeedit') {
|
||||
if ($_POST['action'] != 'takenew' && $_POST['action'] != 'takeedit') {
|
||||
error(0);
|
||||
}
|
||||
|
||||
|
@ -1073,6 +1073,7 @@ function next_hour() {
|
||||
AND Status = 'Open'
|
||||
AND AssignedToUser IS NULL");
|
||||
|
||||
|
||||
}
|
||||
/*************************************************************************\
|
||||
//--------------Run twice per month -------------------------------------//
|
||||
|
@ -98,7 +98,7 @@
|
||||
// did they just toggle it?
|
||||
if (isset($_GET['freeleech'])) {
|
||||
// what did they choose?
|
||||
$NewPref = ($_GET['freeleech'] == 'hide') ? 1 : 0;
|
||||
$NewPref = (($_GET['freeleech'] == 'hide') ? 1 : 0);
|
||||
|
||||
// Pref id different
|
||||
if ($NewPref != $DisableFreeTorrentTop10) {
|
||||
@ -114,31 +114,33 @@
|
||||
|
||||
// The link should say the opposite of the current setting
|
||||
$FreeleechToggleName = ($DisableFreeTorrentTop10 ? 'show' : 'hide');
|
||||
$FreeleechToggleQuery = Format::get_url(array('freeleech'));
|
||||
$FreeleechToggleQuery = Format::get_url(array('freeleech', 'groups'));
|
||||
|
||||
if (!empty($FreeleechToggleQuery))
|
||||
$FreeleechToggleQuery .= '&';
|
||||
|
||||
$FreeleechToggleQuery .= 'freeleech=' . $FreeleechToggleName;
|
||||
|
||||
$GroupByToggleQuery = "&groups=";
|
||||
$GroupBy = "";
|
||||
$GroupBySum = "";
|
||||
if(isset($_GET['groups']) && $_GET['groups'] == "show") {
|
||||
$GroupBy = " GROUP BY g.ID ";
|
||||
$GroupByToggleName = ($_GET['groups'] == "show" ? 'hide' : 'show');
|
||||
$GroupByToggleQuery = Format::get_url(array('freeleech', 'groups'));
|
||||
|
||||
if (!empty($GroupByToggleQuery))
|
||||
$GroupByToggleQuery .= '&';
|
||||
|
||||
$GroupByToggleQuery .= 'groups=' . $GroupByToggleName;
|
||||
|
||||
$GroupBySum = '';
|
||||
$GroupBy = '';
|
||||
if ($_GET['groups'] == 'show') {
|
||||
$GroupBy = ' GROUP BY g.ID ';
|
||||
$GroupBySum = md5($GroupBy);
|
||||
$GroupByToggleQuery .= "hide";
|
||||
$GroupByToggleName = "Show Top Torrents";
|
||||
} else {
|
||||
$GroupByToggleQuery .= "show";
|
||||
$GroupByToggleName = "Show Top Groups";
|
||||
}
|
||||
|
||||
?>
|
||||
<div style="text-align: right;" class="linkbox">
|
||||
<a href="top10.php?<?=$FreeleechToggleQuery?>" class="brackets"><?=ucfirst($FreeleechToggleName)?> freeleech in Top 10</a>
|
||||
<? if(check_perms("users_mod")) { ?>
|
||||
<a href="top10.php?<?=$GroupByToggleQuery?>" class="brackets"><?=ucfirst($GroupByToggleName)?></a>
|
||||
<? if (check_perms('users_mod')) { ?>
|
||||
<a href="top10.php?<?=$GroupByToggleQuery?>" class="brackets"><?=ucfirst($GroupByToggleName)?> top groups</a>
|
||||
<? } ?>
|
||||
</div>
|
||||
<?
|
||||
@ -149,47 +151,50 @@
|
||||
} else {
|
||||
$WhereSum = '';
|
||||
}
|
||||
$BaseQuery = "SELECT
|
||||
t.ID,
|
||||
g.ID,
|
||||
g.Name,
|
||||
g.CategoryID,
|
||||
g.wikiImage,
|
||||
g.TagList,
|
||||
t.Format,
|
||||
t.Encoding,
|
||||
t.Media,
|
||||
t.Scene,
|
||||
t.HasLog,
|
||||
t.HasCue,
|
||||
t.LogScore,
|
||||
t.RemasterYear,
|
||||
g.Year,
|
||||
t.RemasterTitle,
|
||||
t.Snatched,
|
||||
t.Seeders,
|
||||
t.Leechers,
|
||||
((t.Size * t.Snatched) + (t.Size * 0.5 * t.Leechers)) AS Data,
|
||||
g.ReleaseType,
|
||||
t.Size
|
||||
$BaseQuery = '
|
||||
SELECT
|
||||
t.ID,
|
||||
g.ID,
|
||||
g.Name,
|
||||
g.CategoryID,
|
||||
g.wikiImage,
|
||||
g.TagList,
|
||||
t.Format,
|
||||
t.Encoding,
|
||||
t.Media,
|
||||
t.Scene,
|
||||
t.HasLog,
|
||||
t.HasCue,
|
||||
t.LogScore,
|
||||
t.RemasterYear,
|
||||
g.Year,
|
||||
t.RemasterTitle,
|
||||
t.Snatched,
|
||||
t.Seeders,
|
||||
t.Leechers,
|
||||
((t.Size * t.Snatched) + (t.Size * 0.5 * t.Leechers)) AS Data,
|
||||
g.ReleaseType,
|
||||
t.Size
|
||||
FROM torrents AS t
|
||||
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID ";
|
||||
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID';
|
||||
|
||||
if ($Details=='all' || $Details=='day') {
|
||||
if ($Details == 'all' || $Details == 'day') {
|
||||
$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsActiveLastDay === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
$DayAgo = time_minus(86400);
|
||||
$Query = $BaseQuery.' WHERE t.Seeders>0 AND ';
|
||||
if (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= $Where.' AND ';
|
||||
}
|
||||
$Query .= "
|
||||
t.Time>'$DayAgo'
|
||||
$GroupID
|
||||
$GroupBy
|
||||
ORDER BY (t.Seeders + t.Leechers) DESC
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastDay = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_day_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsActiveLastDay,3600*2);
|
||||
$Cache->cache_value('top10tor_day_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastDay, 3600 * 2);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsActiveLastDay = false;
|
||||
@ -197,13 +202,15 @@
|
||||
}
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
|
||||
}
|
||||
if ($Details=='all' || $Details=='week') {
|
||||
if ($Details == 'all' || $Details == 'week') {
|
||||
$TopTorrentsActiveLastWeek = $Cache->get_value('top10tor_week_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsActiveLastWeek === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
$WeekAgo = time_minus(604800);
|
||||
$Query = $BaseQuery.' WHERE ';
|
||||
if (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= $Where.' AND ';
|
||||
}
|
||||
$Query .= "
|
||||
t.Time>'$WeekAgo'
|
||||
$GroupBy
|
||||
@ -211,7 +218,7 @@
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastWeek = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_week_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsActiveLastWeek,3600*6);
|
||||
$Cache->cache_value('top10tor_week_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastWeek, 3600 * 6);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsActiveLastWeek = false;
|
||||
@ -220,12 +227,14 @@
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Week', 'week', $TopTorrentsActiveLastWeek, $Limit);
|
||||
}
|
||||
|
||||
if ($Details=='all' || $Details=='month') {
|
||||
if ($Details == 'all' || $Details == 'month') {
|
||||
$TopTorrentsActiveLastMonth = $Cache->get_value('top10tor_month_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsActiveLastMonth === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
$Query = $BaseQuery.' WHERE ';
|
||||
if (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= $Where.' AND ';
|
||||
}
|
||||
$Query .= "
|
||||
t.Time>'".sqltime()."' - INTERVAL 1 MONTH
|
||||
$GroupBy
|
||||
@ -233,7 +242,7 @@
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastMonth = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_month_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsActiveLastMonth,3600*6);
|
||||
$Cache->cache_value('top10tor_month_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastMonth, 3600 * 6);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsActiveLastMonth = false;
|
||||
@ -242,17 +251,20 @@
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Month', 'month', $TopTorrentsActiveLastMonth, $Limit);
|
||||
}
|
||||
|
||||
if ($Details=='all' || $Details=='year') {
|
||||
if ($Details == 'all' || $Details == 'year') {
|
||||
$TopTorrentsActiveLastYear = $Cache->get_value('top10tor_year_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsActiveLastYear === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
// IMPORTANT NOTE - we use WHERE t.Seeders>200 in order to speed up this query. You should remove it!
|
||||
$Query = $BaseQuery.' WHERE ';
|
||||
if ($Details=='all' && !$Filtered) {
|
||||
if ($Details == 'all' && !$Filtered) {
|
||||
$Query .= 't.Seeders>=200 AND ';
|
||||
if (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= $Where.' AND ';
|
||||
}
|
||||
} elseif (!empty($Where)) {
|
||||
$Query .= $Where.' AND ';
|
||||
}
|
||||
elseif (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
$Query .= "
|
||||
t.Time>'".sqltime()."' - INTERVAL 1 YEAR
|
||||
$GroupBy
|
||||
@ -260,7 +272,7 @@
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastYear = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_year_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsActiveLastYear,3600*6);
|
||||
$Cache->cache_value('top10tor_year_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastYear, 3600 * 6);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsActiveLastYear = false;
|
||||
@ -269,7 +281,7 @@
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Year', 'year', $TopTorrentsActiveLastYear, $Limit);
|
||||
}
|
||||
|
||||
if ($Details=='all' || $Details=='overall') {
|
||||
if ($Details == 'all' || $Details == 'overall') {
|
||||
$TopTorrentsActiveAllTime = $Cache->get_value('top10tor_overall_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsActiveAllTime === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
@ -277,16 +289,19 @@
|
||||
$Query = $BaseQuery;
|
||||
if ($Details=='all' && !$Filtered) {
|
||||
$Query .= " WHERE t.Seeders>=500 ";
|
||||
if (!empty($Where)) { $Query .= ' AND '.$Where; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= ' AND '.$Where;
|
||||
}
|
||||
} elseif (!empty($Where)) {
|
||||
$Query .= ' WHERE '.$Where;
|
||||
}
|
||||
elseif (!empty($Where)) { $Query .= ' WHERE '.$Where; }
|
||||
$Query .= "
|
||||
$GroupBy
|
||||
ORDER BY (t.Seeders + t.Leechers) DESC
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveAllTime = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_overall_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsActiveAllTime,3600*6);
|
||||
$Cache->cache_value('top10tor_overall_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveAllTime, 3600 * 6);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsActiveAllTime = false;
|
||||
@ -295,19 +310,21 @@
|
||||
generate_torrent_table('Most Active Torrents of All Time', 'overall', $TopTorrentsActiveAllTime, $Limit);
|
||||
}
|
||||
|
||||
if (($Details=='all' || $Details=='snatched') && !$Filtered) {
|
||||
if (($Details == 'all' || $Details == 'snatched') && !$Filtered) {
|
||||
$TopTorrentsSnatched = $Cache->get_value('top10tor_snatched_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsSnatched === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
$Query = $BaseQuery;
|
||||
if (!empty($Where)) { $Query .= ' WHERE '.$Where; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= ' WHERE '.$Where;
|
||||
}
|
||||
$Query .= "
|
||||
$GroupBy
|
||||
ORDER BY t.Snatched DESC
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsSnatched = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_snatched_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsSnatched,3600*6);
|
||||
$Cache->cache_value('top10tor_snatched_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsSnatched, 3600 * 6);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsSnatched = false;
|
||||
@ -316,7 +333,7 @@
|
||||
generate_torrent_table('Most Snatched Torrents', 'snatched', $TopTorrentsSnatched, $Limit);
|
||||
}
|
||||
|
||||
if (($Details=='all' || $Details=='data') && !$Filtered) {
|
||||
if (($Details == 'all' || $Details == 'data') && !$Filtered) {
|
||||
$TopTorrentsTransferred = $Cache->get_value('top10tor_data_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsTransferred === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
@ -324,7 +341,9 @@
|
||||
$Query = $BaseQuery;
|
||||
if ($Details=='all') {
|
||||
$Query .= " WHERE t.Snatched>=100 ";
|
||||
if (!empty($Where)) { $Query .= ' AND '.$Where; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= ' AND '.$Where;
|
||||
}
|
||||
}
|
||||
$Query .= "
|
||||
$GroupBy
|
||||
@ -332,7 +351,7 @@
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsTransferred = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_data_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsTransferred,3600*6);
|
||||
$Cache->cache_value('top10tor_data_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsTransferred, 3600 * 6);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsTransferred = false;
|
||||
@ -341,19 +360,21 @@
|
||||
generate_torrent_table('Most Data Transferred Torrents', 'data', $TopTorrentsTransferred, $Limit);
|
||||
}
|
||||
|
||||
if (($Details=='all' || $Details=='seeded') && !$Filtered) {
|
||||
if (($Details == 'all' || $Details == 'seeded') && !$Filtered) {
|
||||
$TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum.$GroupBySum);
|
||||
if ($TopTorrentsSeeded === false) {
|
||||
if ($Cache->get_query_lock('top10')) {
|
||||
$Query = $BaseQuery;
|
||||
if (!empty($Where)) { $Query .= ' WHERE '.$Where; }
|
||||
if (!empty($Where)) {
|
||||
$Query .= ' WHERE '.$Where;
|
||||
}
|
||||
$Query .= "
|
||||
$GroupBy
|
||||
ORDER BY t.Seeders DESC
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsSeeded = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_seeded_'.$Limit.$WhereSum.$GroupBySum,$TopTorrentsSeeded,3600*6);
|
||||
$Cache->cache_value('top10tor_seeded_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsSeeded, 3600 * 6);
|
||||
$Cache->clear_query_lock('top10');
|
||||
} else {
|
||||
$TopTorrentsSeeded = false;
|
||||
@ -369,7 +390,7 @@
|
||||
|
||||
// generate a table based on data from most recent query to $DB
|
||||
function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
global $LoggedUser,$Categories,$ReleaseTypes;
|
||||
global $LoggedUser,$Categories,$ReleaseTypes,$GroupBy;
|
||||
?>
|
||||
<h3>Top <?=$Limit.' '.$Caption?>
|
||||
<? if (empty($_GET['advanced'])) { ?>
|
||||
@ -469,7 +490,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
// append extra info to torrent title
|
||||
$ExtraInfo = '';
|
||||
$AddExtra = '';
|
||||
if(empty($GroupBy)) {
|
||||
if (empty($GroupBy)) {
|
||||
if ($Format) {
|
||||
$ExtraInfo.= $Format;
|
||||
$AddExtra = ' / ';
|
||||
|
@ -131,56 +131,56 @@ function compare($X, $Y) {
|
||||
<div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
|
||||
<div class="head">
|
||||
<strong><?=(count($CoverArt) > 0 ? 'Covers (' . (count($CoverArt) + 1) . ')' : 'Cover')?></strong>
|
||||
<? if(count($CoverArt) > 0) {
|
||||
if(empty($LoggedUser['ShowExtraCovers'])) {
|
||||
for ($Index = 0; $Index <= count($CoverArt); $Index++) { ?>
|
||||
<? if (count($CoverArt) > 0) {
|
||||
if (empty($LoggedUser['ShowExtraCovers'])) {
|
||||
for ($Index = 0; $Index <= count($CoverArt); $Index++) { ?>
|
||||
<span id="cover_controls_<?=($Index)?>"<?=($Index > 0 ? ' style="display: none;"' : '')?>>
|
||||
<? if ($Index == count($CoverArt)) { ?>
|
||||
<? if ($Index == count($CoverArt)) { ?>
|
||||
<a class="brackets prev_cover" data-gazelle-prev-cover="<?=($Index - 1)?>" href="#">Prev</a>
|
||||
<a class="brackets show_all_covers" href="#">Show all</a>
|
||||
<span class="brackets next_cover">Next</span>
|
||||
<? } elseif ($Index > 0) { ?>
|
||||
<? } elseif ($Index > 0) { ?>
|
||||
<a class="brackets prev_cover" data-gazelle-prev-cover="<?=($Index - 1)?>" href="#">Prev</a>
|
||||
<a class="brackets show_all_covers" href="#">Show all</a>
|
||||
<a class="brackets next_cover" data-gazelle-next-cover="<?=($Index + 1)?>" href="#">Next</a>
|
||||
<? } elseif ($Index == 0 && count($CoverArt) > 0) { ?>
|
||||
<? } elseif ($Index == 0 && count($CoverArt) > 0) { ?>
|
||||
<span class="brackets prev_cover">Prev</span>
|
||||
<a class="brackets show_all_covers" href="#">Show all</a>
|
||||
<a class="brackets next_cover" data-gazelle-next-cover="<?=($Index + 1)?>" href="#">Next</a>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</span>
|
||||
<? }
|
||||
} else { ?>
|
||||
<span>
|
||||
<a class="brackets show_all_covers" href="#">Hide</a>
|
||||
</span>
|
||||
<? }
|
||||
} else { ?>
|
||||
<span>
|
||||
<a class="brackets show_all_covers" href="#">Hide</a>
|
||||
</span>
|
||||
<? }
|
||||
}?>
|
||||
} ?>
|
||||
</div>
|
||||
<?
|
||||
$Index = 0;
|
||||
?>
|
||||
<div id="covers">
|
||||
<div id="cover_div_<?=$Index?>">
|
||||
<? if ($WikiImage != '') { ?>
|
||||
<? if ($WikiImage != '') { ?>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$AltName?>" onclick="lightbox.init('<?=ImageTools::process($WikiImage)?>',220);" /></p>
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$GroupCategoryID - 1]?>" alt="<?=$Categories[$GroupCategoryID - 1]?>" title="<?=$Categories[$GroupCategoryID - 1]?>" width="220" height="220" border="0" /></p>
|
||||
<?
|
||||
}
|
||||
}
|
||||
$Index++;
|
||||
?>
|
||||
</div>
|
||||
<? foreach ($CoverArt as $Cover) {
|
||||
list($ImageID, $Image, $Summary, $AddedBy) = $Cover;
|
||||
?>
|
||||
<div id="cover_div_<?=$Index?>" <?=empty($LoggedUser['ShowExtraCovers']) ? 'style="display: none;"' : ""?>>
|
||||
<div id="cover_div_<?=$Index?>" <?=(empty($LoggedUser['ShowExtraCovers']) ? 'style="display: none;"' : '')?>>
|
||||
<p align="center">
|
||||
<? if(empty($LoggedUser['ShowExtraCovers'])) {
|
||||
$Src = 'src="" data-gazelle-temp-src="' . ImageTools::process($Image, true) . '"';
|
||||
} else {
|
||||
$Src = 'src="' . ImageTools::process($Image, true) . '"';
|
||||
}
|
||||
<? if (empty($LoggedUser['ShowExtraCovers'])) {
|
||||
$Src = 'src="" data-gazelle-temp-src="' . ImageTools::process($Image, true) . '"';
|
||||
} else {
|
||||
$Src = 'src="' . ImageTools::process($Image, true) . '"';
|
||||
}
|
||||
?>
|
||||
<img id="cover_<?=$Index?>" style="max-width: 220px;" <?=$Src?> alt="<?=$Summary?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>',220);" />
|
||||
</p>
|
||||
|
@ -49,7 +49,7 @@
|
||||
$N['Media'] = explode('|', substr($N['Media'], 1, -1));
|
||||
$N['Users'] = explode('|', substr($N['Users'], 1, -1));
|
||||
|
||||
$Usernames = '';
|
||||
$Usernames = '';
|
||||
foreach ($N['Users'] as $UserID) {
|
||||
$UserInfo = Users::user_info($UserID);
|
||||
$Usernames .= $UserInfo['Username'] . ', ';
|
||||
@ -101,8 +101,8 @@
|
||||
<p class="min_padding">Comma-separated list — e.g. <em>Pink Floyd, Led Zeppelin, Neil Young</em></p>
|
||||
<input type="checkbox" name="excludeva<?=$i?>" id="excludeva_<?=$N['ID']?>"<? if ($N['ExcludeVA'] == '1') { echo ' checked="checked"';} ?> />
|
||||
<label for="excludeva_<?=$N['ID']?>">Exclude Various Artists releases</label>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><strong>One of these users</strong></td>
|
||||
<td>
|
||||
|
@ -141,7 +141,7 @@ function($Matches) {
|
||||
if (strlen($ParanoiaString) == 0) {
|
||||
$Paranoia = array();
|
||||
} else {
|
||||
$Paranoia = $CustomParanoia;
|
||||
$Paranoia = $CustomParanoia;
|
||||
}
|
||||
} else {
|
||||
$Paranoia = unserialize($Paranoia);
|
||||
|
Loading…
Reference in New Issue
Block a user