Do not process these donations manually! The bitcoin parser will get them sooner or later (poke a developer if something seems broken).
-
-
-
Bitcoin address
-
User
-
Unprocessed amount
-
Total amount
-
Donor rank
-
Special rank
-
$NewDonations = array();
+$TotalUnproc = 0;
foreach ($AllDonations as $Address => $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 address
+
User
+
Unprocessed amount (=$TotalUnproc ?: '0'?>)
+
Total amount
+
Donor rank
+
Special rank
+
+
if (!empty($NewDonations)) {
foreach(DonationsBitcoin::get_userids(array_keys($NewDonations)) as $Address => $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 @@
View::show_footer();
diff --git a/static/functions/multiformat_uploader.js b/static/functions/multiformat_uploader.js
index 623630ae..88a59696 100644
--- a/static/functions/multiformat_uploader.js
+++ b/static/functions/multiformat_uploader.js
@@ -1,117 +1,119 @@
-(function() {
- var count = 1;
- var MAX_EXTRAS = 5;
- var FORMATS = [ 'MP3', 'FLAC', 'AAC', 'AC3', 'DTS' ];
- var BITRATES = [ '192', 'APS (VBR)', 'V2 (VBR)', 'V1 (VBR)', '256', 'APX (VBR)', 'V0 (VBR)', '320', 'Lossless', '24bit Lossless'];
- var filenames = new Array();
- $(document).ready(function () {
- $("#add_format").click(function () {
- createRow();
- });
+var buttonCount;
+var MAX_EXTRAS = 5;
+var FORMATS = [ 'MP3', 'FLAC', 'AAC', 'AC3', 'DTS' ];
+var BITRATES = [ '192', 'APS (VBR)', 'V2 (VBR)', 'V1 (VBR)', '256', 'APX (VBR)', 'V0 (VBR)', '320', 'Lossless', '24bit Lossless'];
- $("#remove_format").click(function () {
- removeRow();
- });
+function initMultiButtons() {
+ if (!$('#add_format')) {
+ return;
+ }
+ buttonCount = 1;
+ $('#add_format').click(function () {
+ createRow();
});
- function createRow() {
- if (count >= 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());
});