diff --git a/classes/config.template b/classes/config.template index 8c837351..e46e3c66 100644 --- a/classes/config.template +++ b/classes/config.template @@ -25,7 +25,7 @@ define('SQLLOGIN', '');//The MySQL login define('SQLPASS', ''); //The MySQL password define('SQLDB', 'gazelle'); //The MySQL database to use define('SQLPORT', 3306); //The MySQL port to connect on -define('SQLSOCK', '/var/run/mysqld/mysql.sock'); +define('SQLSOCK', '/var/run/mysqld/mysqld.sock'); // Memcached details $MemcachedServers = array( @@ -58,12 +58,13 @@ if (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 80) { // Site settings if (PHP_VERSION_ID < 50307) { die("PHP version 5.3.7 or later is highly recommended for gazelle's password hashing methods.". - " Uncomment line ".__LINE__." in file ".__FILE__." if you want to continue to use this version."); + " Comment out line ".__LINE__." in file ".__FILE__." if you want to continue to use this version."); define('CRYPT_HASH_PREFIX', '$2a$07$'); // Crypt salt prefix for hash settings. See http://php.net/crypt for details } else { define('CRYPT_HASH_PREFIX', '$2y$07$'); } define('DEBUG_MODE', false); //Set to false if you dont want everyone to see debug information, can be overriden with 'site_debug' +define('DEBUG_WARNINGS', true); //Set to true if you want to see PHP warnings in the footer define('OPEN_REGISTRATION', true); //Set to false to disable open regirstration, true to allow anyone to register define('USER_LIMIT', 5000); //The maximum number of users the site can have, 0 for no limit define('STARTING_INVITES', 0); //# of invites to give to newly registered users @@ -149,7 +150,7 @@ $Formats = array('MP3', 'FLAC', 'Ogg Vorbis', 'AAC', 'AC3', 'DTS'); $Bitrates = array('192', 'APS (VBR)', 'V2 (VBR)', 'V1 (VBR)', '256', 'APX (VBR)', 'V0 (VBR)', 'q8.x (VBR)', '320', 'Lossless', '24bit Lossless', 'Other'); $Media = array('CD', 'DVD', 'Vinyl', 'Soundboard', 'SACD', 'DAT', 'Cassette', 'WEB'); -$CollageCats = array(0=>'Personal', 1=>'Theme', 2=>'Genre introduction', 3=>'Discography', 4=>'Label', 5=>'Staff picks', 6=>'Charts'); +$CollageCats = array(0=>'Personal', 1=>'Theme', 2=>'Genre introduction', 3=>'Discography', 4=>'Label', 5=>'Staff picks', 6=>'Charts', 7=>'Artists'); $ReleaseTypes = array(1=>'Album', 3=>'Soundtrack', 5=>'EP', 6=>'Anthology', 7=>'Compilation', 9=>'Single', 11=>'Live album', 13=>'Remix', 14=>'Bootleg', 15=>'Interview', 16=>'Mixtape', 21=>'Unknown'); //$ForumCats = array(1=>'Site', 5=>'Community', 10=>'Help', 8=>'Music', 20=>'Trash'); //No longer needed diff --git a/classes/debug.class.php b/classes/debug.class.php index e998a30e..e2a461a7 100644 --- a/classes/debug.class.php +++ b/classes/debug.class.php @@ -203,12 +203,9 @@ public function php_error_handler($Level, $Error, $File, $Line) { $File = str_replace(SERVER_ROOT, '', $File); $Error = str_replace(SERVER_ROOT, '', $Error); - /* - //Hiding "session_start(): Server 10.10.0.1 (tcp 11211) failed with: No route to host (113)" errors - if ($Call != "session_start") { + if (defined('DEBUG_WARNINGS')) { $this->Errors[] = array($Error, $File.':'.$Line, $Call, $Args); } - */ return true; } diff --git a/classes/donations.class.php b/classes/donations.class.php index 22251017..a1e78867 100644 --- a/classes/donations.class.php +++ b/classes/donations.class.php @@ -289,7 +289,7 @@ public static function has_donor_forum($UserID) { public static function is_mod($UserID) { $Permissions = Permissions::get_permissions_for_user($UserID); - return $Permissions['users_mod']; + return isset($Permissions['users_mod']) && $Permissions['users_mod']; } @@ -376,9 +376,21 @@ public static function get_enabled_rewards($UserID) { $SpecialRank = self::get_special_rank($UserID); $HasAll = $SpecialRank == 3; - if ($Rank >= 1 || $HasAll) { + $Rewards = array( + 'HasAvatarMouseOverText' => false, + 'HasCustomDonorIcon' => false, + 'HasDonorForum' => false, + 'HasDonorIconLink' => false, + 'HasDonorIconMouseOverText' => false, + 'HasProfileInfo1' => false, + 'HasProfileInfo2' => false, + 'HasProfileInfo3' => false, + 'HasProfileInfo4' => false, + 'HasSecondAvatar' => false); - } +// if ($Rank >= 1 || $HasAll) { +// +// } if ($Rank >= 2 || $HasAll) { $Rewards["HasDonorIconMouseOverText"] = true; $Rewards["HasProfileInfo1"] = true; diff --git a/classes/format.class.php b/classes/format.class.php index 93d80376..9c852207 100644 --- a/classes/format.class.php +++ b/classes/format.class.php @@ -127,7 +127,7 @@ public static function get_ratio_html($Dividend, $Divisor, $Color = true) { * @param int $Decimal floor to n decimals (e.g. subtract .005 to floor to 2 decimals) * @return boolean|string */ - public function get_ratio ($Dividend, $Divisor, $Decimal = 2) { + public static function get_ratio($Dividend, $Divisor, $Decimal = 2) { if ($Divisor == 0 && $Dividend == 0) { return false; } diff --git a/classes/forums.class.php b/classes/forums.class.php index effb8636..54b74a5a 100644 --- a/classes/forums.class.php +++ b/classes/forums.class.php @@ -12,9 +12,10 @@ class Forums { * @return array holding thread information. */ public static function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false) { - if ((!$ThreadInfo = G::$Cache->get_value('thread_' . $ThreadID . '_info')) || !isset($ThreadInfo['OP'])) { + if ((!$ThreadInfo = G::$Cache->get_value('thread_' . $ThreadID . '_info')) || !isset($ThreadInfo['Ranking'])) { $QueryID = G::$DB->get_query_id(); - G::$DB->query("SELECT + G::$DB->query( + "SELECT t.Title, t.ForumID, t.IsLocked, @@ -23,10 +24,11 @@ public static function get_thread_info($ThreadID, $Return = true, $SelectiveCach t.LastPostAuthorID, ISNULL(p.TopicID) AS NoPoll, t.StickyPostID, - t.AuthorID as OP + t.AuthorID as OP, + t.Ranking FROM forums_topics AS t - JOIN forums_posts AS fp ON fp.TopicID = t.ID - LEFT JOIN forums_polls AS p ON p.TopicID=t.ID + JOIN forums_posts AS fp ON fp.TopicID = t.ID + LEFT JOIN forums_polls AS p ON p.TopicID=t.ID WHERE t.ID = '$ThreadID' GROUP BY fp.TopicID"); if (G::$DB->record_count() == 0) { @@ -35,17 +37,19 @@ public static function get_thread_info($ThreadID, $Return = true, $SelectiveCach $ThreadInfo = G::$DB->next_record(MYSQLI_ASSOC, false); if ($ThreadInfo['StickyPostID']) { $ThreadInfo['Posts']--; - G::$DB->query("SELECT - p.ID, - p.AuthorID, - p.AddedTime, - p.Body, - p.EditedUserID, - p.EditedTime, - ed.Username - FROM forums_posts as p - LEFT JOIN users_main AS ed ON ed.ID = p.EditedUserID - WHERE p.TopicID = '$ThreadID' AND p.ID = '" . $ThreadInfo['StickyPostID'] . "'"); + G::$DB->query( + "SELECT + p.ID, + p.AuthorID, + p.AddedTime, + p.Body, + p.EditedUserID, + p.EditedTime, + ed.Username + FROM forums_posts as p + LEFT JOIN users_main AS ed ON ed.ID = p.EditedUserID + WHERE p.TopicID = '$ThreadID' + AND p.ID = '" . $ThreadInfo['StickyPostID'] . "'"); list ($ThreadInfo['StickyPost']) = G::$DB->to_array(false, MYSQLI_ASSOC); } G::$DB->set_query_id($QueryID); @@ -69,7 +73,7 @@ public static function get_thread_info($ThreadID, $Return = true, $SelectiveCach */ public static function check_forumperm($ForumID, $Perm = 'Read') { $Forums = self::get_forums(); - if (G::$LoggedUser['CustomForums'][$ForumID] == 1) { + if (isset(G::$LoggedUser['CustomForums'][$ForumID]) && G::$LoggedUser['CustomForums'][$ForumID] == 1) { return true; } if ($ForumID == DONOR_FORUM && Donations::has_donor_forum(G::$LoggedUser['ID'])) { diff --git a/classes/lastfm.class.php b/classes/lastfm.class.php index 424ba052..e76c229f 100644 --- a/classes/lastfm.class.php +++ b/classes/lastfm.class.php @@ -93,6 +93,11 @@ public static function get_top_tracks($Username, $Limit = 15) { return $Response; } + public static function get_artist_chart($Username, $From = '', $To = '') { + $Response = self::lastfm_request("user.getWeeklyArtistChart", array("user" => $Username)); + $Response = json_encode($Response); + } + public static function clear_cache($Username, $Uid) { $Response = G::$Cache->get_value('lastfm_clear_cache_' . G::$LoggedUser['ID'] . '_' . $_GET['id']); if (empty($Response)) { diff --git a/classes/permissions.class.php b/classes/permissions.class.php index d1b00893..294dda27 100644 --- a/classes/permissions.class.php +++ b/classes/permissions.class.php @@ -77,10 +77,8 @@ public static function get_permissions_for_user($UserID, $CustomPermissions = fa $BonusPerms = array_merge($BonusPerms, $ClassPerms['Permissions']); } - if (!empty($CustomPermissions)) { - $CustomPerms = $CustomPermissions; - } else { - $CustomPerms = array(); + if (empty($CustomPermissions)) { + $CustomPermissions = array(); } // This is legacy donor cruft @@ -90,18 +88,20 @@ public static function get_permissions_for_user($UserID, $CustomPermissions = fa $DonorPerms = array('Permissions' => array()); } - $DonorCollages = self::get_personal_collages($UserID, $Permissions['Permissions']['users_mod']); + $IsMod = isset($Permissions['Permissions']['users_mod']) && $Permissions['Permissions']['users_mod']; + $DonorCollages = self::get_personal_collages($UserID, $IsMod); - $MaxCollages = $Permissions['Permissions']['MaxCollages'] - + $BonusCollages - + $CustomPerms['MaxCollages'] - + $DonorCollages; + $MaxCollages = $Permissions['Permissions']['MaxCollages'] + $BonusCollages + $DonorCollages; + + if (isset($CustomPermissions['MaxCollages'])) { + $MaxCollages += $CustomPermissions['MaxCollages']; + } //Combine the permissions return array_merge( $Permissions['Permissions'], $BonusPerms, - $CustomPerms, + $CustomPermissions, $DonorPerms['Permissions'], array('MaxCollages' => $MaxCollages)); } diff --git a/classes/sphinxql.class.php b/classes/sphinxql.class.php index b652e2c9..51f9b888 100644 --- a/classes/sphinxql.class.php +++ b/classes/sphinxql.class.php @@ -26,7 +26,7 @@ public function __construct($Server, $Port, $Socket) { $this->Server = $Server; $this->Port = $Port; $this->Socket = $Socket; - $this->Ident = $this->get_ident($Server, $Port, $Socket); + $this->Ident = self::get_ident($Server, $Port, $Socket); } /** @@ -37,7 +37,7 @@ public function __construct($Server, $Port, $Socket) { * @param string $Socket Unix socket address, overrides $Server:$Port * @return identification string */ - private function get_ident($Server, $Port, $Socket) { + private static function get_ident($Server, $Port, $Socket) { if ($Socket) { return $Socket; } else { @@ -64,7 +64,7 @@ public static function init_connection($Server, $Port, $Socket) { /** * Connect the Sphinxql object to the Sphinx server */ - public function sphconnect() { + public function sph_connect() { if ($this->Connected || $this->connect_errno) { return; } @@ -114,7 +114,7 @@ public function error($Msg, $Halt = false) { * @param string $String string to escape * @return escaped string */ - public function escape_string($String) { + public static function sph_escape_string($String) { return strtr($String, array( '('=>'\\\\(', ')'=>'\\\\)', @@ -141,8 +141,8 @@ public function escape_string($String) { * @param string $QueryString query text * @param param $QueryProcessTime time building and processing the query */ - public function register_query($QueryString, $QueryProcessTime) { - Sphinxql::$Queries[] = array($QueryString, $QueryProcessTime); - Sphinxql::$Time += $QueryProcessTime; + public static function register_query($QueryString, $QueryProcessTime) { + self::$Queries[] = array($QueryString, $QueryProcessTime); + self::$Time += $QueryProcessTime; } } diff --git a/classes/sphinxqlquery.class.php b/classes/sphinxqlquery.class.php index bb666c16..d948ca45 100644 --- a/classes/sphinxqlquery.class.php +++ b/classes/sphinxqlquery.class.php @@ -116,7 +116,7 @@ public function where_match($Expr, $Field = '*', $Escape = true) { $Field = "@$Field "; } if ($Escape === true) { - $this->Expressions[] = "$Field".Sphinxql::escape_string($Expr); + $this->Expressions[] = "$Field".Sphinxql::sph_escape_string($Expr); } else { $this->Expressions[] = $Field.$Expr; } @@ -282,13 +282,15 @@ private function send_query($GetMeta) { if (!$this->QueryString) { return false; } - $this->Sphinxql->sphconnect(); + $this->Sphinxql->sph_connect(); $Result = $this->Sphinxql->query($this->QueryString); if ($Result === false) { $Errno = $this->Sphinxql->errno; $Error = $this->Sphinxql->error; $this->error("Query returned error $Errno ($Error).\n$this->QueryString"); } else { + $Errno = 0; + $Error = ''; $Meta = $GetMeta ? $this->get_meta() : null; } return new SphinxqlResult($Result, $Meta, $Errno, $Error); diff --git a/classes/tags.class.php b/classes/tags.class.php index 0fe8fdcf..b25ba072 100644 --- a/classes/tags.class.php +++ b/classes/tags.class.php @@ -56,13 +56,17 @@ class Tags { * E.g., compilations and soundtracks are skipped, so false */ public function __construct($TagList, $Merge = true) { - $this->Tags = array_filter(explode(' ', str_replace('_', '.', $TagList))); + if ($TagList) { + $this->Tags = array_filter(explode(' ', str_replace('_', '.', $TagList))); - if ($Merge) { - self::$All = array_merge(self::$All, $this->Tags); + if ($Merge) { + self::$All = array_merge(self::$All, $this->Tags); + } + + $this->Primary = $this->Tags[0]; + } else { + $this->Tags = array(); } - - $this->Primary = $this->Tags[0]; } /** diff --git a/classes/users.class.php b/classes/users.class.php index 1cc612b7..df6b6af6 100644 --- a/classes/users.class.php +++ b/classes/users.class.php @@ -631,8 +631,7 @@ public static function show_avatar($Avatar, $UserID, $Username, $Setting, $Size $ToReturn = ($ReturnHTML ? "" : $Avatar); } else { $URL = STATIC_SERVER.'common/avatars/default.png'; - //TODO: what is the $JS variable for? why is it unassigned? - $ToReturn = ($ReturnHTML ? "" : $URL); + $ToReturn = ($ReturnHTML ? "" : $URL); } break; case 2: diff --git a/classes/view.class.php b/classes/view.class.php index 5f8ec9d9..047e3a5c 100644 --- a/classes/view.class.php +++ b/classes/view.class.php @@ -41,7 +41,7 @@ public static function show_header($PageTitle = '', $JSIncludes = '', $CSSInclud * Here is a list of parameters that work in the $Options array: * ['disclaimer'] = [boolean] (False) Displays the disclaimer in the footer */ - public static function show_footer ($Options = array()) { + public static function show_footer($Options = array()) { global $ScriptStartTime, $SessionID, $UserSessions, $Debug, $Time; if (!is_array(G::$LoggedUser)) { require(SERVER_ROOT.'/design/publicfooter.php'); @@ -65,7 +65,7 @@ public static function show_footer ($Options = array()) { * @param string $TemplateName The name of the template, in underscore_format * @param array $Args the arguments passed to the template. */ - public static function render_template ($TemplateName, $Args) { + public static function render_template($TemplateName, $Args) { static $LoadedTemplates; // Keep track of templates we've already loaded. $ClassName = ''; if (isset($LoadedTemplates[$TemplateName])) { @@ -113,7 +113,7 @@ public static function render_template ($TemplateName, $Args) { * echo $SavedTemplate; // Output the buffer * */ - public static function parse ($TemplateFile, array $Variables = null, $Buffer = false) { + public static function parse($TemplateFile, array $Variables = array(), $Buffer = false) { $Template = self::IncludePath . $TemplateFile; if (file_exists($Template)) { extract($Variables); diff --git a/docs/INSTALL.txt b/docs/INSTALL.txt index 495c3447..1d974ca5 100644 --- a/docs/INSTALL.txt +++ b/docs/INSTALL.txt @@ -1,12 +1,12 @@ INSTALLATION NOTES -1. Set up MySQL and memcached. We run memcached with the command: - memcached -d -m 5120 -s /var/run/memcached.sock -a 0777 -t16 -C -u root - This gives it 5 gigs of RAM; you probably want to set that a bit lower! +1. Set up MySQL and memcached. memcached can be started with the command: + memcached -d -m 5120 -s /var/run/memcached.sock -a 0777 -t4 -C -u nobody + This starts 4 threads and gives it 5 gigs of RAM 2. Run gazelle.sql (preferably as root) to create the database, the table, and the default data. 3. Install Sphinx - we recommend you use the included sphinx.conf. You can copy this to /etc/sphinx/sphinx.conf. You need to fill in the details of the SQL server though! - You might also need to create the /var/data/sphinx folder. + You might also need to create the /var/lib/sphinx folder. For documentation, read http://www.sphinxsearch.com/docs/current.html @@ -21,10 +21,10 @@ the peerupdate (all groups are cached, but the peer counts change often, so peerupdate is a script to update them), and the two Sphinx indices. These are our cron jobs. SCHEDULE_KEY is the same as in classes/config.php: -0,15,30,45 * * * * /usr/local/bin/php /var/www/vhosts/what/schedule.php SCHEDULE_KEY >> /root/schedule.log -10,25,40,55 * * * * /usr/local/bin/php /var/www/vhosts/what/peerupdate.php SCHEDULE_KEY >> /root/peerupdate.log -* * * * * /usr/local/bin/indexer -c /etc/sphinx/sphinx.conf --rotate delta -5 0,12 * * * /usr/local/bin/indexer -c /etc/sphinx/sphinx.conf --rotate --all +0,15,30,45 * * * * /usr/bin/php /var/www/vhosts/what/schedule.php SCHEDULE_KEY >> /root/schedule.log +10,25,40,55 * * * * /usr/bin/php /var/www/vhosts/what/peerupdate.php SCHEDULE_KEY >> /root/peerupdate.log +* * * * * /usr/bin/indexer -c /etc/sphinx/sphinx.conf --rotate delta requests_delta log_delta >/dev/null +5 0,12 * * * /usr/bin/indexer -c /etc/sphinx/sphinx.conf --rotate --all >>/root/sphinx-indexer.log 7. You're probably going to want IP geolocation information, so first you need to fill in the geoip_country tables by visiting /tools.php?action=update_geoip After that finishes parsing information from MaxMind, you may want to map users to countries by running: diff --git a/sections/ajax/browse.php b/sections/ajax/browse.php index 00e98f1c..20e93ce0 100644 --- a/sections/ajax/browse.php +++ b/sections/ajax/browse.php @@ -164,7 +164,7 @@ function header_link($SortKey, $DefaultWay = 'desc') { if (!empty($_GET['filelist'])) { $SearchString = trim($_GET['filelist']); if ($SearchString !== '') { - $SearchString = '"'.Sphinxql::escape_string($_GET['filelist']).'"~20'; + $SearchString = '"'.Sphinxql::sph_escape_string($_GET['filelist']).'"~20'; $SphQL->where_match($SearchString, 'filelist', false); $SphQLTor->where_match($SearchString, 'filelist', false); $EnableNegation = true; @@ -244,11 +244,11 @@ function header_link($SortKey, $DefaultWay = 'desc') { } $QueryParts = array(); foreach ($BasicSearch['include'] as $Word) { - $QueryParts[] = Sphinxql::escape_string($Word); + $QueryParts[] = Sphinxql::sph_escape_string($Word); } if (!empty($BasicSearch['exclude'])) { foreach ($BasicSearch['exclude'] as $Word) { - $QueryParts[] = '!'.Sphinxql::escape_string(substr($Word, 1)); + $QueryParts[] = '!'.Sphinxql::sph_escape_string(substr($Word, 1)); } } if (!empty($FilterBitrates)) { @@ -280,11 +280,11 @@ function header_link($SortKey, $DefaultWay = 'desc') { unset($Tags['exclude']); } foreach ($Tags['include'] as &$Tag) { - $Tag = Sphinxql::escape_string($Tag); + $Tag = Sphinxql::sph_escape_string($Tag); } if (!empty($Tags['exclude'])) { foreach ($Tags['exclude'] as &$Tag) { - $Tag = '!'.Sphinxql::escape_string(substr($Tag, 1)); + $Tag = '!'.Sphinxql::sph_escape_string(substr($Tag, 1)); } } @@ -307,6 +307,7 @@ function header_link($SortKey, $DefaultWay = 'desc') { } if (!empty($QueryParts)) { $SphQL->where_match(implode(' ', $QueryParts), 'taglist', false); + $SphQLTor->where_match(implode(' ', $QueryParts), 'taglist', false); $Filtered = true; } unset($SearchWords['taglist']); @@ -321,11 +322,11 @@ function header_link($SortKey, $DefaultWay = 'desc') { unset($Words['exclude']); } foreach ($Words['include'] as $Word) { - $QueryParts[] = Sphinxql::escape_string($Word); + $QueryParts[] = Sphinxql::sph_escape_string($Word); } if (!empty($Words['exclude'])) { foreach ($Words['exclude'] as $Word) { - $QueryParts[] = '!'.Sphinxql::escape_string(substr($Word, 1)); + $QueryParts[] = '!'.Sphinxql::sph_escape_string(substr($Word, 1)); } } if (!empty($QueryParts)) { @@ -390,7 +391,7 @@ function header_link($SortKey, $DefaultWay = 'desc') { } } -if (!empty($_GET['freetorrent'])) { +if (isset($_GET['freetorrent'])) { switch ($_GET['freetorrent']) { case 0: // Only normal freeleech $SphQL->where('freetorrent', 0); @@ -677,7 +678,7 @@ function header_link($SortKey, $DefaultWay = 'desc') { 'logScore' => (int) $Data['LogScore'], 'hasCue' => $Data['HasCue'] == '1', 'scene' => $Data['Scene'] == '1', - 'vanityHouse' => $Data['VanityHouse'] == '1', + 'vanityHouse' => $GroupInfo['VanityHouse'] == '1', 'fileCount' => (int) $Data['FileCount'], 'time' => $Data['Time'], 'size' => (int) $Data['Size'], @@ -699,7 +700,7 @@ function header_link($SortKey, $DefaultWay = 'desc') { 'cover' => $GroupInfo['WikiImage'], 'tags' => $TagList, 'bookmarked' => in_array($GroupID, $Bookmarks), - 'vanityHouse' => $GroupVanityHouse == '1', + 'vanityHouse' => $GroupInfo['VanityHouse'] == '1', 'groupYear' => (int) $GroupYear, 'releaseType' => $ReleaseTypes[$ReleaseType], 'groupTime' => (string) $GroupTime, diff --git a/sections/artist/artist.php b/sections/artist/artist.php index f55a9490..ec2ecb4d 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -236,7 +236,7 @@ function compare($X, $Y) { break; } - if (!empty($LoggedUser['DiscogView']) || (isset($LoggedUser['SortHide']) && array_key_exists($ReleaseType, $LoggedUser['SortHide']) && $LoggedUser['SortHide'][$ReleaseType] == 1)) { + if (!empty($LoggedUser['DiscogView']) || (isset($LoggedUser['SortHide'][$ReleaseID]) && $LoggedUser['SortHide'][$ReleaseID] == 1)) { $ToggleStr = " onclick=\"$('.releases_$ReleaseID').gshow(); return true;\""; } else { $ToggleStr = ''; @@ -402,12 +402,14 @@ function compare($X, $Y) {
- Remove bookmark"; - } else { - echo "Bookmark"; - } ?> - + + Remove bookmark + + Bookmark +
format('torrents.php?taglist=', $Name)?>
@@ -432,7 +434,7 @@ function compare($X, $Y) { || $Torrent['RemasterYear'] != $LastRemasterYear || $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber - || $FirstUnknown + || isset($FirstUnknown) && $FirstUnknown || $Torrent['Media'] != $LastMedia ) { diff --git a/sections/collages/browse.php b/sections/collages/browse.php index 7cd7f9ff..7166d5aa 100644 --- a/sections/collages/browse.php +++ b/sections/collages/browse.php @@ -148,7 +148,7 @@ $SQL .= " AND CategoryID IN(".db_string(implode(',', $Categories)).')'; } -if ($_GET['action'] === 'mine') { +if (isset($_GET['action']) && $_GET['action'] === 'mine') { $SQL = $BaseSQL; $SQL .= " AND c.UserID = '".$LoggedUser['ID']."' diff --git a/sections/collages/collage.php b/sections/collages/collage.php index 13e72217..09dc608a 100644 --- a/sections/collages/collage.php +++ b/sections/collages/collage.php @@ -70,7 +70,7 @@ function compare($X, $Y) { WHERE UserID = ".$LoggedUser['ID']." AND CollageID = $CollageID"); -if ($CollageCategoryID == array_search(ARTIST_COLLAGE, $CollageCats)) { +if ((int)$CollageCategoryID === array_search(ARTIST_COLLAGE, $CollageCats)) { include(SERVER_ROOT.'/sections/collages/artist_collage.php'); } else { include(SERVER_ROOT.'/sections/collages/torrent_collage.php'); diff --git a/sections/index/private.php b/sections/index/private.php index e8aa2b60..919b45e7 100644 --- a/sections/index/private.php +++ b/sections/index/private.php @@ -73,19 +73,15 @@ ?>