diff --git a/sections/collages/index.php b/sections/collages/index.php
index cbf9e2fe..48f4979f 100644
--- a/sections/collages/index.php
+++ b/sections/collages/index.php
@@ -13,6 +13,7 @@
require(SERVER_ROOT.'/sections/collages/new_handle.php');
break;
case 'add_torrent':
+ case 'add_torrent_batch':
if(!check_perms('site_collages_manage')) { error(403); }
require(SERVER_ROOT.'/sections/collages/add_torrent.php');
break;
diff --git a/sections/requests/new_edit.php b/sections/requests/new_edit.php
index a313b16e..37c3bb3e 100644
--- a/sections/requests/new_edit.php
+++ b/sections/requests/new_edit.php
@@ -106,12 +106,13 @@
tg.Year,
tg.ReleaseType,
tg.WikiImage,
- GROUP_CONCAT(t.Name SEPARATOR ', ')
+ GROUP_CONCAT(t.Name SEPARATOR ', '),
+ tg.CategoryID
FROM torrents_group AS tg
JOIN torrents_tags AS tt ON tt.GroupID=tg.ID
JOIN tags AS t ON t.ID=tt.TagID
WHERE tg.ID = ".$_GET['groupid']);
- if(list($Title, $Year, $ReleaseType, $Image, $Tags) = $DB->next_record()) {
+ if(list($Title, $Year, $ReleaseType, $Image, $Tags, $CategoryID) = $DB->next_record()) {
$GroupID = trim($_REQUEST['groupid']);
}
}
@@ -324,7 +325,7 @@
If this request matches a torrent group already existing on the site, please indicate that here.
- } elseif ($GroupID) {
+ } elseif ($GroupID && ($CategoryID == 1)) {
?>
Torrent Group
diff --git a/sections/requests/takenew_edit.php b/sections/requests/takenew_edit.php
index aec629c2..885bfefa 100644
--- a/sections/requests/takenew_edit.php
+++ b/sections/requests/takenew_edit.php
@@ -182,12 +182,12 @@
$GroupID = $Matches[3];
}
if (is_number($GroupID)) {
- $DB->query("SELECT 1 FROM torrents_group WHERE ID = '$GroupID'");
+ $DB->query("SELECT 1 FROM torrents_group WHERE ID = '$GroupID' AND CategoryID = 1");
if ($DB->record_count() == 0) {
- $Err = "Torrent Group, if entered, must correspond to a group on the site.";
+ $Err = "Torrent Group, if entered, must correspond to a music group on the site.";
}
} else {
- $Err = "Torrent Group, if entered, must correspond to a group on the site.";
+ $Err = "Torrent Group, if entered, must correspond to a music group on the site.";
}
}
diff --git a/sections/staffpm/staff_inbox.php b/sections/staffpm/staff_inbox.php
index ee37815a..a90c9479 100644
--- a/sections/staffpm/staff_inbox.php
+++ b/sections/staffpm/staff_inbox.php
@@ -6,6 +6,7 @@
$UserLevel = $LoggedUser['Class'];
// Setup for current view mode
+$SortStr = "IF(AssignedToUser = ".$LoggedUser['ID'].",0,1) ASC, ";
switch ($View) {
case 'unanswered':
$ViewString = "Unanswered";
@@ -14,10 +15,12 @@
case 'open':
$ViewString = "All open";
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status IN ('Open', 'Unanswered')";
+ $SortStr = '';
break;
case 'resolved':
$ViewString = "Resolved";
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Resolved'";
+ $SortStr = '';
break;
case 'my':
$ViewString = "My unanswered";
@@ -51,7 +54,7 @@
ResolverID
FROM staff_pm_conversations
$WhereCondition
- ORDER BY IF(AssignedToUser = ".$LoggedUser['ID'].",0,1) ASC, Level DESC, Date DESC
+ ORDER BY $SortStr Level DESC, Date DESC
LIMIT $Limit
");
diff --git a/sections/top10/torrents.php b/sections/top10/torrents.php
index 73c09118..25b64cf5 100644
--- a/sections/top10/torrents.php
+++ b/sections/top10/torrents.php
@@ -138,7 +138,8 @@
t.Snatched,
t.Seeders,
t.Leechers,
- ((t.Size * t.Snatched) + (t.Size * 0.5 * t.Leechers)) AS Data
+ ((t.Size * t.Snatched) + (t.Size * 0.5 * t.Leechers)) AS Data,
+ g.ReleaseType
FROM torrents AS t
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID ";
@@ -225,7 +226,8 @@
}
if(($Details=='all' || $Details=='seeded') && !$Filtered) {
- if (!$TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum)) {
+ $TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum);
+ if ($TopTorrentsSeeded === FALSE) {
$Query = $BaseQuery;
if (!empty($Where)) { $Query .= ' WHERE '.$Where; }
$Query .= "
@@ -245,7 +247,7 @@
// generate a table based on data from most recent query to $DB
function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
- global $LoggedUser,$Categories,$Debug;
+ global $LoggedUser,$Categories,$Debug,$ReleaseTypes;
?>
Top =$Limit.' '.$Caption?>
if(empty($_GET['advanced'])){ ?>
@@ -288,7 +290,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
foreach ($Details as $Detail) {
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
- $RemasterTitle,$Snatched,$Seeders,$Leechers,$Data) = $Detail;
+ $RemasterTitle,$Snatched,$Seeders,$Leechers,$Data,$ReleaseType) = $Detail;
// highlight every other row
$Rank++;
@@ -307,6 +309,9 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
if($GroupCategoryID==1 && $GroupYear>0) {
$DisplayName.= " [$GroupYear]";
}
+ if($GroupCategoryID==1 && $ReleaseType > 0) {
+ $DisplayName.= ' ['.$ReleaseTypes[$ReleaseType].']';
+ }
// append extra info to torrent title
$ExtraInfo='';
diff --git a/sections/torrents/browse2.php b/sections/torrents/browse2.php
index c8829cf8..d037e670 100644
--- a/sections/torrents/browse2.php
+++ b/sections/torrents/browse2.php
@@ -712,6 +712,7 @@ function header_link($SortKey,$DefaultWay="desc") {
$DisplayName.=''.$GroupName.'';
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
if($GroupVanityHouse) { $DisplayName .= ' [VH]'; }
+ $DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
?>
diff --git a/sections/torrents/details.php b/sections/torrents/details.php
index c083f035..ec0518be 100644
--- a/sections/torrents/details.php
+++ b/sections/torrents/details.php
@@ -113,6 +113,9 @@ function compare($X, $Y){
@@ -584,6 +587,9 @@ function filelist($Str) {
$BitrateString = implode(", ", explode("|", $Request['BitrateList']));
$FormatString = implode(", ", explode("|", $Request['FormatList']));
$MediaString = implode(", ", explode("|", $Request['MediaList']));
+ if ($Request['LogCue']) {
+ $FormatString .= ' - '.$Request['LogCue'];
+ }
} else {
$BitrateString = "Unknown";
$FormatString = "Unknown";
diff --git a/sections/user/linkedfunctions.php b/sections/user/linkedfunctions.php
index a7b085f0..aa0fb606 100644
--- a/sections/user/linkedfunctions.php
+++ b/sections/user/linkedfunctions.php
@@ -1 +1 @@
-
include_once(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
function link_users($UserID, $TargetID) {
global $DB;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($UserID) || !is_number($TargetID)) {
error(403);
}
if ($UserID == $TargetID) {
return;
}
$DB->query("SELECT 1 FROM users_main WHERE ID IN ($UserID, $TargetID)");
if ($DB->record_count() != 2) {
error(403);
}
$DB->query("SELECT GroupID FROM users_dupes WHERE UserID = $TargetID");
list($TargetGroupID) = $DB->next_record();
$DB->query("SELECT u.GroupID, d.Comments FROM users_dupes AS u JOIN dupe_groups AS d ON d.ID = u.GroupID WHERE UserID = $UserID");
list($UserGroupID, $Comments) = $DB->next_record();
if ($TargetGroupID) {
if ($TargetGroupID == $UserGroupID) {
return;
}
if ($UserGroupID) {
$DB->query("UPDATE users_dupes SET GroupID = $TargetGroupID WHERE GroupID = $UserGroupID");
$DB->query("UPDATE dupe_groups SET Comments = CONCAT('".db_string($Comments)."\n\n',Comments) WHERE ID = $TargetGroupID");
$DB->query("DELETE FROM dupe_groups WHERE ID = $UserGroupID");
} else {
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($UserID, $TargetGroupID)");
}
} elseif ($UserGroupID) {
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($TargetID, $UserGroupID)");
} else {
$DB->query("INSERT INTO dupe_groups () VALUES ()");
$GroupID = $DB->inserted_id();
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($TargetID, $GroupID)");
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($UserID, $GroupID)");
}
}
function unlink_user($UserID) {
global $DB;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($UserID)) {
error(403);
}
$DB->query("DELETE FROM users_dupes WHERE UserID='$UserID'");
$DB->query("DELETE g.* FROM dupe_groups AS g LEFT JOIN users_dupes AS u ON u.GroupID = g.ID WHERE u.GroupID IS NULL");
}
function delete_dupegroup($GroupID) {
global $DB;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($GroupID)) {
error(403);
}
$DB->query("DELETE FROM dupe_groups WHERE ID = '$GroupID'");
}
function dupe_comments($GroupID, $Comments) {
global $DB, $Text;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($GroupID)) {
error(403);
}
$DB->query("UPDATE dupe_groups SET Comments = '".db_string($Comments)."' WHERE ID = '$GroupID'");
}
function user_dupes_table($UserID) {
global $DB, $LoggedUser;
$Text = new TEXT;
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($UserID)) {
error(403);
}
$DB->query("SELECT d.ID, d.Comments
FROM dupe_groups AS d
JOIN users_dupes AS u ON u.GroupID = d.ID
WHERE u.UserID = $UserID");
if (list($GroupID, $Comments) = $DB->next_record()) {
$DB->query("SELECT m.ID
FROM users_main AS m
JOIN users_dupes AS d ON m.ID = d.UserID
WHERE d.GroupID = $GroupID
ORDER BY m.ID = $UserID DESC");
$DupeCount = $DB->record_count();
$Dupes = $DB->to_array();
} else {
$DupeCount = 0;
$Dupes = array();
}
?>
}
?>
\ No newline at end of file
+
include_once(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
function link_users($UserID, $TargetID) {
global $DB;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($UserID) || !is_number($TargetID)) {
error(403);
}
if ($UserID == $TargetID) {
return;
}
$DB->query("SELECT 1 FROM users_main WHERE ID IN ($UserID, $TargetID)");
if ($DB->record_count() != 2) {
error(403);
}
$DB->query("SELECT GroupID FROM users_dupes WHERE UserID = $TargetID");
list($TargetGroupID) = $DB->next_record();
$DB->query("SELECT u.GroupID, d.Comments FROM users_dupes AS u JOIN dupe_groups AS d ON d.ID = u.GroupID WHERE UserID = $UserID");
list($UserGroupID, $Comments) = $DB->next_record();
if ($TargetGroupID) {
if ($TargetGroupID == $UserGroupID) {
return;
}
if ($UserGroupID) {
$DB->query("UPDATE users_dupes SET GroupID = $TargetGroupID WHERE GroupID = $UserGroupID");
$DB->query("UPDATE dupe_groups SET Comments = CONCAT('".db_string($Comments)."\n\n',Comments) WHERE ID = $TargetGroupID");
$DB->query("DELETE FROM dupe_groups WHERE ID = $UserGroupID");
} else {
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($UserID, $TargetGroupID)");
}
} elseif ($UserGroupID) {
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($TargetID, $UserGroupID)");
} else {
$DB->query("INSERT INTO dupe_groups () VALUES ()");
$GroupID = $DB->inserted_id();
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($TargetID, $GroupID)");
$DB->query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($UserID, $GroupID)");
}
}
function unlink_user($UserID) {
global $DB;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($UserID)) {
error(403);
}
$DB->query("DELETE FROM users_dupes WHERE UserID='$UserID'");
$DB->query("DELETE g.* FROM dupe_groups AS g LEFT JOIN users_dupes AS u ON u.GroupID = g.ID WHERE u.GroupID IS NULL");
}
function delete_dupegroup($GroupID) {
global $DB;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($GroupID)) {
error(403);
}
$DB->query("DELETE FROM dupe_groups WHERE ID = '$GroupID'");
}
function dupe_comments($GroupID, $Comments) {
global $DB, $Text;
authorize();
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($GroupID)) {
error(403);
}
$DB->query("UPDATE dupe_groups SET Comments = '".db_string($Comments)."' WHERE ID = '$GroupID'");
}
function user_dupes_table($UserID) {
global $DB, $LoggedUser;
$Text = new TEXT;
if (!check_perms('users_mod')) {
error(403);
}
if (!is_number($UserID)) {
error(403);
}
$DB->query("SELECT d.ID, d.Comments
FROM dupe_groups AS d
JOIN users_dupes AS u ON u.GroupID = d.ID
WHERE u.UserID = $UserID");
if (list($GroupID, $Comments) = $DB->next_record()) {
$DB->query("SELECT m.ID
FROM users_main AS m
JOIN users_dupes AS d ON m.ID = d.UserID
WHERE d.GroupID = $GroupID
ORDER BY m.ID = $UserID DESC");
$DupeCount = $DB->record_count();
$Dupes = $DB->to_array();
} else {
$DupeCount = 0;
$Dupes = array();
}
?>
}
?>
\ No newline at end of file
diff --git a/sections/user/manage_linked.php b/sections/user/manage_linked.php
index e1e26820..2c61f3ff 100644
--- a/sections/user/manage_linked.php
+++ b/sections/user/manage_linked.php
@@ -1 +1 @@
-
authorize();
include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
if (!check_perms('users_mod')) {
error(403);
}
$UserID = $_REQUEST['userid'];
switch ($_REQUEST['dupeaction']) {
case 'remove':
unlink_user($_REQUEST['removeid']);
break;
case 'add':
$Target = $_REQUEST['target'];
$DB->query("SELECT ID FROM users_main WHERE Username LIKE '".db_string($Target)."'");
if (list($TargetID) = $DB->next_record()) {
link_users($UserID, $TargetID);
} else {
error("User '$Target' not found.");
}
break;
case 'comments':
dupe_comments($_REQUEST['groupid'], $_REQUEST['dupecomments']);
break;
default:
error(403);
}
echo '\o/';
header("Location: user.php?id=$UserID");
?>
\ No newline at end of file
+
authorize();
include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
if (!check_perms('users_mod')) {
error(403);
}
$UserID = $_REQUEST['userid'];
switch ($_REQUEST['dupeaction']) {
case 'remove':
unlink_user($_REQUEST['removeid']);
break;
case 'update':
if ($_REQUEST['target']) {
$Target = $_REQUEST['target'];
$DB->query("SELECT ID FROM users_main WHERE Username LIKE '".db_string($Target)."'");
if (list($TargetID) = $DB->next_record()) {
link_users($UserID, $TargetID);
} else {
error("User '$Target' not found.");
}
}
$DB->query("SELECT GroupID FROM users_dupes WHERE UserID = '$UserID'");
list($GroupID) = $DB->next_record();
if ($_REQUEST['dupecomments'] && $GroupID) {
dupe_comments($GroupID, $_REQUEST['dupecomments']);
}
break;
default:
error(403);
}
echo '\o/';
header("Location: user.php?id=$UserID");
?>
\ No newline at end of file
diff --git a/sections/userhistory/subscribed_collages.php b/sections/userhistory/subscribed_collages.php
index b99509a3..bda46cb3 100644
--- a/sections/userhistory/subscribed_collages.php
+++ b/sections/userhistory/subscribed_collages.php
@@ -146,7 +146,11 @@
if (!$LoggedUser['HideCollage']) {?>