diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php
index f87349a2..9a87b80d 100644
--- a/classes/class_torrent_form.php
+++ b/classes/class_torrent_form.php
@@ -139,7 +139,7 @@ function foot() {
Be sure that your torrent is approved by the rules. Not doing this will result in a warning or worse.
if($this->NewTorrent) { ?>
-
After uploading the torrent, you will have a one hour grace period during which no one other than you can fill requests with this torrent. Make use of this time wisely, and search the requests.
+
After uploading the torrent, you will have a one hour grace period during which no one other than you can fill requests with this torrent. Make use of this time wisely, and search the list of requests.
@@ -588,17 +588,17 @@ function show() {
} ?>
Disabled?>/>
- Tags should be comma separated, and you should use a period ('.') to separate words inside a tag - eg. 'hip.hop'.
+ Tags should be comma-separated, and you should use a period (".") to separate words inside a tag — e.g. "hip.hop".
- There is a list of official tags to the left of the text box. Please use these tags instead of 'unofficial' tags (e.g. use the official 'drum.and.bass' tag, instead of an unofficial 'dnb' tag). Please note that the '2000s' tag refers to music produced between 2000 and 2009.
+ There is a list of official tags to the left of the text box. Please use these tags instead of "unofficial" tags (e.g. use the official "drum.and.bass" tag, instead of an unofficial "dnb" tag). Please note that the "2000s" tag refers to music produced between 2000 and 2009.
- Avoid abbreviations if at all possible. So instead of tagging an album as 'alt', tag it as 'alternative'. Make sure that you use correct spelling.
+ Avoid abbreviations if at all possible. So instead of tagging an album as "alt", tag it as "alternative". Make sure that you use correct spelling.
- Avoid using multiple synonymous tags. Using both 'prog.rock' and 'progressive.rock' is redundant and annoying - just use the official 'progressive.rock' tag.
+ Avoid using multiple synonymous tags. Using both "prog.rock" and "progressive.rock" is redundant and annoying—just use the official "progressive.rock" tag.
- Don't use 'useless' tags, such as 'seen.live', 'awesome', 'rap' (is encompassed by 'hip.hop'), etc. If an album is live, you can tag it as 'live'.
+ Do not add "useless" tags, such as "seen.live", "awesome", "rap" (is encompassed by "hip.hop"), etc. If an album is live, you can tag it as "live".
- Only tag information on the album itself - NOT THE INDIVIDUAL RELEASE. Tags such as 'v0', 'eac', 'vinyl', 'from.oink' etc. are strictly forbidden. Remember that these tags will be used for other versions of the same album.
+ Only tag information on the album itself—NOT THE INDIVIDUAL RELEASE. Tags such as "v0", "eac", "vinyl", "from.oink", etc. are strictly forbidden. Remember that these tags will be used for other versions of the same album.
You should be able to build up a list of tags using only the official tags to the left of the text box. If you are in any doubt about whether or not a tag is acceptable, do not add it.
diff --git a/classes/class_votes.php b/classes/class_votes.php
index bc270b2e..dc2992fc 100644
--- a/classes/class_votes.php
+++ b/classes/class_votes.php
@@ -10,16 +10,16 @@ public static function vote_link($GroupID, $Vote = '') {
global $LoggedUser;
if (!$LoggedUser['NoVoteLinks'] && check_perms('site_album_votes')) { ?>
- Vote:
- ↑
- ↑
- ↓
- ↓
- x
+ Vote:
+ ↑
+ ↑
+ ↓
+ ↓
+ x
}
}
-
+
/**
* Returns an array with User Vote data: GroupID and vote type
* @global CACHE $Cache
@@ -29,11 +29,11 @@ public static function vote_link($GroupID, $Vote = '') {
*/
public static function get_user_votes($UserID) {
global $DB, $Cache;
-
+
if ((int)$UserID == 0) {
return array();
}
-
+
$UserVotes = $Cache->get_value('voted_albums_'.$UserID);
if ($UserVotes === FALSE) {
$DB->query('SELECT GroupID, Type FROM users_votes WHERE UserID='.$UserID);
@@ -42,7 +42,7 @@ public static function get_user_votes($UserID) {
}
return $UserVotes;
}
-
+
/**
* Returns an array with torrent group vote data
* @global CACHE $Cache
@@ -52,7 +52,7 @@ public static function get_user_votes($UserID) {
*/
public static function get_group_votes($GroupID) {
global $DB, $Cache;
-
+
$GroupVotes = $Cache->get_value('votes_'.$GroupID);
if ($GroupVotes === FALSE) {
$DB->query("SELECT Ups AS Ups, Total AS Total FROM torrents_votes WHERE GroupID=$GroupID");
@@ -65,7 +65,7 @@ public static function get_group_votes($GroupID) {
}
return $GroupVotes;
}
-
+
/**
* Computes the inverse normal CDF of a p-value
* @param float $GroupID
@@ -157,12 +157,12 @@ private function inverse_ncdf($p) {
* @param int $Total Number of total votes
* @return float Ranking score
*/
- public static function binomial_score($Ups, $Total) {
+ public static function binomial_score($Ups, $Total) {
// Confidence level for binomial scoring (p-value .95)
//define(Z_VAL, 1.645211440143815);
// Confidence level for binomial scoring (p-value .90)
define(Z_VAL, 1.281728756502709);
-
+
if (($Total <= 0) || ($Ups < 0)) {
return 0;
}
@@ -187,7 +187,7 @@ public static function get_ranking($GroupID, $Year) {
'year' =>Votes::get_rank_year($GroupID, $Year),
'decade' =>Votes::get_rank_decade($GroupID, $Year));
}
-
+
/**
* Gets where this album ranks overall.
* @global CACHE $Cache
@@ -197,12 +197,12 @@ public static function get_ranking($GroupID, $Year) {
*/
public static function get_rank_all($GroupID) {
global $Cache, $DB;
-
+
$GroupID = (int)$GroupID;
if ($GroupID <= 0) {
return false;
}
-
+
$Rankings = $Cache->get_value('voting_ranks_overall');
if ($Rankings === FALSE) {
$Rankings = array();
@@ -213,10 +213,10 @@ public static function get_rank_all($GroupID) {
}
$Cache->cache_value('voting_ranks_overall', $Rankings);
}
-
+
return isset($Rankings[$GroupID])?$Rankings[$GroupID]:false;
}
-
+
/**
* Gets where this album ranks in its year.
* @global CACHE $Cache
@@ -227,18 +227,18 @@ public static function get_rank_all($GroupID) {
*/
public static function get_rank_year($GroupID, $Year) {
global $Cache, $DB;
-
+
$GroupID = (int)$GroupID;
$Year = (int)$Year;
if ($GroupID <= 0 || $Year <= 0) {
return false;
}
-
+
$Rankings = $Cache->get_value('voting_ranks_year_'.$Year);
if ($Rankings === FALSE) {
$Rankings = array();
$i = 0;
- $DB->query("SELECT GroupID
+ $DB->query("SELECT GroupID
FROM torrents_votes AS v
JOIN torrents_group AS g ON g.ID = v.GroupID
WHERE g.Year = $Year
@@ -248,7 +248,7 @@ public static function get_rank_year($GroupID, $Year) {
}
$Cache->cache_value('voting_ranks_year_'.$Year , $Rankings);
}
-
+
return isset($Rankings[$GroupID])?$Rankings[$GroupID]:false;
}
@@ -262,22 +262,22 @@ public static function get_rank_year($GroupID, $Year) {
*/
public static function get_rank_decade($GroupID, $Year) {
global $Cache, $DB;
-
+
$GroupID = (int)$GroupID;
$Year = (int)$Year;
$Year = (int)$Year;
if ((int)$GroupID <= 0 || (int)$Year <= 0) {
return false;
}
-
+
// First year of the decade
$Year = $Year - ($Year % 10);
-
+
$Rankings = $Cache->get_value('voting_ranks_decade_'.$Year);
if ($Rankings === FALSE) {
$Rankings = array();
$i = 0;
- $DB->query("SELECT GroupID
+ $DB->query("SELECT GroupID
FROM torrents_votes AS v
JOIN torrents_group AS g ON g.ID = v.GroupID
WHERE g.Year BETWEEN $Year AND ".($Year+9)."
@@ -288,8 +288,8 @@ public static function get_rank_decade($GroupID, $Year) {
}
$Cache->cache_value('voting_ranks_decade_'.$Year , $Rankings);
}
-
+
return isset($Rankings[$GroupID])?$Rankings[$GroupID]:false;
}
}
-?>
\ No newline at end of file
+?>
diff --git a/sections/ajax/browse.php b/sections/ajax/browse.php
index dae430fc..efd3f633 100644
--- a/sections/ajax/browse.php
+++ b/sections/ajax/browse.php
@@ -11,7 +11,7 @@ function header_link($SortKey,$DefaultWay="desc") {
if($OrderWay=="desc") { $NewWay="asc"; }
else { $NewWay="desc"; }
} else { $NewWay=$DefaultWay; }
-
+
return "torrents.php?order_way=".$NewWay."&order_by=".$SortKey."&".Format::get_url(array('order_way','order_by'));
}
@@ -113,7 +113,6 @@ function header_link($SortKey,$DefaultWay="desc") {
foreach ($SearchBitrates as $ID=>$Val) {
$SearchBitrates[$ID] = strtolower($Val);
}
-
foreach ($Formats as $ID => $Val) {
$SearchFormats[$ID] = strtolower($Val);
}
@@ -490,12 +489,12 @@ function header_link($SortKey,$DefaultWay="desc") {
if($TorrentCount == 0) {
-$DB->query("SELECT
+$DB->query("SELECT
tags.Name,
((COUNT(tags.Name)-2)*(SUM(tt.PositiveVotes)-SUM(tt.NegativeVotes)))/(tags.Uses*0.8) AS Score
- FROM xbt_snatched AS s
- INNER JOIN torrents AS t ON t.ID=s.fid
- INNER JOIN torrents_group AS g ON t.GroupID=g.ID
+ FROM xbt_snatched AS s
+ INNER JOIN torrents AS t ON t.ID=s.fid
+ INNER JOIN torrents_group AS g ON t.GroupID=g.ID
INNER JOIN torrents_tags AS tt ON tt.GroupID=g.ID
INNER JOIN tags ON tags.ID=tt.TagID
WHERE s.uid='$LoggedUser[ID]'
@@ -557,7 +556,7 @@ function header_link($SortKey,$DefaultWay="desc") {
} else {
$Torrents = array($Result['id'] => $GroupInfo['Torrents'][$Result['id']]);
}
-
+
$TagList = explode(' ',str_replace('_','.',$GroupInfo['TagList']));
$JsonArtists = array();
if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
@@ -590,14 +589,14 @@ function header_link($SortKey,$DefaultWay="desc") {
$LastRemasterRecordLabel = '';
$LastRemasterCatalogueNumber = '';
$LastMedia = '';
-
+
$EditionID = 0;
unset($FirstUnknown);
$JsonTorrents = array();
foreach($Torrents as $TorrentID => $Data) {
// All of the individual torrents in the group
-
+
// If they're using the advanced search and have chosen enabled grouping, we just skip the torrents that don't check out
if (!isset($TorrentIDs[$TorrentID])) {
continue;
@@ -606,7 +605,7 @@ function header_link($SortKey,$DefaultWay="desc") {
if ($Data['Remastered'] && !$Data['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
-
+
if (isset($GroupedCategories[$CategoryID-1])
&& ($Data['RemasterTitle'] != $LastRemasterTitle
|| $Data['RemasterYear'] != $LastRemasterYear
@@ -617,7 +616,7 @@ function header_link($SortKey,$DefaultWay="desc") {
$EditionID++;
if ($Data['Remastered'] && $Data['RemasterYear'] != 0) {
-
+
$RemasterName = $Data['RemasterYear'];
$AddExtra = " - ";
if ($Data['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Data['RemasterRecordLabel']); $AddExtra=' / '; }
@@ -641,7 +640,7 @@ function header_link($SortKey,$DefaultWay="desc") {
$LastRemasterRecordLabel = $Data['RemasterRecordLabel'];
$LastRemasterCatalogueNumber = $Data['RemasterCatalogueNumber'];
$LastMedia = $Data['Media'];
-
+
$JsonTorrents[] = array(
'torrentId' => (int) $TorrentID,
'editionId' => (int) $EditionID,
@@ -671,7 +670,7 @@ function header_link($SortKey,$DefaultWay="desc") {
'hasSnatched' => $Data['IsSnatched']
);
}
-
+
$JsonGroups[] = array(
'groupId' => (int) $GroupID,
'groupName' => $GroupName,
@@ -691,9 +690,9 @@ function header_link($SortKey,$DefaultWay="desc") {
}
else {
// Viewing a type that does not require grouping
-
+
list($TorrentID, $Data) = each($Torrents);
-
+
$JsonGroups[] = array(
'groupId' => (int) $GroupID,
'groupName' => $GroupName,
diff --git a/sections/ajax/torrentgroup.php b/sections/ajax/torrentgroup.php
index 17aaea49..95385c1f 100644
--- a/sections/ajax/torrentgroup.php
+++ b/sections/ajax/torrentgroup.php
@@ -57,6 +57,7 @@
$JsonTorrentList = array();
foreach ($TorrentList as $Torrent) {
+ $Userinfo = Users::user_info($Torrent['UserID']);
$JsonTorrentList[] = array(
'id' => (int) $Torrent['ID'],
'media' => $Torrent['Media'],
@@ -82,7 +83,7 @@
'fileList' => $Torrent['FileList'],
'filePath' => $Torrent['FilePath'],
'userId' => (int) $Torrent['UserID'],
- 'username' => $Torrent['Username']
+ 'username' => $Userinfo['Username']
);
}
diff --git a/sections/artist/download.php b/sections/artist/download.php
index 70226cf1..274af3a3 100644
--- a/sections/artist/download.php
+++ b/sections/artist/download.php
@@ -1,37 +1,36 @@
//TODO: freeleech in ratio hit calculations, in addition to a warning of whats freeleech in the Summary.txt
-/*
-This page is something of a hack so those
-easily scared off by funky solutions, don't
+/*
+This page is something of a hack so those
+easily scared off by funky solutions, don't
touch it! :P
-There is a central problem to this page, it's
+There is a central problem to this page, it's
impossible to order before grouping in SQL, and
-it's slow to run sub queries, so we had to get
+it's slow to run sub queries, so we had to get
creative for this one.
-The solution I settled on abuses the way
-$DB->to_array() works. What we've done, is
+The solution I settled on abuses the way
+$DB->to_array() works. What we've done, is
backwards ordering. The results returned by the
-query have the best one for each GroupID last,
-and while to_array traverses the results, it
+query have the best one for each GroupID last,
+and while to_array traverses the results, it
overwrites the keys and leaves us with only the
-desired result. This does mean however, that
-the SQL has to be done in a somewhat backwards
+desired result. This does mean however, that
+the SQL has to be done in a somewhat backwards
fashion.
-Thats all you get for a disclaimer, just
-remember, this page isn't for the faint of
+Thats all you get for a disclaimer, just
+remember, this page isn't for the faint of
heart. -A9
SQL template:
-SELECT
- CASE
- WHEN t.Format='Ogg Vorbis' THEN 0
- WHEN t.Format='MP3' AND t.Encoding='V0 (VBR)' THEN 1
- WHEN t.Format='MP3' AND t.Encoding='V2 (VBR)' THEN 2
- ELSE 100
- END AS Rank,
+SELECT
+ CASE
+ WHEN t.Format='MP3' AND t.Encoding='V0 (VBR)' THEN 1
+ WHEN t.Format='MP3' AND t.Encoding='V2 (VBR)' THEN 2
+ ELSE 100
+ END AS Rank,
t.GroupID,
t.Media,
t.Format,
@@ -40,7 +39,7 @@
tg.Name,
a.Name,
t.Size
-FROM torrents AS t
+FROM torrents AS t
INNER JOIN torrents_group AS tg ON tg.ID=t.GroupID AND tg.CategoryID='1'
INNER JOIN artists_group AS a ON a.ArtistID=tg.ArtistID AND a.ArtistID='59721'
LEFT JOIN torrents_files AS f ON t.ID=f.TorrentID
@@ -48,10 +47,10 @@
*/
if(
- !isset($_REQUEST['artistid']) ||
- !isset($_REQUEST['preference']) ||
- !is_number($_REQUEST['preference']) ||
- !is_number($_REQUEST['artistid']) ||
+ !isset($_REQUEST['artistid']) ||
+ !isset($_REQUEST['preference']) ||
+ !is_number($_REQUEST['preference']) ||
+ !is_number($_REQUEST['artistid']) ||
$_REQUEST['preference'] > 2 ||
count($_REQUEST['list']) == 0
) { error(0); }
@@ -100,7 +99,6 @@
case '36': $SQL .= "t.Format='FLAC' AND t.Encoding='Lossless' AND HasLog='1'"; break;
case '37': $SQL .= "t.Format='FLAC' AND t.Encoding='Lossless'"; break;
case '40': $SQL .= "t.Format='DTS'"; break;
- case '41': $SQL .= "t.Format='Ogg Vorbis'"; break;
case '42': $SQL .= "t.Format='AAC' AND t.Encoding='320'"; break;
case '43': $SQL .= "t.Format='AAC' AND t.Encoding='256'"; break;
case '44': $SQL .= "t.Format='AAC' AND t.Encoding='q5.5'"; break;
@@ -120,7 +118,7 @@
IF(t.RemasterYear=0,tg.Year,t.RemasterYear),
tg.Name,
t.Size
-FROM torrents AS t
+FROM torrents AS t
JOIN torrents_group AS tg ON tg.ID=t.GroupID AND tg.CategoryID='1' AND tg.ID IN (".implode(',',$GroupIDs).")
ORDER BY t.GroupID ASC, Rank DESC, t.$Preference";
@@ -159,7 +157,7 @@
$Tor = new TORRENT($Contents, true);
$Tor->set_announce_url(ANNOUNCE_URL.'/'.$LoggedUser['torrent_pass'].'/announce');
unset($Tor->Val['announce-list']);
-
+
// We need this section for long file names :/
$TorrentName='';
$TorrentInfo='';
@@ -179,7 +177,7 @@
$TorrentName = Misc::file_string($Album).(($Year>0)?(' - '.Misc::file_string($Year)):'');
}
$FileName = Format::cut_string($TorrentName.$TorrentInfo, 180, true, false);
-
+
$Zip->add_file($Tor->enc(), $ReleaseTypeName.'/'.$FileName.'.torrent');
}
$Analyzed = count($Downloads);
diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php
index 032de971..f70f41ff 100644
--- a/sections/bookmarks/torrents.php
+++ b/sections/bookmarks/torrents.php
@@ -101,7 +101,7 @@ function compare($X, $Y){
=$DisplayName?>
if(!$Sneaky){ ?>
- Unbookmark
+ Unbookmark
} ?>
=time_diff($AddedTime);?>
@@ -220,7 +220,7 @@ function compare($X, $Y){
=$DisplayName?>
=$TorrentTags?>
if(!$Sneaky){ ?>
- Unbookmark
+ Unbookmark
} ?>
=time_diff($AddedTime);?>
diff --git a/sections/collages/add_torrent.php b/sections/collages/add_torrent.php
index 14b389a7..07e711a4 100644
--- a/sections/collages/add_torrent.php
+++ b/sections/collages/add_torrent.php
@@ -50,6 +50,10 @@ function AddTorrent($CollageID, $GroupID) {
if ($MaxGroups > 0 && $NumTorrents >= $MaxGroups) {
$Err = "This collage already holds its maximum allowed number of torrents";
}
+
+ if (isset($Err)) {
+ error($Err);
+ }
}
if ($MaxGroupsPerUser > 0) {
@@ -134,4 +138,4 @@ function AddTorrent($CollageID, $GroupID) {
AddTorrent($CollageID, $GroupID);
}
}
-header('Location: collages.php?id='.$CollageID);
\ No newline at end of file
+header('Location: collages.php?id='.$CollageID);
diff --git a/sections/collages/download.php b/sections/collages/download.php
index 97ffd3d8..780894d3 100644
--- a/sections/collages/download.php
+++ b/sections/collages/download.php
@@ -1,36 +1,35 @@
-/*
-This page is something of a hack so those
-easily scared off by funky solutions, don't
+/*
+This page is something of a hack so those
+easily scared off by funky solutions, don't
touch it! :P
-There is a central problem to this page, it's
+There is a central problem to this page, it's
impossible to order before grouping in SQL, and
-it's slow to run sub queries, so we had to get
+it's slow to run sub queries, so we had to get
creative for this one.
-The solution I settled on abuses the way
-$DB->to_array() works. What we've done, is
+The solution I settled on abuses the way
+$DB->to_array() works. What we've done, is
backwards ordering. The results returned by the
-query have the best one for each GroupID last,
-and while to_array traverses the results, it
+query have the best one for each GroupID last,
+and while to_array traverses the results, it
overwrites the keys and leaves us with only the
-desired result. This does mean however, that
-the SQL has to be done in a somewhat backwards
+desired result. This does mean however, that
+the SQL has to be done in a somewhat backwards
fashion.
-Thats all you get for a disclaimer, just
-remember, this page isn't for the faint of
+Thats all you get for a disclaimer, just
+remember, this page isn't for the faint of
heart. -A9
SQL template:
-SELECT
- CASE
- WHEN t.Format='Ogg Vorbis' THEN 0
- WHEN t.Format='MP3' AND t.Encoding='V0 (VBR)' THEN 1
- WHEN t.Format='MP3' AND t.Encoding='V2 (VBR)' THEN 2
- ELSE 100
- END AS Rank,
+SELECT
+ CASE
+ WHEN t.Format='MP3' AND t.Encoding='V0 (VBR)' THEN 1
+ WHEN t.Format='MP3' AND t.Encoding='V2 (VBR)' THEN 2
+ ELSE 100
+ END AS Rank,
t.GroupID,
t.Media,
t.Format,
@@ -39,7 +38,7 @@
tg.Name,
a.Name,
t.Size
-FROM torrents AS t
+FROM torrents AS t
INNER JOIN collages_torrents AS c ON t.GroupID=c.GroupID AND c.CollageID='8'
INNER JOIN torrents_group AS tg ON tg.ID=t.GroupID AND tg.CategoryID='1'
LEFT JOIN artists_group AS a ON a.ArtistID=tg.ArtistID
@@ -48,10 +47,10 @@
*/
if(
- !isset($_REQUEST['collageid']) ||
- !isset($_REQUEST['preference']) ||
- !is_number($_REQUEST['preference']) ||
- !is_number($_REQUEST['collageid']) ||
+ !isset($_REQUEST['collageid']) ||
+ !isset($_REQUEST['preference']) ||
+ !is_number($_REQUEST['preference']) ||
+ !is_number($_REQUEST['collageid']) ||
$_REQUEST['preference'] > 2 ||
count($_REQUEST['list']) == 0
) { error(0); }
@@ -95,7 +94,6 @@
case '36': $SQL .= "t.Format='FLAC' AND t.Encoding='Lossless' AND HasLog='1'"; break;
case '37': $SQL .= "t.Format='FLAC' AND t.Encoding='Lossless'"; break;
case '40': $SQL .= "t.Format='DTS'"; break;
- case '41': $SQL .= "t.Format='Ogg Vorbis'"; break;
case '42': $SQL .= "t.Format='AAC' AND t.Encoding='320'"; break;
case '43': $SQL .= "t.Format='AAC' AND t.Encoding='256'"; break;
case '44': $SQL .= "t.Format='AAC' AND t.Encoding='q5.5'"; break;
@@ -114,7 +112,7 @@
IF(t.RemasterYear=0,tg.Year,t.RemasterYear),
tg.Name,
t.Size
-FROM torrents AS t
+FROM torrents AS t
INNER JOIN collages_torrents AS c ON t.GroupID=c.GroupID AND c.CollageID='$CollageID'
INNER JOIN torrents_group AS tg ON tg.ID=t.GroupID AND tg.CategoryID='1'
ORDER BY t.GroupID ASC, Rank DESC, t.$Preference";
@@ -148,7 +146,7 @@
$Tor = new TORRENT($Contents, true);
$Tor->set_announce_url(ANNOUNCE_URL.'/'.$LoggedUser['torrent_pass'].'/announce');
unset($Tor->Val['announce-list']);
-
+
// We need this section for long file names :/
$TorrentName='';
$TorrentInfo='';
@@ -169,7 +167,7 @@
}
$FileName = $TorrentName.$TorrentInfo;
$FileName = Format::cut_string($FileName, 192, true, false);
-
+
$Zip->add_file($Tor->enc(), $FileName.'.torrent');
}
$Analyzed = count($Downloads);
diff --git a/sections/forums/search.php b/sections/forums/search.php
index 66eb1b48..42e1a1c6 100644
--- a/sections/forums/search.php
+++ b/sections/forums/search.php
@@ -53,22 +53,26 @@
}
// Searching for posts in a specific thread
-if(!empty($_GET['threadid'])) {
- $ThreadID = db_string($_GET['threadid']);
- $Type='body';
+if (!empty($_GET['threadid']) && is_number($_GET['threadid'])) {
+ $ThreadID = $_GET['threadid'];
+ $Type = 'body';
$SQL = "SELECT Title FROM forums_topics AS t
JOIN forums AS f ON f.ID=t.ForumID
- WHERE f.MinClassRead <= '$LoggedUser[Class]'
- AND t.ID=$ThreadID";
- if(!empty($RestrictedForums)) {
- $SQL .= " AND f.ID NOT IN ('".$RestrictedForums."')";
+ WHERE t.ID=$ThreadID
+ AND ((f.MinClassRead <= '$LoggedUser[Class]'";
+ if (!empty($RestrictedForums)) {
+ $SQL .= " AND f.ID NOT IN ('$RestrictedForums')";
}
+ $SQL .= ")";
+ if (!empty($PermittedForums)) {
+ $SQL .= " OR f.ID IN ('$PermittedForums')";
+ }
+ $SQL .= ")";
$DB->query($SQL);
if (list($Title) = $DB->next_record()) {
$Title = " > $Title";
} else {
- $Title = '';
- $ThreadID = '';
+ error(404);
}
} else {
$ThreadID = '';
diff --git a/sections/requests/request.php b/sections/requests/request.php
index bdd56ace..d6d7f40d 100644
--- a/sections/requests/request.php
+++ b/sections/requests/request.php
@@ -456,26 +456,6 @@
} ?>
-
-//
-if(check_perms("users_mod")) {
-$RequestLog = Requests::get_request_log($RequestID);
- if($RequestLog) {
-?>
-