diff --git a/classes/class_artists.php b/classes/class_artists.php index 5a503c9e..6c720425 100644 --- a/classes/class_artists.php +++ b/classes/class_artists.php @@ -223,7 +223,7 @@ public static function delete_artist($ArtistID) { // Delete requests $DB->query("SELECT RequestID FROM requests_artists WHERE ArtistID=".$ArtistID." AND ArtistID != 0"); $Requests = $DB->to_array(); - foreach($Requests AS $Request) { + foreach ($Requests AS $Request) { list($RequestID) = $Request; $DB->query('DELETE FROM requests WHERE ID='.$RequestID); $DB->query('DELETE FROM requests_votes WHERE RequestID='.$RequestID); diff --git a/classes/class_image_tools.php b/classes/class_image_tools.php index c3f84f4d..a995a0ee 100644 --- a/classes/class_image_tools.php +++ b/classes/class_image_tools.php @@ -162,7 +162,6 @@ public static function proxy_url($Url) { * @return string */ public static function process($Url, $Thumb = false) { - global $LoggedUser; if (empty($Url)) { return ''; } @@ -182,20 +181,11 @@ public static function process($Url, $Thumb = false) { } } - if (isset($LoggedUser['Permissions'])) { - /* - * We only want to apply the proxy and store the processed URL if the - * permissions were loaded before. This is necessary because self::process - * is used in Users::user_info which is called in script_start.php before - * the permissions are loaded, causing the own avatar to always load without - * proxy later on. - */ - if (check_perms('site_proxy_images')) { - $ProcessedUrl = self::proxy_url($ProcessedUrl); - } - - self::store($Url . ($Thumb ? '_thumb' : ''), $ProcessedUrl); + if (check_perms('site_proxy_images')) { + $ProcessedUrl = self::proxy_url($ProcessedUrl); } + + self::store($Url . ($Thumb ? '_thumb' : ''), $ProcessedUrl); return $ProcessedUrl; } diff --git a/classes/class_sphinxqlquery.php b/classes/class_sphinxqlquery.php index 03e2668a..d6e3fc8b 100644 --- a/classes/class_sphinxqlquery.php +++ b/classes/class_sphinxqlquery.php @@ -206,10 +206,10 @@ public function set($Name, $Value) { */ private function build_options() { $Options = array(); - foreach($this->Options as $Option => $Value) { + foreach ($this->Options as $Option => $Value) { $Options[] = "$Option = $Value"; } - return implode(", ", $Options); + return implode(', ', $Options); } /** @@ -221,7 +221,7 @@ private function build_query() { } $this->QueryString = "SELECT $this->Select\nFROM $this->Indexes"; if (!empty($this->Expressions)) { - $this->Filters['expr'] = "MATCH('".implode(" ", $this->Expressions)."')"; + $this->Filters['expr'] = "MATCH('".implode(' ', $this->Expressions)."')"; } if (!empty($this->Filters)) { $this->QueryString .= "\nWHERE ".implode("\n\tAND ", $this->Filters); diff --git a/classes/class_text.php b/classes/class_text.php index 9389a4cf..05300e2f 100644 --- a/classes/class_text.php +++ b/classes/class_text.php @@ -412,7 +412,7 @@ private function parse ($Str) { } // 6) Depending on what type of tag we're dealing with, create an array with the attribute and block. - switch($TagName) { + switch ($TagName) { case 'inlineurl': $Array[$ArrayPos] = array('Type'=>'inlineurl', 'Attr'=>$Block, 'Val'=>''); break; diff --git a/classes/class_text2.php b/classes/class_text2.php index b79ed17b..7dc4bbb7 100644 --- a/classes/class_text2.php +++ b/classes/class_text2.php @@ -362,7 +362,7 @@ function parse($Str) { } // 6) Depending on what type of tag we're dealing with, create an array with the attribute and block. - switch($TagName) { + switch ($TagName) { case 'inlineurl': $Array[$ArrayPos] = array('Type'=>'inlineurl', 'Attr'=>$Block, 'Val'=>''); break; @@ -455,7 +455,7 @@ function to_html($Array) { $Str.=$this->smileys($Block); continue; } - switch($Block['Type']) { + switch ($Block['Type']) { case 'b': $Str.=''.$this->to_html($Block['Val']).''; break; @@ -616,7 +616,7 @@ function raw_text($Array) { $Str.=$Block; continue; } - switch($Block['Type']) { + switch ($Block['Type']) { case 'b': case 'u': diff --git a/classes/class_text3.php b/classes/class_text3.php index ca8abb3b..bbabbb4b 100644 --- a/classes/class_text3.php +++ b/classes/class_text3.php @@ -322,14 +322,14 @@ function parse($Str) { // Find the internal block inside the tag - $Block = substr($Str, $i, $CloseTag-$i); // 5c) Get the contents between [open] and [/close] and call it the block. + $Block = substr($Str, $i, $CloseTag - $i); // 5c) Get the contents between [open] and [/close] and call it the block. - $i = $CloseTag+strlen($TagName)+3; // 5d) Move the pointer past the end of the [/close] tag. + $i = $CloseTag + strlen($TagName) + 3; // 5d) Move the pointer past the end of the [/close] tag. } // 6) Depending on what type of tag we're dealing with, create an array with the attribute and block. - switch($TagName) { + switch ($TagName) { case 'inlineurl': $Array[$ArrayPos] = array('Type'=>'inlineurl', 'Attr'=>$Block, 'Val'=>''); break; @@ -419,7 +419,7 @@ function to_html($Array) { $Str.=$this->smileys($Block); continue; } - switch($Block['Type']) { + switch ($Block['Type']) { case 'b': $Str.=''.$this->to_html($Block['Val']).''; break; @@ -577,7 +577,7 @@ function raw_text($Array) { $Str.=$Block; continue; } - switch($Block['Type']) { + switch ($Block['Type']) { case 'b': case 'u': diff --git a/classes/class_torrents.php b/classes/class_torrents.php index 0ac2ddf6..711ed402 100644 --- a/classes/class_torrents.php +++ b/classes/class_torrents.php @@ -466,12 +466,13 @@ public static function update_hash($GroupID) { */ public static function regenerate_filelist($TorrentID) { global $DB, $Cache; - $DB->query("SELECT tg.ID, + $DB->query(" + SELECT tg.ID, tf.File FROM torrents_files AS tf JOIN torrents AS t ON t.ID=tf.TorrentID JOIN torrents_group AS tg ON tg.ID=t.GroupID - WHERE tf.TorrentID = ".$TorrentID); + WHERE tf.TorrentID = ".$TorrentID); if ($DB->record_count() > 0) { list($GroupID, $Contents) = $DB->next_record(MYSQLI_NUM, false); if (Misc::is_new_torrent($Contents)) { @@ -482,7 +483,7 @@ public static function regenerate_filelist($TorrentID) { $FilePath = isset($Tor->Val['info']->Val['files']) ? Format::make_utf8($Tor->get_name()) : ''; } list($TotalSize, $FileList) = $Tor->file_list(); - foreach($FileList as $File) { + foreach ($FileList as $File) { $TmpFileList[] = self::filelist_format_file($File); } $FileString = implode("\n", $TmpFileList); diff --git a/classes/class_user_rank.php b/classes/class_user_rank.php index cacfa6dc..fc4869f8 100644 --- a/classes/class_user_rank.php +++ b/classes/class_user_rank.php @@ -25,13 +25,13 @@ function build_table($MemKey, $Query) { $Table = $DB->to_array(); // Give a little variation to the cache length, so all the tables don't expire at the same time - $Cache->cache_value($MemKey, $Table, 3600*24*rand(800,1000)*0.001); + $Cache->cache_value($MemKey, $Table, 3600 * 24 * rand(800, 1000) * 0.001); return $Table; } function table_query($TableName) { - switch($TableName) { + switch ($TableName) { case 'uploaded': $Query = "SELECT Uploaded FROM users_main WHERE Enabled='1' AND Uploaded>0 ORDER BY Uploaded;"; break; @@ -98,14 +98,14 @@ function overall_score($Uploaded, $Downloaded, $Uploads, $Requests, $Posts, $Bou if (in_array(false, func_get_args(), true)) { return false; } - $TotalScore += $Uploaded*15; - $TotalScore += $Downloaded*8; - $TotalScore += $Uploads*25; - $TotalScore += $Requests*2; + $TotalScore += $Uploaded * 15; + $TotalScore += $Downloaded * 8; + $TotalScore += $Uploads * 25; + $TotalScore += $Requests * 2; $TotalScore += $Posts; $TotalScore += $Bounty; $TotalScore += $Artists; - $TotalScore /= (15+8+25+2+1+1+1); + $TotalScore /= (15 + 8 + 25 + 2 + 1 + 1 + 1); $TotalScore *= $Ratio; return $TotalScore; } diff --git a/classes/class_users.php b/classes/class_users.php index daba2765..cd79a949 100644 --- a/classes/class_users.php +++ b/classes/class_users.php @@ -103,8 +103,6 @@ public static function user_info($UserID) { $Cache->cache_value('user_info_'.$UserID, $UserInfo, 2592000); } - // Image proxy - $UserInfo['Avatar'] = ImageTools::process($UserInfo['Avatar']); return $UserInfo; } @@ -542,6 +540,7 @@ public static function get_bookmarks ($UserID) */ public static function show_avatar($Avatar, $Username, $Setting, $Size=150, $ReturnHTML = True) { global $LoggedUser; + $Avatar = ImageTools::process($Avatar); // case 1 is avatars disabled switch ($Setting) { case 0: diff --git a/sections/ajax/better/index.php b/sections/ajax/better/index.php index ecb78a25..0e550929 100644 --- a/sections/ajax/better/index.php +++ b/sections/ajax/better/index.php @@ -2,8 +2,8 @@ //Include all the basic stuff... enforce_login(); -if(isset($_GET['method'])) { - switch($_GET['method']) { +if (isset($_GET['method'])) { + switch ($_GET['method']) { case 'transcode': include(SERVER_ROOT.'/sections/ajax/better/transcode.php'); break; diff --git a/sections/ajax/forum/index.php b/sections/ajax/forum/index.php index 5249d35d..cdfddf4b 100644 --- a/sections/ajax/forum/index.php +++ b/sections/ajax/forum/index.php @@ -61,7 +61,7 @@ if(empty($_GET['type']) || $_GET['type'] == 'main') { include(SERVER_ROOT.'/sections/ajax/forum/main.php'); } else { - switch($_GET['type']) { + switch ($_GET['type']) { case 'viewforum': include(SERVER_ROOT.'/sections/ajax/forum/forum.php'); break; diff --git a/sections/ajax/requests.php b/sections/ajax/requests.php index d445f5dc..c5ab310b 100644 --- a/sections/ajax/requests.php +++ b/sections/ajax/requests.php @@ -21,7 +21,7 @@ $SS->set_filter('visible', array(1)); } } else { - switch($_GET['type']) { + switch ($_GET['type']) { case 'created': $Title = 'My requests'; $SS->set_filter('userid', array($LoggedUser['ID'])); @@ -231,27 +231,27 @@ } } -switch($CurrentOrder) { +switch ($CurrentOrder) { case 'votes' : - $OrderBy = "Votes"; + $OrderBy = 'Votes'; break; case 'bounty' : - $OrderBy = "Bounty"; + $OrderBy = 'Bounty'; break; case 'created' : - $OrderBy = "TimeAdded"; + $OrderBy = 'TimeAdded'; break; case 'lastvote' : - $OrderBy = "LastVote"; + $OrderBy = 'LastVote'; break; case 'filled' : - $OrderBy = "TimeFilled"; + $OrderBy = 'TimeFilled'; break; case 'year' : - $OrderBy = "Year"; + $OrderBy = 'Year'; break; default : - $OrderBy = "TimeAdded"; + $OrderBy = 'TimeAdded'; break; } //print($Way); print($OrderBy); die(); diff --git a/sections/ajax/top10/index.php b/sections/ajax/top10/index.php index 49ade612..b7d3f63c 100644 --- a/sections/ajax/top10/index.php +++ b/sections/ajax/top10/index.php @@ -2,16 +2,16 @@ // Already done in /sections/ajax/index.php //enforce_login(); -if(!check_perms('site_top10')){ +if (!check_perms('site_top10')){ print json_encode(array('status' => 'failure')); die(); } -if(empty($_GET['type']) || $_GET['type'] == 'torrents') { +if (empty($_GET['type']) || $_GET['type'] == 'torrents') { include(SERVER_ROOT.'/sections/ajax/top10/torrents.php'); } else { - switch($_GET['type']) { + switch ($_GET['type']) { case 'users' : include(SERVER_ROOT.'/sections/ajax/top10/users.php'); break; diff --git a/sections/artist/artist.php b/sections/artist/artist.php index 0a03f502..6a0013dc 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -211,7 +211,7 @@ function compare($X, $Y) {
- + - - +next_record()) { +while (list($PeerUserID, $Size, $Active, $Connectable, $Uploaded, $Remaining, $UserAgent) = $DB->next_record()) { ?> - - + + - +
+ #
- - <?=$UserInfo['Username']?>'s avatar - - Default avatar - + diff --git a/sections/donate/index.php b/sections/donate/index.php index bb7c5cb5..ecb804bc 100644 --- a/sections/donate/index.php +++ b/sections/donate/index.php @@ -5,8 +5,8 @@ if (!isset($_REQUEST['action'])) { include(SERVER_ROOT.'/sections/donate/donate.php'); } else { - switch($_REQUEST['action']) { - case 'ipn': // Paypal hits this page when a donation is received + switch ($_REQUEST['action']) { + case 'ipn': // PayPal hits this page when a donation is received include(SERVER_ROOT.'/sections/donate/ipn.php'); break; diff --git a/sections/forums/ajax_get_edit.php b/sections/forums/ajax_get_edit.php index 23249268..7ac0af25 100644 --- a/sections/forums/ajax_get_edit.php +++ b/sections/forums/ajax_get_edit.php @@ -1,21 +1,21 @@ get_value($Type.'_edits_'.$PostID); -if(!is_array($Edits)) { +if (!is_array($Edits)) { $DB->query("SELECT ce.EditUser, ce.EditTime, ce.Body FROM comments_edits AS ce WHERE Page = '".$Type."' AND PostID = ".$PostID." @@ -34,11 +34,11 @@ } list($UserID, $Time) = $Edits[$Depth]; -if($Depth != 0) { +if ($Depth != 0) { list(,,$Body) = $Edits[$Depth - 1]; } else { //Not an edit, have to get from the original - switch($Type) { + switch ($Type) { case 'forums' : //Get from normal forum stuffs $DB->query("SELECT Body @@ -63,7 +63,7 @@

- + « @@ -71,7 +71,7 @@ Original Post 0) { ?> +if ($Depth > 0) { ?> » diff --git a/sections/forums/newthread.php b/sections/forums/newthread.php index cb690452..db4efb51 100644 --- a/sections/forums/newthread.php +++ b/sections/forums/newthread.php @@ -46,13 +46,13 @@ - + - + + diff --git a/sections/friends/friends.php b/sections/friends/friends.php index a4f2119c..daaedb4d 100644 --- a/sections/friends/friends.php +++ b/sections/friends/friends.php @@ -72,7 +72,7 @@
+ #XXXXXX by Just now @@ -65,13 +65,11 @@
- - <?=$LoggedUser['Username']?>'s avatar - - Default avatar - +
- - + - +
+  Ratio: @@ -90,20 +90,15 @@
- - <?=$Username?>'s avatar - - Default avatar - + + + - +
diff --git a/sections/inbox/index.php b/sections/inbox/index.php index b07e2566..4cde1720 100644 --- a/sections/inbox/index.php +++ b/sections/inbox/index.php @@ -1,21 +1,24 @@ get_value("staff_ids"); -if(!is_array($StaffIDs)) { - $DB->query("SELECT m.ID, m.Username +$StaffIDs = $Cache->get_value('staff_ids'); +if (!is_array($StaffIDs)) { + $DB->query(" + SELECT m.ID, m.Username FROM users_main AS m - JOIN permissions AS p ON p.ID=m.PermissionID + JOIN permissions AS p ON p.ID=m.PermissionID WHERE p.DisplayStaff='1'"); - while(list($StaffID, $StaffName) = $DB->next_record()) { + while (list($StaffID, $StaffName) = $DB->next_record()) { $StaffIDs[$StaffID] = $StaffName; } uasort($StaffIDs, 'strcasecmp'); - $Cache->cache_value("staff_ids", $StaffIDs); + $Cache->cache_value('staff_ids', $StaffIDs); } -if(!isset($_REQUEST['action'])) { $_REQUEST['action'] = ''; } -switch($_REQUEST['action']) { +if (!isset($_REQUEST['action'])) { + $_REQUEST['action'] = ''; +} +switch ($_REQUEST['action']) { case 'takecompose': require('takecompose.php'); break; diff --git a/sections/reports/compose.php b/sections/reports/compose.php index 1e475721..a512a7ce 100644 --- a/sections/reports/compose.php +++ b/sections/reports/compose.php @@ -1,17 +1,17 @@ query("SELECT Username FROM users_main WHERE ID='$ToID'"); list($ComposeToUsername) = $DB->next_record(); -if(!$ComposeToUsername) { +if (!$ComposeToUsername) { error(404); } View::show_header('Compose', 'inbox,bbcode'); // $TypeLink is placed directly in the
- +
Torrent group leech status @@ -115,7 +121,7 @@ because @@ -128,7 +134,7 @@

Rename (won't merge)

diff --git a/sections/torrents/editgroupid.php b/sections/torrents/editgroupid.php index b7a7c016..07ff4da4 100644 --- a/sections/torrents/editgroupid.php +++ b/sections/torrents/editgroupid.php @@ -5,24 +5,26 @@ * torrent. ****************************************************************/ -if(!check_perms('torrents_edit')) { error(403); } +if (!check_perms('torrents_edit')) { + error(403); +} $OldGroupID = $_POST['oldgroupid']; $GroupID = $_POST['groupid']; $TorrentID = $_POST['torrentid']; -if(!is_number($OldGroupID) || !is_number($GroupID) || !is_number($TorrentID) || !$OldGroupID || !$GroupID || !$TorrentID) { +if (!is_number($OldGroupID) || !is_number($GroupID) || !is_number($TorrentID) || !$OldGroupID || !$GroupID || !$TorrentID) { error(0); } -if($OldGroupID == $GroupID) { +if ($OldGroupID == $GroupID) { header('Location: '.$_SERVER['HTTP_REFERER']); die(); } //Everything is legit, let's just confim they're not retarded -if(empty($_POST['confirm'])) { +if (empty($_POST['confirm'])) { $DB->query("SELECT Name FROM torrents_group WHERE ID = ".$OldGroupID); - if($DB->record_count() < 1) { + if ($DB->record_count() < 1) { //Trying to move to an empty group? I think not! set_message("That group doesn't exist!"); header('Location: '.$_SERVER['HTTP_REFERER']); @@ -31,7 +33,7 @@ list($Name) = $DB->next_record(); $DB->query("SELECT CategoryID, Name FROM torrents_group WHERE ID = ".$GroupID); list($CategoryID, $NewName) = $DB->next_record(); - if($Categories[$CategoryID-1] != 'Music') { + if ($Categories[$CategoryID-1] != 'Music') { error('Target must be a music group.'); } @@ -71,7 +73,7 @@ // Delete old torrent group if it's empty now $DB->query("SELECT COUNT(ID) FROM torrents WHERE GroupID='$OldGroupID'"); list($TorrentsInGroup) = $DB->next_record(); - if($TorrentsInGroup == 0) { + if ($TorrentsInGroup == 0) { $DB->query("UPDATE torrents_comments SET GroupID='$GroupID' WHERE GroupID='$OldGroupID'"); $Cache->delete_value('torrent_comments_'.$GroupID.'_catalogue_0'); $Cache->delete_value('torrent_comments_'.$GroupID); @@ -90,4 +92,4 @@ header("Location: torrents.php?id=$GroupID"); } -?> \ No newline at end of file +?> diff --git a/sections/torrents/history.php b/sections/torrents/history.php index 6a73f6be..12eb1648 100644 --- a/sections/torrents/history.php +++ b/sections/torrents/history.php @@ -11,11 +11,10 @@ ************************************************************************/ - - - $GroupID = $_GET['groupid']; -if(!is_number($GroupID) || !$GroupID) { error(0); } +if (!is_number($GroupID) || !$GroupID) { + error(0); +} include(SERVER_ROOT.'/classes/class_wiki.php'); // Wiki class $Wiki = new WIKI('wiki_torrents', $GroupID, "/torrents.php?id=$GroupID"); @@ -24,7 +23,9 @@ $DB->query("SELECT Name FROM torrents_group WHERE ID='$GroupID'"); list($Name) = $DB->next_record(); -if(!$Name) { error(404); } +if (!$Name) { + error(404); +} View::show_header("Revision history for $Name"); // Set title diff --git a/sections/torrents/manage_artists.php b/sections/torrents/manage_artists.php index 92080882..6e2292e1 100644 --- a/sections/torrents/manage_artists.php +++ b/sections/torrents/manage_artists.php @@ -1,8 +1,8 @@ $Artist) { +foreach ($Artists as $i => $Artist) { list($Importance, $ArtistID) = explode(';',$Artist); - if(is_number($ArtistID) && is_number($Importance)) { + if (is_number($ArtistID) && is_number($Importance)) { $CleanArtists[] = array($Importance, $ArtistID); $ArtistIDs[] = $ArtistID; } } -if(count($CleanArtists) > 0) { +if (count($CleanArtists) > 0) { $ArtistsString = implode(',', $ArtistIDs);; - if($_POST['manager_action'] == 'delete') { + if ($_POST['manager_action'] == 'delete') { $DB->query("SELECT Name FROM torrents_group WHERE ID = '".$_POST['groupid']."'"); list($GroupName) = $DB->next_record(); $DB->query("SELECT ArtistID, Name FROM artists_group WHERE ArtistID IN (".$ArtistsString.")"); @@ -35,15 +35,17 @@ $DB->query("DELETE FROM torrents_artists WHERE GroupID = '$GroupID' AND ArtistID = '$ArtistID' AND Importance = '$Importance'"); $Cache->delete_value('artist_groups_'.$ArtistID); } - $DB->query("SELECT ArtistID - FROM requests_artists - WHERE ArtistID IN (".$ArtistsString.") - UNION SELECT ArtistID - FROM torrents_artists - WHERE ArtistID IN (".$ArtistsString.")"); + $DB->query(" + SELECT ArtistID + FROM requests_artists + WHERE ArtistID IN (".$ArtistsString.") + UNION + SELECT ArtistID + FROM torrents_artists + WHERE ArtistID IN (".$ArtistsString.")"); $Items = $DB->collect('ArtistID'); $EmptyArtists = array_diff($ArtistIDs, $Items); - foreach($EmptyArtists as $ArtistID) { + foreach ($EmptyArtists as $ArtistID) { Artists::delete_artist($ArtistID); } } else { diff --git a/sections/torrents/masspm.php b/sections/torrents/masspm.php index d0c63dce..b0ab27cd 100644 --- a/sections/torrents/masspm.php +++ b/sections/torrents/masspm.php @@ -1,9 +1,12 @@ query("SELECT +$DB->query(" + SELECT t.Media, t.Format, t.Encoding AS Bitrate, @@ -23,18 +26,20 @@ t.GroupID, t.UserID, t.FreeTorrent - FROM torrents AS t + FROM torrents AS t JOIN torrents_group AS tg ON tg.ID=t.GroupID LEFT JOIN artists_group AS ag ON ag.ArtistID=tg.ArtistID - WHERE t.ID='$TorrentID'"); + WHERE t.ID='$TorrentID'"); list($Properties) = $DB->to_array(false,MYSQLI_BOTH); -if(!$Properties) { error(404); } +if (!$Properties) { + error(404); +} View::show_header('Edit torrent', 'upload'); -if(!check_perms('site_moderate_requests')) { +if (!check_perms('site_moderate_requests')) { error(403); } @@ -69,4 +74,4 @@
- \ No newline at end of file + diff --git a/sections/torrents/merge.php b/sections/torrents/merge.php index 3ccbe45d..cd2e2696 100644 --- a/sections/torrents/merge.php +++ b/sections/torrents/merge.php @@ -1,21 +1,27 @@ query("SELECT CategoryID, Name FROM torrents_group WHERE ID='$NewGroupID'"); -if($DB->record_count()==0) { +if ($DB->record_count() == 0) { error('Target group does not exist.'); } list($CategoryID, $NewName) = $DB->next_record(); -if($Categories[$CategoryID-1] != 'Music') { +if ($Categories[$CategoryID - 1] != 'Music') { error('Only music groups can be merged.'); } @@ -23,7 +29,7 @@ list($Name) = $DB->next_record(); //Everything is legit, let's just confim they're not retarded -if(empty($_POST['confirm'])) { +if (empty($_POST['confirm'])) { $Artists = Artists::get_artists(array($GroupID, $NewGroupID)); View::show_header(); diff --git a/sections/torrents/nonwikiedit.php b/sections/torrents/nonwikiedit.php index 28fe34a4..99789005 100644 --- a/sections/torrents/nonwikiedit.php +++ b/sections/torrents/nonwikiedit.php @@ -3,30 +3,30 @@ authorize(); //Set by system -if(!$_POST['groupid'] || !is_number($_POST['groupid'])) { +if (!$_POST['groupid'] || !is_number($_POST['groupid'])) { error(404); } $GroupID = $_POST['groupid']; //Usual perm checks -if(!check_perms('torrents_edit')) { +if (!check_perms('torrents_edit')) { $DB->query("SELECT UserID FROM torrents WHERE GroupID = ".$GroupID); - if(!in_array($LoggedUser['ID'], $DB->collect('UserID'))) { + if (!in_array($LoggedUser['ID'], $DB->collect('UserID'))) { error(403); } } -if(check_perms('torrents_freeleech') && (isset($_POST['freeleech']) xor isset($_POST['neutralleech']) xor isset($_POST['unfreeleech']))) { - if(isset($_POST['freeleech'])) { +if (check_perms('torrents_freeleech') && (isset($_POST['freeleech']) xor isset($_POST['neutralleech']) xor isset($_POST['unfreeleech']))) { + if (isset($_POST['freeleech'])) { $Free = 1; - } elseif(isset($_POST['neutralleech'])) { + } elseif (isset($_POST['neutralleech'])) { $Free = 2; } else { $Free = 0; } - if(isset($_POST['freeleechtype']) && in_array($_POST['freeleechtype'], array(0,1,2,3))) { + if (isset($_POST['freeleechtype']) && in_array($_POST['freeleechtype'], array(0,1,2,3))) { $FreeType = $_POST['freeleechtype']; } else { error(404); diff --git a/sections/torrents/notify.php b/sections/torrents/notify.php index 4f918256..b9853a67 100644 --- a/sections/torrents/notify.php +++ b/sections/torrents/notify.php @@ -135,7 +135,7 @@ function header_link($SortKey, $DefaultWay = "desc") {

Latest notifications

Client
Yes' : 'No' ?>Yes' : 'No' ?>Yes' : 'No' ?>Yes' : 'No' ?>
-100) { ?> + 100) { ?> diff --git a/sections/torrents/rename.php b/sections/torrents/rename.php index 3e803d03..5f9d51b4 100644 --- a/sections/torrents/rename.php +++ b/sections/torrents/rename.php @@ -5,13 +5,17 @@ $OldGroupID = $GroupID; $NewName = $_POST['name']; -if(!$GroupID || !is_number($GroupID)) { error(404); } - -if(empty($NewName)) { - error("Albums can't have no name"); +if (!$GroupID || !is_number($GroupID)) { + error(404); } -if(!check_perms('torrents_edit')) { error(403); } +if (empty($NewName)) { + error('Albums must have a name'); +} + +if (!check_perms('torrents_edit')) { + error(403); +} $DB->query("SELECT Name FROM torrents_group WHERE ID = ".$GroupID); list($OldName) = $DB->next_record(MYSQLI_NUM, false); diff --git a/sections/torrents/reseed.php b/sections/torrents/reseed.php index 060a3d02..2af53085 100644 --- a/sections/torrents/reseed.php +++ b/sections/torrents/reseed.php @@ -27,9 +27,9 @@ $Name .= $GroupName; $DB->query("SELECT uid, tstamp FROM xbt_snatched WHERE fid='$TorrentID' ORDER BY tstamp DESC LIMIT 10"); -if($DB->record_count()>0) { +if ($DB->record_count() > 0) { $Users = $DB->to_array(); - foreach($Users as $User) { + foreach ($Users as $User) { $UserID = $User['uid']; $DB->query("SELECT UserID FROM top_snatchers WHERE UserID='$UserID'"); diff --git a/sections/torrents/snatchlist.php b/sections/torrents/snatchlist.php index d38e3331..6dfb5f98 100644 --- a/sections/torrents/snatchlist.php +++ b/sections/torrents/snatchlist.php @@ -1,22 +1,25 @@ query("SELECT SQL_CALC_FOUND_ROWS - xs.uid, - xs.tstamp - FROM xbt_snatched AS xs - WHERE xs.fid='$TorrentID' - ORDER BY xs.tstamp DESC - LIMIT $Limit"); +$Result = $DB->query(" + SELECT SQL_CALC_FOUND_ROWS + xs.uid, + xs.tstamp + FROM xbt_snatched AS xs + WHERE xs.fid='$TorrentID' + ORDER BY xs.tstamp DESC + LIMIT $Limit"); $Results = $DB->to_array('uid', MYSQLI_ASSOC); $DB->query("SELECT FOUND_ROWS()"); @@ -25,7 +28,7 @@ ?>

List of Snatchers

-100) { ?> + 100) { ?> @@ -41,10 +44,10 @@ $Data) { +foreach ($Results as $ID=>$Data) { list($SnatcherID, $Timestamp) = array_values($Data); - if($i % 2 == 0 && $i>0) { + if ($i % 2 == 0 && $i > 0) { ?> @@ -59,6 +62,6 @@ ?> -100) { ?> + 100) { ?> diff --git a/sections/torrents/takedelete.php b/sections/torrents/takedelete.php index 5502dfb7..a08ae6d8 100644 --- a/sections/torrents/takedelete.php +++ b/sections/torrents/takedelete.php @@ -2,7 +2,9 @@ authorize(); $TorrentID = $_POST['torrentid']; -if(!$TorrentID || !is_number($TorrentID)) { error(404); } +if (!$TorrentID || !is_number($TorrentID)) { + error(404); +} $DB->query("SELECT t.UserID, @@ -20,16 +22,16 @@ WHERE t.ID='$TorrentID'"); list($UserID, $GroupID, $Size, $InfoHash, $Name, $ArtistName, $Time, $Snatches) = $DB->next_record(MYSQLI_NUM, false); -if(($LoggedUser['ID']!=$UserID || time_ago($Time) > 3600*24*7 || $Snatches > 4) && !check_perms('torrents_delete')) { +if (($LoggedUser['ID'] != $UserID || time_ago($Time) > 3600 * 24 * 7 || $Snatches > 4) && !check_perms('torrents_delete')) { error(403); } -if($ArtistName) { +if ($ArtistName) { $Name = $ArtistName.' - '.$Name; } -if(isset($_SESSION['logged_user']['multi_delete'])) { - if($_SESSION['logged_user']['multi_delete']>=3 && !check_perms('torrents_delete_fast')) { +if (isset($_SESSION['logged_user']['multi_delete'])) { + if ($_SESSION['logged_user']['multi_delete'] >= 3 && !check_perms('torrents_delete_fast')) { error('You have recently deleted 3 torrents, please contact a staff member if you need to delete more.'); } $_SESSION['logged_user']['multi_delete']++; @@ -39,8 +41,8 @@ $InfoHash = unpack("H*", $InfoHash); Torrents::delete_torrent($TorrentID, $GroupID); -Misc::write_log('Torrent '.$TorrentID.' ('.$Name.') ('.number_format($Size/(1024*1024), 2).' MB) ('.strtoupper($InfoHash[1]).') was deleted by '.$LoggedUser['Username'].': ' .$_POST['reason'].' '.$_POST['extra']); -Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "deleted torrent (".number_format($Size/(1024*1024), 2)." MB, ".strtoupper($InfoHash[1]).") for reason: ".$_POST['reason']." ".$_POST['extra'], 0); +Misc::write_log('Torrent '.$TorrentID.' ('.$Name.') ('.number_format($Size / (1024 * 1024), 2).' MB) ('.strtoupper($InfoHash[1]).') was deleted by '.$LoggedUser['Username'].': ' .$_POST['reason'].' '.$_POST['extra']); +Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "deleted torrent (".number_format($Size / (1024 * 1024), 2)." MB, ".strtoupper($InfoHash[1]).") for reason: ".$_POST['reason']." ".$_POST['extra'], 0); View::show_header('Torrent deleted'); ?> diff --git a/sections/torrents/takegroupedit.php b/sections/torrents/takegroupedit.php index 546b3de8..46f79b87 100644 --- a/sections/torrents/takegroupedit.php +++ b/sections/torrents/takegroupedit.php @@ -6,12 +6,14 @@ $Text = new TEXT; // Quick SQL injection check -if(!$_REQUEST['groupid'] || !is_number($_REQUEST['groupid'])) { +if (!$_REQUEST['groupid'] || !is_number($_REQUEST['groupid'])) { error(404); } // End injection check -if(!check_perms('site_edit_wiki')) { error(403); } +if (!check_perms('site_edit_wiki')) { + error(403); +} // Variables for database input $UserID = $LoggedUser['ID']; @@ -23,12 +25,14 @@ error(404); } -if(!empty($_GET['action']) && $_GET['action'] == 'revert') { // if we're reverting to a previous revision +if (!empty($_GET['action']) && $_GET['action'] == 'revert') { // if we're reverting to a previous revision $RevisionID=$_GET['revisionid']; - if(!is_number($RevisionID)) { error(0); } + if (!is_number($RevisionID)) { + error(0); + } // to cite from merge: "Everything is legit, let's just confim they're not retarded" - if(empty($_GET['confirm'])) { + if (empty($_GET['confirm'])) { View::show_header(); ?>
@@ -61,18 +65,18 @@ $VanityHouse = $OldVH; } - if(($GroupInfo = $Cache->get_value('torrents_details_'.$GroupID)) && !isset($GroupInfo[0][0])) { + if (($GroupInfo = $Cache->get_value('torrents_details_'.$GroupID)) && !isset($GroupInfo[0][0])) { $GroupCategoryID = $GroupInfo[0]['CategoryID']; } else { $DB->query("SELECT CategoryID FROM torrents_group WHERE ID='$GroupID'"); list($GroupCategoryID) = $DB->next_record(); } - if($GroupCategoryID == 1 && !isset($ReleaseTypes[$ReleaseType]) || $GroupCategoryID != 1 && $ReleaseType) { + if ($GroupCategoryID == 1 && !isset($ReleaseTypes[$ReleaseType]) || $GroupCategoryID != 1 && $ReleaseType) { error(403); } // Trickery - if(!preg_match("/^".IMAGE_REGEX."$/i", $Image)) { + if (!preg_match("/^".IMAGE_REGEX."$/i", $Image)) { $Image = ''; } ImageTools::blacklisted($Image); @@ -80,7 +84,7 @@ } // Insert revision -if(empty($RevisionID)) { // edit +if (empty($RevisionID)) { // edit $DB->query("INSERT INTO wiki_torrents (PageID, Body, Image, UserID, Summary, Time) VALUES ('$GroupID', '".db_string($Body)."', '".db_string($Image)."', '$UserID', '$Summary', '".sqltime()."')"); @@ -90,7 +94,9 @@ else { // revert $DB->query("SELECT PageID,Body,Image FROM wiki_torrents WHERE RevisionID='$RevisionID'"); list($PossibleGroupID, $Body, $Image) = $DB->next_record(); - if($PossibleGroupID != $GroupID) { error(404); } + if ($PossibleGroupID != $GroupID) { + error(404); + } $DB->query("INSERT INTO wiki_torrents (PageID, Body, Image, UserID, Summary, Time) SELECT '$GroupID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', '".sqltime()."' @@ -105,7 +111,7 @@ // Update torrents table (technically, we don't need the RevisionID column, but we can use it for a join which is nice and fast) $DB->query("UPDATE torrents_group SET RevisionID='$RevisionID', - ".((isset($VanityHouse)) ? "VanityHouse='$VanityHouse'," : "")." + ".((isset($VanityHouse)) ? "VanityHouse='$VanityHouse'," : '')." WikiBody='$Body', WikiImage='$Image' WHERE ID='$GroupID'"); @@ -119,7 +125,7 @@ $Cache->delete_value('torrents_details_'.$GroupID); $DB->query("SELECT CollageID FROM collages_torrents WHERE GroupID='$GroupID'"); -if($DB->record_count()>0) { +if ($DB->record_count() > 0) { while(list($CollageID) = $DB->next_record()) { $Cache->delete_value('collage_'.$CollageID); } @@ -132,12 +138,12 @@ WHERE tg.ID = $GroupID"); $UserIDs = $DB->collect('UserID'); -foreach($UserIDs as $UserID) { +foreach ($UserIDs as $UserID) { $RecentUploads = $Cache->get_value('recent_uploads_'.$UserID); - if(is_array($RecentUploads)) { - foreach($RecentUploads as $Key => $Recent) { - if($Recent['ID'] == $GroupID) { - if($Recent['WikiImage'] != $Image) { + if (is_array($RecentUploads)) { + foreach ($RecentUploads as $Key => $Recent) { + if ($Recent['ID'] == $GroupID) { + if ($Recent['WikiImage'] != $Image) { $Recent['WikiImage'] = $Image; $Cache->begin_transaction('recent_uploads_'.$UserID); $Cache->update_row($Key, $Recent); @@ -149,16 +155,16 @@ } $DB->query("SELECT ID FROM torrents WHERE GroupID = ".$GroupID); -if($DB->record_count()) { - $TorrentIDs = implode(",", $DB->collect('ID')); +if ($DB->record_count()) { + $TorrentIDs = implode(',', $DB->collect('ID')); $DB->query("SELECT DISTINCT uid FROM xbt_snatched WHERE fid IN (".$TorrentIDs.")"); $Snatchers = $DB->collect('uid'); - foreach($Snatchers as $UserID) { + foreach ($Snatchers as $UserID) { $RecentSnatches = $Cache->get_value('recent_snatches_'.$UserID); - if(is_array($RecentSnatches)) { - foreach($RecentSnatches as $Key => $Recent) { - if($Recent['ID'] == $GroupID) { - if($Recent['WikiImage'] != $Image) { + if (is_array($RecentSnatches)) { + foreach ($RecentSnatches as $Key => $Recent) { + if ($Recent['ID'] == $GroupID) { + if ($Recent['WikiImage'] != $Image) { $Recent['WikiImage'] = $Image; $Cache->begin_transaction('recent_snatches_'.$UserID); $Cache->update_row($Key, $Recent); diff --git a/sections/torrents/takenewgroup.php b/sections/torrents/takenewgroup.php index d8a8f1e7..3835be11 100644 --- a/sections/torrents/takenewgroup.php +++ b/sections/torrents/takenewgroup.php @@ -6,7 +6,9 @@ authorize(); -if(!check_perms('torrents_edit')) { error(403); } +if (!check_perms('torrents_edit')) { + error(403); +} $OldGroupID = $_POST['oldgroupid']; $TorrentID = $_POST['torrentid']; @@ -15,12 +17,12 @@ $Year = trim($_POST['year']); $SearchText = db_string(trim($_POST['artist']) . ' ' . trim($_POST['title']) . ' ' . trim($_POST['year'])); -if(!is_number($OldGroupID) || !is_number($TorrentID) || !is_number($Year) || !$OldGroupID || !$TorrentID || !$Year || empty($Title) || empty($ArtistName)) { +if (!is_number($OldGroupID) || !is_number($TorrentID) || !is_number($Year) || !$OldGroupID || !$TorrentID || !$Year || empty($Title) || empty($ArtistName)) { error(0); } //Everything is legit, let's just confim they're not retarded -if(empty($_POST['confirm'])) { +if (empty($_POST['confirm'])) { View::show_header(); ?>
@@ -47,7 +49,7 @@ View::show_footer(); } else { $DB->query("SELECT ArtistID, AliasID, Redirect, Name FROM artists_alias WHERE Name = '$ArtistName'"); - if($DB->record_count() == 0) { + if ($DB->record_count() == 0) { $Redirect = 0; $DB->query("INSERT INTO artists_group (Name) VALUES ('$ArtistName')"); $ArtistID = $DB->inserted_id(); @@ -55,7 +57,7 @@ $AliasID = $DB->inserted_id(); } else { list($ArtistID, $AliasID, $Redirect, $ArtistName) = $DB->next_record(); - if($Redirect) { + if ($Redirect) { $AliasID = $Redirect; } } @@ -76,7 +78,7 @@ // Delete old group if needed $DB->query("SELECT ID FROM torrents WHERE GroupID='$OldGroupID'"); - if($DB->record_count() == 0) { + if ($DB->record_count() == 0) { Torrents::delete_group($OldGroupID); } else { Torrents::update_hash($OldGroupID); diff --git a/sections/torrents/vote_tag.php b/sections/torrents/vote_tag.php index 43516886..66181b61 100644 --- a/sections/torrents/vote_tag.php +++ b/sections/torrents/vote_tag.php @@ -4,16 +4,16 @@ $GroupID = db_string($_GET['groupid']); $Way = db_string($_GET['way']); -if(!is_number($TagID) || !is_number($GroupID)) { +if (!is_number($TagID) || !is_number($GroupID)) { error(404); } -if(!in_array($Way, array('up', 'down'))) { +if (!in_array($Way, array('up', 'down'))) { error(404); } $DB->query("SELECT TagID FROM torrents_tags_votes WHERE TagID='$TagID' AND GroupID='$GroupID' AND UserID='$UserID' AND Way='$Way'"); -if($DB->record_count() == 0) { - if($Way == 'down') { +if ($DB->record_count() == 0) { + if ($Way == 'down') { $Change = 'NegativeVotes=NegativeVotes+1'; } else { $Change = 'PositiveVotes=PositiveVotes+2'; diff --git a/sections/torrents/warn.php b/sections/torrents/warn.php index b613b743..178b0ac2 100644 --- a/sections/torrents/warn.php +++ b/sections/torrents/warn.php @@ -1,5 +1,7 @@ 1 week - + - + - Private Message: + Private message: - Edit Post: + Edit post:
diff --git a/sections/user/advancedsearch.php b/sections/user/advancedsearch.php index 4941a136..ab788158 100644 --- a/sections/user/advancedsearch.php +++ b/sections/user/advancedsearch.php @@ -59,7 +59,7 @@ function date_compare($Field, $Operand, $Date1, $Date2 = '') { $Date2 = db_string($Date2); $Return = array(); - switch($Operand) { + switch ($Operand) { case 'on': $Return []= " $Field>='$Date1 00:00:00' "; $Return []= " $Field<='$Date1 23:59:59' "; @@ -91,7 +91,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') { $Return = array(); - switch($Operand) { + switch ($Operand) { case 'equal': $Return []= " $Field='$Num1' "; break; diff --git a/sections/user/connchecker.php b/sections/user/connchecker.php index 02c0a80b..7ba61094 100644 --- a/sections/user/connchecker.php +++ b/sections/user/connchecker.php @@ -14,17 +14,29 @@ $Octets[2] > 255 || $Octets[3] < 0 || $Octets[3] > 255 || + /* + * Per RFC 1918, the following CIDR blocks should never be found on the public Internet. + * 10.0.0.0/8 + * 172.16.0.0/12 + * 192.168.0.0/16 + * + * Per RFC 3330, the block 127.0.0.0/8 should never appear on any network. + * + */ $Octets[0] == 127 || - $Octets[0] == 192 + $Octets[0] == 10 || + ($Octets[0] == 172 && ((16 <= $Octets[1]) && ($Octets[1] <= 31))) || + ($Octets[0] == 192 && $Octets[1] == 168) ) { - die('Invalid IP'); + die('Invalid IPv4 address'); } + // Valid port numbers are defined in RFC 1700 if (empty($_GET['port']) || !is_number($_GET['port']) || $_GET['port'] < 1 || $_GET['port'] > 65535) { - die('Invalid Port'); + die('Invalid port'); } - //Error suppression, ugh. + // Error suppression, ugh. if (@fsockopen($_GET['ip'], $_GET['port'], $Errno, $Errstr, 20)) { die('Port '.$_GET['port'].' on '.$_GET['ip'].' connected successfully.'); } else { diff --git a/sections/user/invite.php b/sections/user/invite.php index 06152f5f..bdd76b64 100644 --- a/sections/user/invite.php +++ b/sections/user/invite.php @@ -44,7 +44,7 @@ } } -switch($CurrentOrder) { +switch ($CurrentOrder) { case 'username' : $OrderBy = "um.Username"; break; diff --git a/sections/user/subscribe.php b/sections/user/subscribe.php index 29808904..c118f4ab 100644 --- a/sections/user/subscribe.php +++ b/sections/user/subscribe.php @@ -1,12 +1,12 @@ query("INSERT IGNORE INTO subscribed_users (UserID, SubscriberID) VALUES ('$UserID', '$LoggedUser[ID]')"); -} -elseif($_GET['perform'] == 'remove') { +} elseif ($_GET['perform'] == 'remove') { $DB->query("DELETE FROM subscribed_users WHERE UserID = '$UserID' AND SubscriberID = '$LoggedUser[ID]'"); } header('Location: user.php?id=' . $UserID); diff --git a/sections/user/takemoderate.php b/sections/user/takemoderate.php index cbe521fa..6f1f4732 100644 --- a/sections/user/takemoderate.php +++ b/sections/user/takemoderate.php @@ -94,41 +94,42 @@ -$DB->query("SELECT - m.Username, - m.IP, - m.Email, - m.PermissionID, - p.Level AS Class, - m.Title, - m.Enabled, - m.Uploaded, - m.Downloaded, - m.Invites, - m.can_leech, - m.Visible, - i.AdminComment, - m.torrent_pass, - i.Donor, - i.Artist, - i.Warned, - i.SupportFor, - i.RestrictedForums, - i.PermittedForums, - DisableAvatar, - DisableInvites, - DisablePosting, - DisableForums, - DisableTagging, - DisableUpload, - DisableWiki, - DisablePM, - DisableIRC, - m.RequiredRatio, - m.FLTokens, - i.RatioWatchEnds, - SHA1(i.AdminComment) AS CommentHash, - GROUP_CONCAT(l.PermissionID SEPARATOR ',') AS SecondaryClasses +$DB->query(" + SELECT + m.Username, + m.IP, + m.Email, + m.PermissionID, + p.Level AS Class, + m.Title, + m.Enabled, + m.Uploaded, + m.Downloaded, + m.Invites, + m.can_leech, + m.Visible, + i.AdminComment, + m.torrent_pass, + i.Donor, + i.Artist, + i.Warned, + i.SupportFor, + i.RestrictedForums, + i.PermittedForums, + DisableAvatar, + DisableInvites, + DisablePosting, + DisableForums, + DisableTagging, + DisableUpload, + DisableWiki, + DisablePM, + DisableIRC, + m.RequiredRatio, + m.FLTokens, + i.RatioWatchEnds, + SHA1(i.AdminComment) AS CommentHash, + GROUP_CONCAT(l.PermissionID SEPARATOR ',') AS SecondaryClasses FROM users_main AS m JOIN users_info AS i ON i.UserID = m.ID LEFT JOIN permissions AS p ON p.ID=m.PermissionID @@ -157,7 +158,7 @@ // If we're deleting the user, we can ignore all the other crap -if ($_POST['UserStatus'] == "delete" && check_perms('users_delete_users')) { +if ($_POST['UserStatus'] == 'delete' && check_perms('users_delete_users')) { Misc::write_log("User account ".$UserID." (".$Cur['Username'].") was deleted by ".$LoggedUser['Username']); $DB->query("DELETE FROM users_main WHERE id=".$UserID); $DB->query("DELETE FROM users_info WHERE UserID=".$UserID); @@ -221,7 +222,7 @@ if ($_POST['LogOut']) { $DB->query("SELECT SessionID FROM users_sessions WHERE UserID='$UserID'"); - while(list($SessionID) = $DB->next_record()) { + while (list($SessionID) = $DB->next_record()) { $Cache->delete_value('session_'.$UserID.'_'.$SessionID); } $Cache->delete_value('users_sessions_'.$UserID); @@ -720,13 +721,13 @@ header("location: user.php?id=$UserID"); function translateUserStatus($status) { - switch($status) { + switch ($status) { case 0: - return "Unconfirmed"; + return 'Unconfirmed'; case 1: - return "Enabled"; + return 'Enabled'; case 2: - return "Disabled"; + return 'Disabled'; default: return $status; } @@ -735,9 +736,9 @@ function translateUserStatus($status) { function translateLeechStatus($status) { switch ($status) { case 0: - return "Disabled"; + return 'Disabled'; case 1: - return "Enabled"; + return 'Enabled'; default: return $status; } diff --git a/sections/user/user.php b/sections/user/user.php index 9ba539a8..fd7fc9f2 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -209,6 +209,7 @@ function check_paranoia_here($Setting) { diff --git a/sections/userhistory/subscriptions.php b/sections/userhistory/subscriptions.php index 7d74fd38..189b96d8 100644 --- a/sections/userhistory/subscriptions.php +++ b/sections/userhistory/subscriptions.php @@ -139,21 +139,21 @@ next_record()) { ?> - +
- + - - +
+ > - + (New!) - + @@ -166,13 +166,9 @@
- - <?=$AuthorName?>'s avatar - - Default avatar - + diff --git a/sections/userhistory/token_history.php b/sections/userhistory/token_history.php index 174d4b48..260ddd2c 100644 --- a/sections/userhistory/token_history.php +++ b/sections/userhistory/token_history.php @@ -19,8 +19,8 @@ $Perms = Permissions::get_permissions($UserInfo['PermissionID']); $UserClass = $Perms['Class']; -if(!check_perms('users_mod')) { - if($LoggedUser['ID'] != $UserID && !check_paranoia(false, $User['Paranoia'], $UserClass, $UserID)) { +if (!check_perms('users_mod')) { + if ($LoggedUser['ID'] != $UserID && !check_paranoia(false, $User['Paranoia'], $UserClass, $UserID)) { error(403); } } @@ -93,10 +93,10 @@ list($TorrentID, $GroupID, $Time, $Expired, $Downloaded, $Uses, $Name, $Format, $Encoding) = $Token; $Name = "$Name"; $ArtistName = Artists::display_artists($Artists[$GroupID]); - if($ArtistName) { + if ($ArtistName) { $Name = $ArtistName.$Name; } - if($Format && $Encoding) { + if ($Format && $Encoding) { $Name.=' ['.$Format.' / '.$Encoding.']'; } ?> diff --git a/sections/wiki/delete.php b/sections/wiki/delete.php index a8088da9..d3172483 100644 --- a/sections/wiki/delete.php +++ b/sections/wiki/delete.php @@ -6,7 +6,7 @@ $DB->query("SELECT Title FROM wiki_articles WHERE ID = $ID"); -if($DB->record_count() < 1) { +if ($DB->record_count() < 1) { error(404); }