diff --git a/classes/class_text.php b/classes/class_text.php index 425eb964..5109389a 100644 --- a/classes/class_text.php +++ b/classes/class_text.php @@ -123,7 +123,9 @@ function local_url($Str) { $URLInfo = parse_url($Str); if(!$URLInfo) { return false; } $Host = $URLInfo['host']; - if($Host == NONSSL_SITE_URL || $Host == SSL_SITE_URL || $Host == 'www.'.NONSSL_SITE_URL) { + // If for some reason your site does not require subdomains or contains a directory in the SITE_URL, revert to the line below. + //if($Host == NONSSL_SITE_URL || $Host == SSL_SITE_URL || $Host == 'www.'.NONSSL_SITE_URL) { + if(preg_match('/(\S+\.)*'.NONSSL_SITE_URL.'/', $Host)) { $URL = $URLInfo['path']; if(!empty($URLInfo['query'])) { $URL.='?'.$URLInfo['query']; diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php index 662d3e9a..7c45a461 100644 --- a/classes/class_torrent_form.php +++ b/classes/class_torrent_form.php @@ -117,7 +117,12 @@ function foot() { Freeleech - /> Checking this box will make the torrent freeleech. Don't abuse it. + diff --git a/classes/script_start.php b/classes/script_start.php index c2ca6c69..4d544af4 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -51,6 +51,7 @@ $Debug = new DEBUG; $Debug->handle_errors(); +$Debug->set_flag('Debug constructed'); $DB = new DB_MYSQL; $Cache = new CACHE; @@ -390,9 +391,16 @@ function site_ban_ip($IP) { $IP = ip2unsigned($IP); $IPBans = $Cache->get_value('ip_bans'); if(!is_array($IPBans)) { - $DB->query("SELECT ID, FromIP, ToIP FROM ip_bans"); - $IPBans = $DB->to_array('ID'); - $Cache->cache_value('ip_bans', $IPBans, 0); + //Cache lock! + $Lock = $Cache->get_value('ip_bans_lock'); + if($Lock) { + ?>cache_value('ip_bans_lock', '1', 10); + $DB->query("SELECT ID, FromIP, ToIP FROM ip_bans"); + $IPBans = $DB->to_array('ID'); + $Cache->cache_value('ip_bans', $IPBans, 0); + } } foreach($IPBans as $Index => $IPBan) { list($ID, $FromIP, $ToIP) = $IPBan; @@ -1646,7 +1654,8 @@ function update_sphinx_requests($RequestID) { UNIX_TIMESTAMP(TimeFilled) AS TimeFilled, Visible, COUNT(rv.UserID) AS Votes, SUM(rv.Bounty) >> 10 AS Bounty FROM requests AS r LEFT JOIN requests_votes AS rv ON rv.RequestID=r.ID - WHERE ID = ".$RequestID); + wHERE ID = ".$RequestID." + GROUP BY r.ID"); $DB->query("UPDATE sphinx_requests_delta SET ArtistList = (SELECT @@ -1696,7 +1705,8 @@ function torrent_info($Data) { if(!empty($Data['HasCue'])) { $Info[]='Cue'; } if(!empty($Data['Media'])) { $Info[]=$Data['Media']; } if(!empty($Data['Scene'])) { $Info[]='Scene'; } - if(!empty($Data['FreeTorrent'])) { $Info[]='Freeleech!'; } + if($Data['FreeTorrent'] == '1') { $Info[]='Freeleech!'; } + if($Data['FreeTorrent'] == '2') { $Info[]='Neutral Leech!'; } return implode(' / ', $Info); } @@ -1762,6 +1772,15 @@ function disable_users($UserIDs, $AdminComment, $BanReason = 1) { */ $Cache->delete_value('enabled_'.$UserID); $Cache->delete_value('user_info_'.$UserID); + $Cache->delete_value('user_info_heavy_'.$UserID); + $Cache->delete_value('user_stats_'.$UserID); + + $DB->query("SELECT SessionID FROM users_sessions WHERE UserID='$UserID'"); + while(list($SessionID) = $DB->next_record()) { + $Cache->delete_value('session_'.$UserID.'_'.$SessionID); + } + $Cache->delete_value('users_sessions_'.$UserID); + $DB->query("DELETE FROM users_sessions WHERE UserID='$UserID'"); } $DB->query("SELECT torrent_pass FROM users_main WHERE ID in (".implode(", ",$UserIDs).")"); $PassKeys = $DB->collect('torrent_pass'); diff --git a/defer-bug.php b/defer-bug.php deleted file mode 100644 index 54556110..00000000 --- a/defer-bug.php +++ /dev/null @@ -1,87 +0,0 @@ -", - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' - ); - - $With=array( - ''','"','<','>', - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' - ); - - $Str=str_replace($Replace,$With,$Str); - } - return $Str; -} - -require('classes/class_useragent.php'); //Require the useragent class -$UA = new USER_AGENT; -$Browser = $UA->browser($_SERVER['HTTP_USER_AGENT']); -$OperatingSystem = $UA->operating_system($_SERVER['HTTP_USER_AGENT']); -?> - - - - <script> Defer Bug - - - -

Defer bug test (Gecko 1.9.2+)

-

This page showcases issues with browsers and defer loading with the preservation of content order.

-

As one can see in this demo, the implementation of the HTML5 changes to <script defer> (1) has resulted in several small issues, originating from the way this has been used historically. Up until the past year, javascript execution has been painfully slow, to an extent that things like Google Analytics advised the placement of their javascript in file footers (a contradiction to another part of the spec). The defer attribute has been used in such cases to allowe ECMAScript to remain in the correct inclusion location without blocking the download of content or the rendering of the webpage. This lowered the percieved load time, the most important number in web development (notably for encouraging users to return). Because of this change however, not only has this percieved performance gain been sacrificed, but a relatively serious backwords compatibility issue for sites using defer in their natural code execution pattern.

-

Because of this combination of breaking various script loading patterns, a decrease in user percieved performance, the fact that all other browsers thus far have opted out of this adaptation of the spec, and the resulting encouragement this would give web developers to include scripts outside the page header; I am humbly noting that this additional 'clarification' contained in the HTML5 spec is flawed in nature and should be reverted to it's prior method.

- Browser Info - -

To clarify for the confused: if you get the alert, your browser has this bug, if you do not get the alert, your browser is working fine.

- - - diff --git a/gazelle.sql b/gazelle.sql index c4219834..6d0d5c04 100644 --- a/gazelle.sql +++ b/gazelle.sql @@ -759,7 +759,7 @@ CREATE TABLE `torrents` ( `Leechers` int(6) NOT NULL DEFAULT '0', `Seeders` int(6) NOT NULL DEFAULT '0', `last_action` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `FreeTorrent` enum('0','1') NOT NULL DEFAULT '0', + `FreeTorrent` enum('0','1','2') NOT NULL DEFAULT '0', `FreeLeechType` enum('0','1','2','3') NOT NULL DEFAULT '0', `Dupable` enum('0','1') NOT NULL DEFAULT '0', `DupeReason` varchar(40) DEFAULT NULL, diff --git a/sections/artist/artist.php b/sections/artist/artist.php index 10c55df8..5e9c66ad 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -580,7 +580,7 @@ function compare($X, $Y){ $TagName) { - $TagList[] = "".display_str($TagName).""; + $TagList[] = "".display_str($TagName).""; } $TagList = implode(', ', $TagList); ?> diff --git a/sections/artist/artist_rearrange.php b/sections/artist/artist_rearrange.php index 93378378..774c3d3f 100644 --- a/sections/artist/artist_rearrange.php +++ b/sections/artist/artist_rearrange.php @@ -456,67 +456,7 @@ function display_name($ReleaseType) { -if(check_perms('zip_downloader')){ - if(isset($LoggedUser['Collector'])) { - list($ZIPList,$ZIPPrefs) = $LoggedUser['Collector']; - $ZIPList = explode(':',$ZIPList); - } else { - $ZIPList = array('00','11'); - $ZIPPrefs = 1; - } -?> -
-
Collector
-
-
- - - -
    - -
  • - - - [X] -
    -
  • - -
- - - - -
-
-
- ?>
Tags
@@ -665,7 +605,7 @@ function display_name($ReleaseType) { $TagName) { - $TagList[] = "".display_str($TagName).""; + $TagList[] = "".display_str($TagName).""; } $TagList = implode(', ', $TagList); ?> diff --git a/sections/artist/download.php b/sections/artist/download.php index 258a6143..3aeeb985 100644 --- a/sections/artist/download.php +++ b/sections/artist/download.php @@ -27,7 +27,7 @@ SQL template: SELECT CASE - WHEN t.Format='Ogg' THEN 0 + 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 @@ -91,7 +91,7 @@ case '35': $SQL .= "t.Format='FLAC' AND t.Encoding='Lossless' AND HasLog='1'"; break; case '36': $SQL .= "t.Format='FLAC' AND t.Encoding='Lossless'"; break; case '40': $SQL .= "t.Format='DTS'"; break; - case '41': $SQL .= "t.Format='Ogg'"; 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; diff --git a/sections/better/better.php b/sections/better/better.php index fd615551..9bc106db 100644 --- a/sections/better/better.php +++ b/sections/better/better.php @@ -86,6 +86,14 @@ Torrents that have been marked as having 'Bad File Names'. + + + Single seeded FLAC torrents + + + FLAC torrents that only have one seeder, show them some love! + +
diff --git a/sections/better/index.php b/sections/better/index.php index 288c14fa..0e021cd0 100644 --- a/sections/better/index.php +++ b/sections/better/index.php @@ -7,6 +7,9 @@ case 'transcode': include(SERVER_ROOT.'/sections/better/transcode.php'); break; + case 'single': + include(SERVER_ROOT.'/sections/better/single.php'); + break; case 'snatch': include(SERVER_ROOT.'/sections/better/snatch.php'); break; diff --git a/sections/better/single.php b/sections/better/single.php new file mode 100644 index 00000000..edcaf359 --- /dev/null +++ b/sections/better/single.php @@ -0,0 +1,50 @@ +get_value('better_single_groupids')) === false) { + $DB->query("SELECT t.ID AS TorrentID, + t.GroupID AS GroupID + FROM xbt_files_users AS x + JOIN torrents AS t ON t.ID=x.fid + WHERE t.Format='FLAC' + GROUP BY x.fid + HAVING COUNT(x.uid) = 1 + ORDER BY t.LogScore DESC, t.Time ASC LIMIT 30"); + + $GroupIDs = $DB->to_array('GroupID'); + $Cache->cache_value('better_single_groupids', $GroupIDs, 30*60); +} + +$Results = get_groups(array_keys($GroupIDs)); + +show_header('Single seeder FLACs'); +?> +
+ + + + +$Group) { + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $Torrents, $Artists) = array_values($Group); + $FlacID = $GroupIDs[$GroupID]['TorrentID']; + + $DisplayName = ''; + if(count($Artists)>0) { + $DisplayName = display_artists(array('1'=>$Artists)); + } + $DisplayName.=''.$GroupName.''; + if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; } + +?> + + + + +
Torrent
+ + [DL] +
+
+ diff --git a/sections/better/transcode.php b/sections/better/transcode.php index c046f814..856c8d3b 100644 --- a/sections/better/transcode.php +++ b/sections/better/transcode.php @@ -20,7 +20,7 @@ $Query.=' @(groupname,artistname,yearfulltext) '.$SS->EscapeString($_GET['search']); } -$SS->SetFilter('logscore', array(100));// +$SS->SetFilter('logscore', array(100)); $SS->SetSortMode(SPH_SORT_EXTENDED, "@random"); $SS->limit(0, TORRENTS_PER_PAGE); diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php index d28a6531..a7f9386a 100644 --- a/sections/bookmarks/torrents.php +++ b/sections/bookmarks/torrents.php @@ -227,7 +227,7 @@ function compare($X, $Y){ $DisplayName .= $GroupName; if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';} ?> - +
  • <?=$DisplayName?> @@ -235,7 +235,7 @@ function compare($X, $Y){
    - +
  • 's Bookmarks