From b4c8ebb041deedfbdd559a7a0fb99fb34b85f43e Mon Sep 17 00:00:00 2001 From: Git Date: Mon, 10 Jun 2013 08:01:05 +0000 Subject: [PATCH] Empty commit --- sections/ajax/forum/forum.php | 4 ++ sections/ajax/forum/thread.php | 5 +- sections/artist/warn.php | 8 +-- sections/bookmarks/torrents.php | 2 +- sections/forums/functions.php | 8 ++- sections/forums/warn.php | 8 +-- sections/inbox/takecompose.php | 14 ++--- sections/tools/managers/label_aliases.php | 75 ++++++++++++++--------- sections/tools/managers/tag_aliases.php | 20 ++++-- sections/torrents/warn.php | 7 +-- 10 files changed, 91 insertions(+), 60 deletions(-) diff --git a/sections/ajax/forum/forum.php b/sections/ajax/forum/forum.php index ac73eccc..32eaf29e 100644 --- a/sections/ajax/forum/forum.php +++ b/sections/ajax/forum/forum.php @@ -133,6 +133,10 @@ $AuthorName = $UserInfo['Username']; $UserInfo = Users::user_info($LastAuthorID); $LastAuthorName = $UserInfo['Username']; + // Bug fix for no last time available + if ($LastTime == '0000-00-00 00:00:00') { + $LastTime = ''; + } $JsonTopics[] = array( 'topicId' => (int) $TopicID, diff --git a/sections/ajax/forum/thread.php b/sections/ajax/forum/thread.php index 3f14afe5..f0ec9994 100644 --- a/sections/ajax/forum/thread.php +++ b/sections/ajax/forum/thread.php @@ -49,6 +49,9 @@ // Thread information, constant across all pages $ThreadInfo = get_thread_info($ThreadID, true, true, true); +if ($ThreadInfo == NULL) { + json_die('failure', 'no such thread exists'); +} $ForumID = $ThreadInfo['ForumID']; // Make sure they're allowed to look at the page @@ -127,7 +130,7 @@ } } -//Handle subscriptions +// Handle subscriptions if (($UserSubscriptions = $Cache->get_value('subscriptions_user_'.$LoggedUser['ID'])) === false) { $DB->query(" SELECT TopicID diff --git a/sections/artist/warn.php b/sections/artist/warn.php index 14929035..de1ac0e8 100644 --- a/sections/artist/warn.php +++ b/sections/artist/warn.php @@ -9,12 +9,10 @@ $UserID = (int) $_POST['userid']; $Key = (int) $_POST['key']; $UserInfo = Users::user_info($UserID); -$DB -> query(" - SELECT - ac.Body, - ac.AddedTime +$DB->query(" + SELECT ac.Body, ac.AddedTime FROM artist_comments AS ac - WHERE ac.ID='" . db_string($PostID) . "'"); + WHERE ac.ID = '" . db_string($PostID) . "'"); list($PostBody) = $DB -> next_record(); View::show_header('Warn User'); diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php index 5943e4df..bd366921 100644 --- a/sections/bookmarks/torrents.php +++ b/sections/bookmarks/torrents.php @@ -319,7 +319,7 @@ function compare($X, $Y) { $CollageCovers) { ?> - + - + @@ -69,12 +79,16 @@ - query("SELECT ID,BadLabel, AliasLabel FROM label_aliases $LabelNameSQL ORDER BY $OrderBy"); +query(" + SELECT ID, BadLabel, AliasLabel + FROM label_aliases + $LabelNameSQL + ORDER BY $OrderBy"); while (list($ID, $BadLabel, $AliasLabel) = $DB->next_record()) { ?> @@ -88,11 +102,12 @@ - +
LabelRenamed FromRenamed from Submit
- +
- - + +
diff --git a/sections/tools/managers/tag_aliases.php b/sections/tools/managers/tag_aliases.php index cb14a66b..334cac13 100644 --- a/sections/tools/managers/tag_aliases.php +++ b/sections/tools/managers/tag_aliases.php @@ -5,14 +5,16 @@ View::show_header('Tag Aliases'); -$orderby = ($_GET['order']) == 'badtags' ? 'BadTag' : 'AliasTag'; +$orderby = (($_GET['order'] == 'badtags') ? 'BadTag' : 'AliasTag'); if (check_perms('users_mod')) { if (isset($_POST['newalias'])) { $badtag = mysql_escape_string($_POST['badtag']); $aliastag = mysql_escape_string($_POST['aliastag']); - $DB -> query("INSERT INTO tag_aliases (BadTag, AliasTag) VALUES ('$badtag', '$aliastag')"); + $DB->query(" + INSERT INTO tag_aliases (BadTag, AliasTag) + VALUES ('$badtag', '$aliastag')"); } if (isset($_POST['changealias']) && is_number($_POST['aliasid'])) { @@ -21,10 +23,15 @@ $aliastag = mysql_escape_string($_POST['aliastag']); if ($_POST['save']) { - $DB -> query("UPDATE tag_aliases SET BadTag = '$badtag', AliasTag = '$aliastag' WHERE ID = '$aliasid' "); + $DB->query(" + UPDATE tag_aliases + SET BadTag = '$badtag', AliasTag = '$aliastag' + WHERE ID = '$aliasid' "); } if ($_POST['delete']) { - $DB -> query("DELETE FROM tag_aliases WHERE ID = '$aliasid'"); + $DB->query(" + DELETE FROM tag_aliases + WHERE ID = '$aliasid'"); } } } @@ -62,7 +69,10 @@ query("SELECT ID,BadTag,AliasTag FROM tag_aliases ORDER BY " . $orderby); +$DB->query(' + SELECT ID, BadTag, AliasTag + FROM tag_aliases + ORDER BY ' . $orderby); while (list($ID, $BadTag, $AliasTag) = $DB -> next_record()) { ?> diff --git a/sections/torrents/warn.php b/sections/torrents/warn.php index 178b0ac2..433dffab 100644 --- a/sections/torrents/warn.php +++ b/sections/torrents/warn.php @@ -9,11 +9,10 @@ $UserID = (int) $_POST['userid']; $Key = (int) $_POST['key']; $UserInfo = Users::user_info($UserID); -$DB -> query("SELECT - tc.Body, - tc.AddedTime +$DB->query(" + SELECT tc.Body, tc.AddedTime FROM torrents_comments AS tc - WHERE tc.ID='" . db_string($PostID) . "'"); + WHERE tc.ID = '" . db_string($PostID) . "'"); list($PostBody) = $DB -> next_record(); View::show_header('Warn User');