From df1de3ebad499f61eedc604a271d088b70de7d11 Mon Sep 17 00:00:00 2001 From: Git Date: Thu, 5 Sep 2013 08:00:49 +0000 Subject: [PATCH] Empty commit --- classes/config.template | 1 + classes/script_start.php | 2 +- docs/CHANGES.txt | 6 + sections/forums/thread.php | 23 +-- sections/index/private.php | 7 +- sections/reportsv2/report.php | 8 +- sections/tools/data/bitcoin_unproc.php | 22 ++- sections/torrents/edit.php | 23 ++- sections/upload/upload.php | 1 - static/functions/multiformat_uploader.js | 220 ++++++++++++----------- static/functions/upload.js | 1 + 11 files changed, 161 insertions(+), 153 deletions(-) diff --git a/classes/config.template b/classes/config.template index a5074839..8c837351 100644 --- a/classes/config.template +++ b/classes/config.template @@ -142,6 +142,7 @@ $ForumsRevealVoters = array(); $ForumsDoublePost = array(); $Categories = array('Music', 'Applications', 'E-Books', 'Audiobooks', 'E-Learning Videos', 'Comedy', 'Comics'); +$GroupedCategories = array_intersect(array('Music'), $Categories); $CategoryIcons = array('music.png', 'apps.png', 'ebook.png', 'audiobook.png', 'elearning.png', 'comedy.png', 'comics.png'); $Formats = array('MP3', 'FLAC', 'Ogg Vorbis', 'AAC', 'AC3', 'DTS'); diff --git a/classes/script_start.php b/classes/script_start.php index aac8ec0d..6320c3bd 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -295,7 +295,7 @@ Name AS ProperName FROM stylesheets'); $Stylesheets = $DB->to_array('ID', MYSQLI_BOTH); - $Cache->cache_value('stylesheets', $Stylesheets, 600); + $Cache->cache_value('stylesheets', $Stylesheets, 0); } //A9 TODO: Clean up this messy solution diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 70a114d8..36542319 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,11 @@ CHANGELOG +2013-09-05 by porkpie +Fix multi-format uploader when switching from "Music" to something else, then back to "Music" + +2013-09-05 by alderaan +Fix missing category change JavaScript code on torrent edit page in public Gazelle + 2013-09-01 by Ajax Tool for staff to send mass PMs to primary and secondary classes diff --git a/sections/forums/thread.php b/sections/forums/thread.php index 667c5592..ab217692 100644 --- a/sections/forums/thread.php +++ b/sections/forums/thread.php @@ -148,23 +148,18 @@ } -$DB->query(" - UPDATE users_notify_quoted - SET UnRead = false - WHERE UserID = '$LoggedUser[ID]' - AND Page = 'forums' - AND PageID = '$ThreadID' - AND PostID >= '$FirstPost' - AND PostID <= '$LastPost'"); -$Cache->delete_value('notify_quoted_' . $LoggedUser['ID']); -/* $QuoteNotificationsCount = $Cache->get_value('notify_quoted_' . $LoggedUser['ID']); -if ($QuoteNotificationsCount > 0) { - $Cache->cache_value('notify_quoted_' . $LoggedUser['ID'], $QuoteNotificationsCount - 1, 0); -} else { +if ($QuoteNotificationsCount === false || $QuoteNotificationsCount > 0) { + $DB->query(" + UPDATE users_notify_quoted + SET UnRead = false + WHERE UserID = '$LoggedUser[ID]' + AND Page = 'forums' + AND PageID = '$ThreadID' + AND PostID >= '$FirstPost' + AND PostID <= '$LastPost'"); $Cache->delete_value('notify_quoted_' . $LoggedUser['ID']); } -*/ // Start printing View::show_header($ThreadInfo['Title'] . ' < '.$Forums[$ForumID]['Name'].' < Forums','comments,subscriptions,bbcode', $IsDonorForum ? 'donor' : ''); diff --git a/sections/index/private.php b/sections/index/private.php index 9ecac056..e8aa2b60 100644 --- a/sections/index/private.php +++ b/sections/index/private.php @@ -106,7 +106,7 @@ b.Time, b.ThreadID FROM blog AS b - LEFT JOIN users_main AS um ON b.UserID=um.ID + LEFT JOIN users_main AS um ON b.UserID = um.ID ORDER BY Time DESC LIMIT 20"); $Blog = $DB->to_array(); @@ -478,7 +478,7 @@ - Edit - Hide + Hide
full_format($Body)?>
@@ -542,5 +542,6 @@ function contest() { - diff --git a/sections/reportsv2/report.php b/sections/reportsv2/report.php index 46781be8..afe38b6c 100644 --- a/sections/reportsv2/report.php +++ b/sections/reportsv2/report.php @@ -56,12 +56,12 @@ $Title .= " [$GroupYear]"; } if ($GroupVanityHouse) { - $DisplayName .=' [Vanity House]'; - $AltName .=' [Vanity House]'; + $DisplayName .= ' [Vanity House]'; + $AltName .= ' [Vanity House]'; } if ($GroupCategoryID == 1) { - $DisplayName .=' [' . $ReleaseTypes[$ReleaseType] . ']'; - $AltName .=' [' . $ReleaseTypes[$ReleaseType] . ']'; + $DisplayName .= ' [' . $ReleaseTypes[$ReleaseType] . ']'; + $AltName .= ' [' . $ReleaseTypes[$ReleaseType] . ']'; } } diff --git a/sections/tools/data/bitcoin_unproc.php b/sections/tools/data/bitcoin_unproc.php index eb7a54d9..a409966e 100644 --- a/sections/tools/data/bitcoin_unproc.php +++ b/sections/tools/data/bitcoin_unproc.php @@ -20,17 +20,9 @@
Do not process these donations manually! The bitcoin parser will get them sooner or later (poke a developer if something seems broken).
- - - - - - - - - $Amount) { if (isset($OldDonations[$Address])) { if ($Amount == $OldDonations[$Address]) { // Direct comparison should be fine as everything comes from bitcoind @@ -41,8 +33,20 @@ // so let's just round this off to satoshis and pray that we're on a 64 bit system $Amount = round($Amount - $OldDonations[$Address], 8); } + $TotalUnproc += $Amount; $NewDonations[$Address] = $Amount; } +?> +
Bitcoin addressUserUnprocessed amountTotal amountDonor rankSpecial rank
+ + + + + + + + + $UserID) { ?> diff --git a/sections/torrents/edit.php b/sections/torrents/edit.php index 9bb51a94..68c97035 100644 --- a/sections/torrents/edit.php +++ b/sections/torrents/edit.php @@ -48,17 +48,17 @@ lma.TorrentID AS LossymasterApproved, lwa.TorrentID AS LossywebApproved FROM torrents AS t - LEFT JOIN torrents_group AS tg ON tg.ID=t.GroupID - LEFT JOIN artists_group AS ag ON ag.ArtistID=tg.ArtistID - LEFT JOIN torrents_bad_tags AS bt ON bt.TorrentID=t.ID - LEFT JOIN torrents_bad_folders AS bf ON bf.TorrentID=t.ID - LEFT JOIN torrents_bad_files AS bfi ON bfi.TorrentID=t.ID - LEFT JOIN torrents_cassette_approved AS ca ON ca.TorrentID=t.ID - LEFT JOIN torrents_lossymaster_approved AS lma ON lma.TorrentID=t.ID - LEFT JOIN torrents_lossyweb_approved AS lwa ON lwa.TorrentID=t.id - WHERE t.ID='$TorrentID'"); + LEFT JOIN torrents_group AS tg ON tg.ID = t.GroupID + LEFT JOIN artists_group AS ag ON ag.ArtistID = tg.ArtistID + LEFT JOIN torrents_bad_tags AS bt ON bt.TorrentID = t.ID + LEFT JOIN torrents_bad_folders AS bf ON bf.TorrentID = t.ID + LEFT JOIN torrents_bad_files AS bfi ON bfi.TorrentID = t.ID + LEFT JOIN torrents_cassette_approved AS ca ON ca.TorrentID = t.ID + LEFT JOIN torrents_lossymaster_approved AS lma ON lma.TorrentID = t.ID + LEFT JOIN torrents_lossyweb_approved AS lwa ON lwa.TorrentID = t.id + WHERE t.ID = '$TorrentID'"); -list($Properties) = $DB->to_array(false,MYSQLI_BOTH); +list($Properties) = $DB->to_array(false, MYSQLI_BOTH); if (!$Properties) { error(404); } @@ -69,8 +69,7 @@ error(403); } -View::show_header('Edit torrent', 'upload'); - +View::show_header('Edit torrent', 'upload,torrent'); if (!($Properties['Remastered'] && !$Properties['RemasterYear']) || check_perms('edit_unknowns')) { $TorrentForm = new TORRENT_FORM($Properties, $Err, false); diff --git a/sections/upload/upload.php b/sections/upload/upload.php index 1a28c9e3..a3981bba 100644 --- a/sections/upload/upload.php +++ b/sections/upload/upload.php @@ -165,7 +165,6 @@ = 1) { - $("#remove_format").show(); - } - if (count == MAX_EXTRAS) { - $("#add_format").hide(); - } - var after = count > 1 ? "#extra_format_row_" + (count - 1) : '#placeholder_row_top'; - var master = $(document.createElement("tr")).attr({ - id:'extra_format_row_' + count - }).insertAfter(after); + $('#remove_format').click(function () { + removeRow(); + }); +} - $(document.createElement("td")).addClass('label').html("Extra format " + count + ":").appendTo(master); - var row = $(document.createElement("td")).appendTo(master); - addFile(row); - addFormats(row); - addBitrates(row); - addReleaseDescription(row); +function createRow() { + if (buttonCount >= 1) { + $("#remove_format").show(); + } + if (buttonCount == MAX_EXTRAS) { + $("#add_format").hide(); + } + var after = buttonCount > 1 ? "#extra_format_row_" + (buttonCount - 1) : '#placeholder_row_top'; + var master = $(document.createElement("tr")).attr({ + id:'extra_format_row_' + buttonCount + }).insertAfter(after); + + $(document.createElement("td")).addClass('label').html("Extra format " + buttonCount + ":").appendTo(master); + var row = $(document.createElement("td")).appendTo(master); + addFile(row); + addFormats(row); + addBitrates(row); + addReleaseDescription(row); + $("#post").val("Upload torrents"); + buttonCount++; +} + +function addFile(row) { + var id = buttonCount; + $(document.createElement("input")).attr({ + id:"extra_file_" + buttonCount, + type:'file', + name:"extra_file_" + buttonCount, + size:'30' + }).appendTo(row); + +} + +function addFormats(row) { + $(document.createElement("span")).html("    Format: ").appendTo(row); + $(document.createElement("select")).attr({ + id:"format_" + buttonCount, + name:'extra_format[]' + }).html(createDropDownOptions(FORMATS)).appendTo(row); +} + +function addBitrates(row) { + $(document.createElement("span")).html("    Bitrate: ").appendTo(row); + $(document.createElement("select")).attr({ + id:"bitrate_" + buttonCount, + name:'extra_bitrate[]' + }).html(createDropDownOptions(BITRATES)).appendTo(row); + /*change( + function () { + var id = $(this).attr('id'); + if ($(this).val() == 'Other') { + $(this).after( + ' '); + } else { + $("#other_bitrate_span_" + id).remove(); + } + });*/ +} + +function addReleaseDescription(row) { + var id = buttonCount; + var desc_row = $(document.createElement("tr")).attr({ id:"desc_row"}).css('cursor', 'pointer').appendTo(row); + $(document.createElement("a")).html("  [Add Release Description]").css('marginLeft', '-5px').appendTo(desc_row).click(function () { + $("#extra_release_desc_" + id).toggle(300); + }); + $(document.createElement("textarea")).attr({ + id:"extra_release_desc_" + id, + name:"extra_release_desc[]", + cols:60, + rows:4, + style:'display:none; margin-left: 5px; margin-top: 10px; margin-bottom: 10px;' + }).appendTo(desc_row); +} + +function createDropDownOptions(array) { + s = ""; + for (var i in array) { + s += (""); + } + return s; +} + +function removeRow() { + if (buttonCount > 1) { + $("#placeholder_row_bottom").prev().remove(); + $("#add_format").show(); + buttonCount--; $("#post").val("Upload torrents"); - count++; + } + if (buttonCount == 1) { + $("#remove_format").hide(); + $("#post").val("Upload torrent"); } - function addFile(row) { - var id = count; - $(document.createElement("input")).attr({ - id:"extra_file_" + count, - type:'file', - name:"extra_file_" + count, - size:'30' - }).appendTo(row); +} - } - - function addFormats(row) { - $(document.createElement("span")).html("    Format: ").appendTo(row); - $(document.createElement("select")).attr({ - id:"format_" + count, - name:'extra_format[]' - }).html(createDropDownOptions(FORMATS)).appendTo(row); - } - - function addBitrates(row) { - $(document.createElement("span")).html("    Bitrate: ").appendTo(row); - $(document.createElement("select")).attr({ - id:"bitrate_" + count, - name:'extra_bitrate[]' - }).html(createDropDownOptions(BITRATES)).appendTo(row); - /*change( - function () { - var id = $(this).attr('id'); - if ($(this).val() == 'Other') { - $(this).after( - ' '); - } else { - $("#other_bitrate_span_" + id).remove(); - } - });*/ - } - - function addReleaseDescription(row) { - var id = count; - var desc_row = $(document.createElement("tr")).attr({ id:"desc_row"}).css('cursor', 'pointer').appendTo(row); - $(document.createElement("a")).html("  [Add Release Description]").css('marginLeft', '-5px').appendTo(desc_row).click(function () { - $("#extra_release_desc_" + id).toggle(300); - }); - $(document.createElement("textarea")).attr({ - id:"extra_release_desc_" + id, - name:"extra_release_desc[]", - cols:60, - rows:4, - style:'display:none; margin-left: 5px; margin-top: 10px; margin-bottom: 10px;' - }).appendTo(desc_row); - } - - function createDropDownOptions(array) { - s = ""; - for (var i in array) { - s += (""); - } - return s; - } - - function removeRow() { - if (count > 1) { - $("#placeholder_row_bottom").prev().remove(); - $("#add_format").show(); - filenames.pop(); - count--; - $("#post").val("Upload torrents"); - } - if (count == 1) { - $("#remove_format").hide(); - $("#post").val("Upload torrent"); - } - - } - -})(); +$(document).ready(initMultiButtons); diff --git a/static/functions/upload.js b/static/functions/upload.js index b22cd629..71fccf54 100644 --- a/static/functions/upload.js +++ b/static/functions/upload.js @@ -1,6 +1,7 @@ function Categories() { ajax.get('ajax.php?action=upload_section&categoryid=' + $('#categories').raw().value, function (response) { $('#dynamic_form').raw().innerHTML = response; + initMultiButtons(); // Evaluate the code that generates previews. eval($('#dynamic_form script.preview_code').html()); });
Bitcoin addressUserUnprocessed amount ()Total amountDonor rankSpecial rank