@@ -878,8 +878,8 @@ function flipView() {
var state = document.getElementById('flip_view_1').style.display == 'block';
if (state) {
- document.getElementById('flip_view_1').style.display='none';
- document.getElementById('flip_view_2').style.display='block';
+ document.getElementById('flip_view_1').style.display = 'none';
+ document.getElementById('flip_view_2').style.display = 'block';
document.getElementById('flipper_title').innerHTML = 'Similar artist cloud';
document.getElementById('flip_to').innerHTML = 'Switch to map';
@@ -892,8 +892,8 @@ function flipView() {
}
}
else {
- document.getElementById('flip_view_1').style.display='block';
- document.getElementById('flip_view_2').style.display='none';
+ document.getElementById('flip_view_1').style.display = 'block';
+ document.getElementById('flip_view_2').style.display = 'none';
document.getElementById('flipper_title').innerHTML = 'Similar artist map';
document.getElementById('flip_to').innerHTML = 'Switch to cloud';
}
@@ -968,7 +968,7 @@ function require(file, callback) {
//---------- Get some data to start processing
// Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page
-$Catalogue = $Cache->get_value('artist_comments_'.$ArtistID.'_catalogue_'.$CatalogueID);
+$Catalogue = $Cache->get_value("artist_comments_{$ArtistID}_catalogue_$CatalogueID");
if ($Catalogue === false) {
$DB->query("
SELECT
@@ -980,12 +980,12 @@ function require(file, callback) {
c.EditedTime,
u.Username
FROM artist_comments as c
- LEFT JOIN users_main AS u ON u.ID=c.EditedUserID
+ LEFT JOIN users_main AS u ON u.ID = c.EditedUserID
WHERE c.ArtistID = '$ArtistID'
ORDER BY c.ID
LIMIT $CatalogueLimit");
$Catalogue = $DB->to_array(false, MYSQLI_ASSOC);
- $Cache->cache_value('artist_comments_'.$ArtistID.'_catalogue_'.$CatalogueID, $Catalogue, 0);
+ $Cache->cache_value("artist_comments_{$ArtistID}_catalogue_$CatalogueID", $Catalogue, 0);
}
//This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue
@@ -1019,14 +1019,16 @@ function require(file, callback) {
- Quote
if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
- Edit
- }
+
+ }
if (check_perms('site_moderate_forums')) { ?>
- Delete
} ?>
diff --git a/sections/collages/add_artist.php b/sections/collages/add_artist.php
index dd7f7226..55689357 100644
--- a/sections/collages/add_artist.php
+++ b/sections/collages/add_artist.php
@@ -9,26 +9,40 @@
function add_artist($CollageID, $ArtistID) {
global $Cache, $LoggedUser, $DB;
- $DB->query("SELECT MAX(Sort) FROM collages_artists WHERE CollageID='$CollageID'");
+ $DB->query("
+ SELECT MAX(Sort)
+ FROM collages_artists
+ WHERE CollageID = '$CollageID'");
list($Sort) = $DB->next_record();
- $Sort+=10;
+ $Sort += 10;
- $DB->query("SELECT ArtistID FROM collages_artists WHERE CollageID='$CollageID' AND ArtistID='$ArtistID'");
+ $DB->query("
+ SELECT ArtistID
+ FROM collages_artists
+ WHERE CollageID = '$CollageID'
+ AND ArtistID = '$ArtistID'");
if ($DB->record_count() == 0) {
- $DB->query("INSERT IGNORE INTO collages_artists
- (CollageID, ArtistID, UserID, Sort, AddedOn)
+ $DB->query("
+ INSERT IGNORE INTO collages_artists
+ (CollageID, ArtistID, UserID, Sort, AddedOn)
VALUES
- ('$CollageID', '$ArtistID', '$LoggedUser[ID]', '$Sort', '" . sqltime() . "')");
+ ('$CollageID', '$ArtistID', '$LoggedUser[ID]', '$Sort', '" . sqltime() . "')");
- $DB->query("UPDATE collages SET NumTorrents=NumTorrents+1, Updated = '" . sqltime() . "' WHERE ID='$CollageID'");
+ $DB->query("
+ UPDATE collages
+ SET NumTorrents = NumTorrents + 1, Updated = '" . sqltime() . "'
+ WHERE ID = '$CollageID'");
- $Cache->delete_value('collage_'.$CollageID);
- $Cache->delete_value('artists_collages_'.$ArtistID);
- $Cache->delete_value('artists_collages_personal_'.$ArtistID);
+ $Cache->delete_value("collage_$CollageID");
+ $Cache->delete_value("artists_collages_$ArtistID");
+ $Cache->delete_value("artists_collages_personal_$ArtistID");
- $DB->query("SELECT UserID FROM users_collage_subs WHERE CollageID=$CollageID");
+ $DB->query("
+ SELECT UserID
+ FROM users_collage_subs
+ WHERE CollageID = $CollageID");
while (list($CacheUserID) = $DB->next_record()) {
- $Cache->delete_value('collage_subs_user_new_'.$CacheUserID);
+ $Cache->delete_value("collage_subs_user_new_$CacheUserID");
}
}
}
@@ -37,18 +51,21 @@ function add_artist($CollageID, $ArtistID) {
if (!is_number($CollageID)) {
error(404);
}
-$DB->query("SELECT UserID, CategoryID, Locked, NumTorrents, MaxGroups, MaxGroupsPerUser FROM collages WHERE ID='$CollageID'");
+$DB->query("
+ SELECT UserID, CategoryID, Locked, NumTorrents, MaxGroups, MaxGroupsPerUser
+ FROM collages
+ WHERE ID = '$CollageID'");
list($UserID, $CategoryID, $Locked, $NumTorrents, $MaxGroups, $MaxGroupsPerUser) = $DB->next_record();
if (!check_perms('site_collages_delete')) {
if ($Locked) {
- $Err = "This collage is locked";
+ $Err = 'This collage is locked';
}
if ($CategoryID == 0 && $UserID != $LoggedUser['ID']) {
- $Err = "You cannot edit someone else's personal collage";
+ $Err = 'You cannot edit someone else\'s personal collage.';
}
if ($MaxGroups > 0 && $NumTorrents >= $MaxGroups) {
- $Err = "This collage already holds its maximum allowed number of artists";
+ $Err = 'This collage already holds its maximum allowed number of artists.';
}
if (isset($Err)) {
@@ -57,7 +74,11 @@ function add_artist($CollageID, $ArtistID) {
}
if ($MaxGroupsPerUser > 0) {
- $DB->query("SELECT COUNT(*) FROM collages_artists WHERE CollageID='$CollageID' AND UserID='$LoggedUser[ID]'");
+ $DB->query("
+ SELECT COUNT(*)
+ FROM collages_artists
+ WHERE CollageID = '$CollageID'
+ AND UserID = '$LoggedUser[ID]'");
list($GroupsForUser) = $DB->next_record();
if (!check_perms('site_collages_delete') && $GroupsForUser >= $MaxGroupsPerUser) {
error(403);
@@ -65,7 +86,7 @@ function add_artist($CollageID, $ArtistID) {
}
if ($_REQUEST['action'] == 'add_artist') {
- $Val->SetFields('url', '1','regex','The URL must be a link to a artist on the site.',array('regex' => '/^'.ARTIST_REGEX.'/i'));
+ $Val->SetFields('url', '1', 'regex', 'The URL must be a link to a artist on the site.', array('regex' => '/^'.ARTIST_REGEX.'/i'));
$Err = $Val->ValidateForm($_POST);
if ($Err) {
@@ -81,7 +102,10 @@ function add_artist($CollageID, $ArtistID) {
error(404);
}
- $DB->query("SELECT ArtistID FROM artists_group WHERE ArtistID='$ArtistID'");
+ $DB->query("
+ SELECT ArtistID
+ FROM artists_group
+ WHERE ArtistID = '$ArtistID'");
list($ArtistID) = $DB->next_record();
if (!$ArtistID) {
error('The artist was not found in the database.');
@@ -89,7 +113,7 @@ function add_artist($CollageID, $ArtistID) {
add_artist($CollageID, $ArtistID);
} else {
- $URLs = explode("\n",$_REQUEST['urls']);
+ $URLs = explode("\n", $_REQUEST['urls']);
$ArtistIDs = array();
$Err = '';
foreach ($URLs as $Key => &$URL) {
@@ -119,7 +143,10 @@ function add_artist($CollageID, $ArtistID) {
break;
}
- $DB->query("SELECT ArtistID FROM artists_group WHERE ArtistID='$ArtistID'");
+ $DB->query("
+ SELECT ArtistID
+ FROM artists_group
+ WHERE ArtistID = '$ArtistID'");
if (!$DB->record_count()) {
$Err = "One of the entered URLs ($URL) does not correspond to an artist on the site.";
break;
diff --git a/sections/collages/add_comment.php b/sections/collages/add_comment.php
index 926d12a1..e54cae8c 100644
--- a/sections/collages/add_comment.php
+++ b/sections/collages/add_comment.php
@@ -12,23 +12,26 @@
$DB->query("
SELECT
- CEIL((
- SELECT COUNT(ID)+1
+ CEIL(
+ (
+ SELECT COUNT(ID) + 1
FROM collages_comments
- WHERE CollageID='".db_string($CollageID)."')/".TORRENT_COMMENTS_PER_PAGE."
+ WHERE CollageID = '".db_string($CollageID)."'
+ ) / ".TORRENT_COMMENTS_PER_PAGE."
) AS Pages");
list($Pages) = $DB->next_record();
-$DB->query("INSERT INTO collages_comments
- (CollageID, Body, UserID, Time)
+$DB->query("
+ INSERT INTO collages_comments
+ (CollageID, Body, UserID, Time)
VALUES
- ('$CollageID', '".db_string($_POST['body'])."', '$LoggedUser[ID]', '".sqltime()."')");
+ ('$CollageID', '".db_string($_POST['body'])."', '$LoggedUser[ID]', '".sqltime()."')");
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Pages - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
-$Cache->delete_value('collage_'.$CollageID);
-$Cache->delete_value('collage_comments_'.$CollageID.'_catalogue_'.$CatalogueID);
-$Cache->increment('collage_comments_'.$CollageID);
+$Cache->delete_value("collage_$CollageID");
+$Cache->delete_value("collage_comments_{$CollageID}_catalogue_$CatalogueID");
+$Cache->increment("collage_comments_$CollageID");
header('Location: collages.php?id='.$CollageID);
?>
diff --git a/sections/collages/add_torrent.php b/sections/collages/add_torrent.php
index 7813cc6c..f051eece 100644
--- a/sections/collages/add_torrent.php
+++ b/sections/collages/add_torrent.php
@@ -8,27 +8,41 @@
function add_torrent($CollageID, $GroupID) {
global $Cache, $LoggedUser, $DB;
- $DB->query("SELECT MAX(Sort) FROM collages_torrents WHERE CollageID='$CollageID'");
+ $DB->query("
+ SELECT MAX(Sort)
+ FROM collages_torrents
+ WHERE CollageID = '$CollageID'");
list($Sort) = $DB->next_record();
- $Sort+=10;
+ $Sort += 10;
- $DB->query("SELECT GroupID FROM collages_torrents WHERE CollageID='$CollageID' AND GroupID='$GroupID'");
+ $DB->query("
+ SELECT GroupID
+ FROM collages_torrents
+ WHERE CollageID = '$CollageID'
+ AND GroupID = '$GroupID'");
if ($DB->record_count() == 0) {
- $DB->query("INSERT IGNORE INTO collages_torrents
- (CollageID, GroupID, UserID, Sort, AddedOn)
+ $DB->query("
+ INSERT IGNORE INTO collages_torrents
+ (CollageID, GroupID, UserID, Sort, AddedOn)
VALUES
- ('$CollageID', '$GroupID', '$LoggedUser[ID]', '$Sort', '" . sqltime() . "')");
+ ('$CollageID', '$GroupID', '$LoggedUser[ID]', '$Sort', '" . sqltime() . "')");
- $DB->query("UPDATE collages SET NumTorrents=NumTorrents+1, Updated = '" . sqltime() . "' WHERE ID='$CollageID'");
+ $DB->query("
+ UPDATE collages
+ SET NumTorrents = NumTorrents + 1, Updated = '" . sqltime() . "'
+ WHERE ID = '$CollageID'");
- $Cache->delete_value('collage_'.$CollageID);
- $Cache->delete_value('torrents_details_'.$GroupID);
- $Cache->delete_value('torrent_collages_'.$GroupID);
- $Cache->delete_value('torrent_collages_personal_'.$GroupID);
+ $Cache->delete_value("collage_$CollageID");
+ $Cache->delete_value("torrents_details_$GroupID");
+ $Cache->delete_value("torrent_collages_$GroupID");
+ $Cache->delete_value("torrent_collages_personal_$GroupID");
- $DB->query("SELECT UserID FROM users_collage_subs WHERE CollageID=$CollageID");
+ $DB->query("
+ SELECT UserID
+ FROM users_collage_subs
+ WHERE CollageID = $CollageID");
while (list($CacheUserID) = $DB->next_record()) {
- $Cache->delete_value('collage_subs_user_new_'.$CacheUserID);
+ $Cache->delete_value("collage_subs_user_new_$CacheUserID");
}
}
}
@@ -37,18 +51,21 @@ function add_torrent($CollageID, $GroupID) {
if (!is_number($CollageID)) {
error(404);
}
-$DB->query("SELECT UserID, CategoryID, Locked, NumTorrents, MaxGroups, MaxGroupsPerUser FROM collages WHERE ID='$CollageID'");
+$DB->query("
+ SELECT UserID, CategoryID, Locked, NumTorrents, MaxGroups, MaxGroupsPerUser
+ FROM collages
+ WHERE ID = '$CollageID'");
list($UserID, $CategoryID, $Locked, $NumTorrents, $MaxGroups, $MaxGroupsPerUser) = $DB->next_record();
if (!check_perms('site_collages_delete')) {
if ($Locked) {
- $Err = "This collage is locked";
+ $Err = 'This collage is locked';
}
if ($CategoryID == 0 && $UserID != $LoggedUser['ID']) {
- $Err = "You cannot edit someone else's personal collage";
+ $Err = 'You cannot edit someone else\'s personal collage.';
}
if ($MaxGroups > 0 && $NumTorrents >= $MaxGroups) {
- $Err = "This collage already holds its maximum allowed number of torrents";
+ $Err = 'This collage already holds its maximum allowed number of torrents.';
}
if (isset($Err)) {
@@ -57,7 +74,11 @@ function add_torrent($CollageID, $GroupID) {
}
if ($MaxGroupsPerUser > 0) {
- $DB->query("SELECT COUNT(*) FROM collages_torrents WHERE CollageID='$CollageID' AND UserID='$LoggedUser[ID]'");
+ $DB->query("
+ SELECT COUNT(*)
+ FROM collages_torrents
+ WHERE CollageID = '$CollageID'
+ AND UserID = '$LoggedUser[ID]'");
list($GroupsForUser) = $DB->next_record();
if (!check_perms('site_collages_delete') && $GroupsForUser >= $MaxGroupsPerUser) {
error(403);
@@ -65,7 +86,7 @@ function add_torrent($CollageID, $GroupID) {
}
if ($_REQUEST['action'] == 'add_torrent') {
- $Val->SetFields('url', '1','regex','The URL must be a link to a torrent on the site.',array('regex' => '/^'.TORRENT_GROUP_REGEX.'/i'));
+ $Val->SetFields('url', '1', 'regex', 'The URL must be a link to a torrent on the site.', array('regex' => '/^'.TORRENT_GROUP_REGEX.'/i'));
$Err = $Val->ValidateForm($_POST);
if ($Err) {
@@ -81,7 +102,10 @@ function add_torrent($CollageID, $GroupID) {
error(404);
}
- $DB->query("SELECT ID FROM torrents_group WHERE ID='$TorrentID'");
+ $DB->query("
+ SELECT ID
+ FROM torrents_group
+ WHERE ID = '$TorrentID'");
list($GroupID) = $DB->next_record();
if (!$GroupID) {
error('The torrent was not found in the database.');
@@ -89,7 +113,7 @@ function add_torrent($CollageID, $GroupID) {
add_torrent($CollageID, $GroupID);
} else {
- $URLs = explode("\n",$_REQUEST['urls']);
+ $URLs = explode("\n", $_REQUEST['urls']);
$GroupIDs = array();
$Err = '';
foreach ($URLs as $Key => &$URL) {
@@ -115,13 +139,16 @@ function add_torrent($CollageID, $GroupID) {
$GroupIDs[] = $Matches[4];
$GroupID = $Matches[4];
} else {
- $Err = "One of the entered URLs ($URL) does not correspond to a torrent on the site.";
+ $Err = "One of the entered URLs ($URL) does not correspond to a torrent group on the site.";
break;
}
- $DB->query("SELECT ID FROM torrents_group WHERE ID='$GroupID'");
+ $DB->query("
+ SELECT ID
+ FROM torrents_group
+ WHERE ID = '$GroupID'");
if (!$DB->record_count()) {
- $Err = "One of the entered URLs ($URL) does not correspond to a torrent on the site.";
+ $Err = "One of the entered URLs ($URL) does not correspond to a torrent group on the site.";
break;
}
}
diff --git a/sections/collages/artist_collage.php b/sections/collages/artist_collage.php
index 2ae7b5eb..ae033ae8 100644
--- a/sections/collages/artist_collage.php
+++ b/sections/collages/artist_collage.php
@@ -175,9 +175,12 @@
-
-
-
+
+
+
+
+
+
Enter the URL of an artist on the site.
@@ -186,9 +189,12 @@
-
-
-
+
+
+
+
+
+
Enter the URLs of artists on the site, one per line.
@@ -205,8 +211,8 @@
um.Username,
cc.Time
FROM collages_comments AS cc
- LEFT JOIN users_main AS um ON um.ID=cc.UserID
- WHERE CollageID='$CollageID'
+ LEFT JOIN users_main AS um ON um.ID = cc.UserID
+ WHERE CollageID = '$CollageID'
ORDER BY ID DESC
LIMIT 15");
$CommentList = $DB->to_array(false, MYSQLI_NUM);
@@ -233,14 +239,17 @@
?>
Add comment
-
diff --git a/sections/collages/delete.php b/sections/collages/delete.php
index 12756a2b..7e510e6f 100644
--- a/sections/collages/delete.php
+++ b/sections/collages/delete.php
@@ -5,7 +5,10 @@
error(404);
}
-$DB->query("SELECT Name, UserID FROM collages WHERE ID='$CollageID'");
+$DB->query("
+ SELECT Name, UserID
+ FROM collages
+ WHERE ID = '$CollageID'");
list($Name, $UserID) = $DB->next_record();
if (!check_perms('site_collages_delete') && $UserID != $LoggedUser['ID']) {
@@ -24,9 +27,13 @@
- Reason:
-
-
+
+ Reason:
+
+
+
+
+
diff --git a/sections/collages/get_post.php b/sections/collages/get_post.php
index f0a9c9ab..86208661 100644
--- a/sections/collages/get_post.php
+++ b/sections/collages/get_post.php
@@ -19,7 +19,10 @@
$PostID = $_GET['post'];
// Mainly
-$DB->query("SELECT Body FROM collages_comments WHERE ID='$PostID'");
+$DB->query("
+ SELECT Body
+ FROM collages_comments
+ WHERE ID = '$PostID'");
list($Body) = $DB->next_record(MYSQLI_NUM);
// This gets sent to the browser, which echoes it wherever
diff --git a/sections/collages/manage.php b/sections/collages/manage.php
index fac17e2a..8d37b629 100644
--- a/sections/collages/manage.php
+++ b/sections/collages/manage.php
@@ -4,7 +4,10 @@
error(0);
}
-$DB->query("SELECT Name, UserID, CategoryID FROM collages WHERE ID='$CollageID'");
+$DB->query("
+ SELECT Name, UserID, CategoryID
+ FROM collages
+ WHERE ID = '$CollageID'");
list($Name, $UserID, $CategoryID) = $DB->next_record();
if ($CategoryID == 0 && $UserID != $LoggedUser['ID'] && !check_perms('site_collages_delete')) {
error(403);
@@ -17,9 +20,9 @@
ct.Sort,
tg.CatalogueNumber
FROM collages_torrents AS ct
- JOIN torrents_group AS tg ON tg.ID=ct.GroupID
- LEFT JOIN users_main AS um ON um.ID=ct.UserID
- WHERE ct.CollageID='$CollageID'
+ JOIN torrents_group AS tg ON tg.ID = ct.GroupID
+ LEFT JOIN users_main AS um ON um.ID = ct.UserID
+ WHERE ct.CollageID = '$CollageID'
ORDER BY ct.Sort");
$GroupIDs = $DB->collect('GroupID');
@@ -32,7 +35,7 @@
$TorrentList = array();
}
-View::show_header('Manage collage '.$Name, 'jquery-ui,jquery.tablesorter.min,sort');
+View::show_header("Manage collage: $Name", 'jquery-ui,jquery.tablesorter.min,sort');
?>
@@ -461,10 +465,13 @@
-
-
-
- Enter the URLs of torrents on the site, one per line.
+
+
+
+
+
+
+ Enter the URLs of torrent groups on the site, one per line.
@@ -480,8 +487,8 @@
um.Username,
cc.Time
FROM collages_comments AS cc
- LEFT JOIN users_main AS um ON um.ID=cc.UserID
- WHERE CollageID='$CollageID'
+ LEFT JOIN users_main AS um ON um.ID = cc.UserID
+ WHERE CollageID = '$CollageID'
ORDER BY ID DESC
LIMIT 15");
$CommentList = $DB->to_array(false, MYSQLI_NUM);
@@ -508,14 +515,17 @@
?>
Add comment
-
diff --git a/sections/user/edit.php b/sections/user/edit.php
index 03c05f5d..773499bd 100644
--- a/sections/user/edit.php
+++ b/sections/user/edit.php
@@ -152,29 +152,23 @@ function checked($Checked) {
Torrent grouping
-
-
-
- />
-
-
-
-
-
-
By default, torrent groups are:
-
-
- checked="checked" } ?>/>
-
-
-
- checked="checked" } ?>/>
-
-
-
-
-
-
+
+ />
+
+
+
+
By default, torrent groups are:
+
+
+ checked="checked" } ?>/>
+
+
+
+ checked="checked" } ?>/>
+
+
+
+
diff --git a/static/functions/notifications.js b/static/functions/notifications.js
index 51ae8168..b05a2dfe 100644
--- a/static/functions/notifications.js
+++ b/static/functions/notifications.js
@@ -7,8 +7,8 @@ function clearItem(torrentId) {
function clearSelected(filterId) {
var checkBoxes, checkedBoxes = [];
if (filterId) {
- var filterForm = $('#notificationform_'+filterId);
- checkBoxes = $('.notify_box_'+filterId, filterForm);
+ var filterForm = $('#notificationform_' + filterId);
+ checkBoxes = $('.notify_box_' + filterId, filterForm);
} else {
checkBoxes = $('.notify_box');
}
@@ -25,8 +25,8 @@ function clearSelected(filterId) {
}
function toggleBoxes(filterId, value) {
- var filterForm = $('#notificationform_'+filterId);
- var checkBoxes = $('.notify_box_'+filterId, filterForm);
+ var filterForm = $('#notificationform_' + filterId);
+ var checkBoxes = $('.notify_box_' + filterId, filterForm);
for (var i = checkBoxes.length - 1; i >= 0; i--) {
$(checkBoxes[i]).prop('checked', value);
}
diff --git a/static/functions/script_start.js b/static/functions/script_start.js
index e5a8a4d3..ddbbe8eb 100644
--- a/static/functions/script_start.js
+++ b/static/functions/script_start.js
@@ -214,7 +214,7 @@ jQuery.extend(jQuery.prototype, {
return this;
},
listen: function (event, callback) {
- for (var i=0,il=this.size();ia:after {
font-size: 85%;
font-weight: normal;
}
+.option_group {
+ margin-bottom: 10px;
+}
+.option_group:last-child {
+ margin-bottom: 0px;
+}
\ No newline at end of file