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
@ -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;
|
||||
}
|
||||
|
@ -135,10 +135,10 @@
|
||||
}
|
||||
$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
|
||||
|
@ -8,7 +8,11 @@
|
||||
|
||||
$GenreTags = $Cache->get_value('genre_tags');
|
||||
if (!$GenreTags) {
|
||||
$DB->query('SELECT Name FROM tags WHERE TagType=\'genre\' ORDER BY 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);
|
||||
}
|
||||
|
@ -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>
|
||||
<?
|
||||
}
|
||||
|
@ -91,14 +91,20 @@
|
||||
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,11 +139,15 @@
|
||||
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)).'\')');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
$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();
|
||||
?>
|
||||
|
@ -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,7 +107,9 @@
|
||||
);
|
||||
} elseif ($NewRequest && !empty($_GET['groupid']) && is_number($_GET['groupid'])) {
|
||||
$ArtistForm = Artists::get_artist($_GET['groupid']);
|
||||
$DB->query("SELECT tg.Name,
|
||||
$DB->query("
|
||||
SELECT
|
||||
tg.Name,
|
||||
tg.Year,
|
||||
tg.ReleaseType,
|
||||
tg.WikiImage,
|
||||
@ -118,11 +124,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
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">
|
||||
@ -132,7 +138,7 @@
|
||||
<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">
|
||||
@ -239,7 +245,11 @@
|
||||
<?
|
||||
$GenreTags = $Cache->get_value('genre_tags');
|
||||
if (!$GenreTags) {
|
||||
$DB->query('SELECT Name FROM tags WHERE TagType=\'genre\' ORDER BY Name');
|
||||
$DB->query('
|
||||
SELECT Name
|
||||
FROM tags
|
||||
WHERE TagType=\'genre\'
|
||||
ORDER BY Name');
|
||||
$GenreTags = $DB->collect('Name');
|
||||
$Cache->cache_value('genre_tags', $GenreTags, 3600 * 6);
|
||||
}
|
||||
|
@ -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,7 +151,8 @@
|
||||
} else {
|
||||
$WhereSum = '';
|
||||
}
|
||||
$BaseQuery = "SELECT
|
||||
$BaseQuery = '
|
||||
SELECT
|
||||
t.ID,
|
||||
g.ID,
|
||||
g.Name,
|
||||
@ -173,7 +176,7 @@
|
||||
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') {
|
||||
$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum.$GroupBySum);
|
||||
@ -181,10 +184,12 @@
|
||||
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);
|
||||
@ -203,7 +208,9 @@
|
||||
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
|
||||
@ -225,7 +232,9 @@
|
||||
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
|
||||
@ -250,9 +259,12 @@
|
||||
$Query = $BaseQuery.' WHERE ';
|
||||
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
|
||||
@ -277,9 +289,12 @@
|
||||
$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
|
||||
@ -300,7 +315,9 @@
|
||||
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
|
||||
@ -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
|
||||
@ -346,7 +365,9 @@
|
||||
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
|
||||
@ -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'])) { ?>
|
||||
|
@ -174,7 +174,7 @@ function compare($X, $Y) {
|
||||
<? 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) . '"';
|
||||
|
Loading…
Reference in New Issue
Block a user