diff --git a/api.php b/api.php index 5b512f54..0b7a9bba 100644 --- a/api.php +++ b/api.php @@ -34,13 +34,13 @@ function check_perms() { } function error($Code) { - echo '',$Code,''; + echo '', $Code, ''; die(); } function make_secret($Length = 32) { $Secret = ''; - $Chars='abcdefghijklmnopqrstuvwxyz0123456789'; + $Chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; for ($i = 0; $i < $Length; $i++) { $Rand = mt_rand(0, strlen($Chars) - 1); $Secret .= substr($Chars, $Rand, 1); @@ -59,20 +59,26 @@ function is_number($Str) { function display_str($Str) { if ($Str != '') { $Str = make_utf8($Str); - $Str = mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8"); - $Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&",$Str); + $Str = mb_convert_encoding($Str, 'HTML-ENTITIES', 'UTF-8'); + $Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str); $Replace = array( "'",'"',"<",">", - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' + '€','‚','ƒ','„','…','†','‡','ˆ', + '‰','Š','‹','Œ','Ž','‘','’','“', + '”','•','–','—','˜','™','š','›', + 'œ','ž','Ÿ' ); $With = array( ''','"','<','>', - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' + '€','‚','ƒ','„','…','†','‡','ˆ', + '‰','Š','‹','Œ','Ž','‘','’','“', + '”','•','–','—','˜','™','š','›', + 'œ','ž','Ÿ' ); - $Str = str_replace($Replace,$With,$Str); + $Str = str_replace($Replace, $With, $Str); } return $Str; } @@ -83,7 +89,7 @@ function make_utf8($Str) { $Encoding = 'UTF-8'; } if (empty($Encoding)) { - $Encoding = mb_detect_encoding($Str,'UTF-8, ISO-8859-1'); + $Encoding = mb_detect_encoding($Str, 'UTF-8, ISO-8859-1'); } if (empty($Encoding)) { $Encoding = 'ISO-8859-1'; @@ -91,7 +97,7 @@ function make_utf8($Str) { if ($Encoding == 'UTF-8') { return $Str; } else { - return @mb_convert_encoding($Str,'UTF-8',$Encoding); + return @mb_convert_encoding($Str, 'UTF-8', $Encoding); } } } @@ -119,7 +125,7 @@ function display_array($Array, $Escape = array()) { return $Array; } -header('Expires: '.date('D, d M Y H:i:s', time()+(2*60*60)).' GMT'); +header('Expires: '.date('D, d M Y H:i:s', time() + (2 * 60 * 60)).' GMT'); header('Last-Modified: '.date('D, d M Y H:i:s').' GMT'); header('Content-type: text/xml'); echo ''; diff --git a/classes/file_checker.class.php b/classes/file_checker.class.php index 90e5ea8f..e2b81625 100644 --- a/classes/file_checker.class.php +++ b/classes/file_checker.class.php @@ -27,8 +27,13 @@ function check_name($Name) { if (preg_match('/INCOMPLETE~\*/i', $Name)) { forbidden_error($Name); } - if (preg_match('/[:?]/', $Name, $Matches)) { - character_error($Matches[0]); + // Disallow the following characters, which are invalid in NTFS on Windows systems. + // : ? / < > \ * | " + $AllBlockedChars = ' : ? / < > \ * | " '; + // Only the following characters need to be escaped: + // \ - ^ ] + if (preg_match('/[\/\\:?<>*|"]*/', $Name, $Matches)) { + character_error($Matches[0], $AllBlockedChars); } } @@ -38,8 +43,7 @@ function check_extensions($Type, $Name) { if (!isset($MusicExtensions[get_file_extension($Name)])) { invalid_error($Name); } - } - elseif ($Type == 'Comics') { + } elseif ($Type == 'Comics') { if (!isset($ComicsExtensions[get_file_extension($Name)])) { invalid_error($Name); } @@ -60,7 +64,7 @@ function forbidden_error($Name) { $Err = 'The torrent contained one or more forbidden files (' . display_str($Name) . ')'; } -function character_error($Character) { +function character_error($Character, $AllBlockedChars) { global $Err; - $Err = "One or more of the files in the torrent has a name that contains the forbidden character '$Character'. Please rename the files as necessary and recreate the torrent."; + $Err = "One or more of the files in the torrent has a name that contains the forbidden character '$Character'. Please rename the files as necessary and recreate the torrent.\n\nNote: The complete list of characters that are disallowed are shown below:\n\n\t$AllBlockedChars"; } diff --git a/classes/text.class.php b/classes/text.class.php index 5f1b721c..c05367eb 100644 --- a/classes/text.class.php +++ b/classes/text.class.php @@ -915,9 +915,13 @@ private function smileys ($Str) { } /* -//Uncomment this part to test the class via command line: -function display_str($Str) {return $Str;} -function check_perms($Perm) {return true;} +// Uncomment this part to test the class via command line: +function display_str($Str) { + return $Str; +} +function check_perms($Perm) { + return true; +} $Str = "hello [pre]http://anonym.to/?http://whatshirts.portmerch.com/ ====hi==== diff --git a/classes/util.php b/classes/util.php index 263ef91c..d8addd08 100644 --- a/classes/util.php +++ b/classes/util.php @@ -82,7 +82,7 @@ function send_irc($Raw) { * @param boolean $Ajax If true, the header/footer won't be shown, just the description. * @param string $Log If true, the user is given a link to search $Log in the site log. */ -function error($Error, $Ajax=false, $Log=false) { +function error($Error, $Ajax = false, $Log = false) { global $Debug; require(SERVER_ROOT.'/sections/error/index.php'); $Debug->profile(); diff --git a/feeds.php b/feeds.php index faee37fe..37323763 100644 --- a/feeds.php +++ b/feeds.php @@ -23,39 +23,56 @@ function check_perms() { } function is_number($Str) { - if ($Str < 0) { return false; } + if ($Str < 0) { + return false; + } // We're converting input to a int, then string and comparing to original return ($Str == strval(intval($Str)) ? true : false); } function display_str($Str) { - if ($Str!="") { - $Str=make_utf8($Str); - $Str=mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8"); - $Str=preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&",$Str); + if ($Str != '') { + $Str = make_utf8($Str); + $Str = mb_convert_encoding($Str, 'HTML-ENTITIES', 'UTF-8'); + $Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str); $Replace = array( "'",'"',"<",">", - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' + '€','‚','ƒ','„','…','†','‡','ˆ', + '‰','Š','‹','Œ','Ž','‘','’','“', + '”','•','–','—','˜','™','š','›', + 'œ','ž','Ÿ' ); - $With=array( + $With = array( ''','"','<','>', - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' + '€','‚','ƒ','„','…','†','‡','ˆ', + '‰','Š','‹','Œ','Ž','‘','’','“', + '”','•','–','—','˜','™','š','›', + 'œ','ž','Ÿ' ); - $Str=str_replace($Replace,$With,$Str); + $Str = str_replace($Replace, $With, $Str); } return $Str; } function make_utf8($Str) { - if ($Str!="") { - if (is_utf8($Str)) { $Encoding="UTF-8"; } - if (empty($Encoding)) { $Encoding=mb_detect_encoding($Str,'UTF-8, ISO-8859-1'); } - if (empty($Encoding)) { $Encoding="ISO-8859-1"; } - if ($Encoding=="UTF-8") { return $Str; } - else { return @mb_convert_encoding($Str,"UTF-8",$Encoding); } + if ($Str != '') { + if (is_utf8($Str)) { + $Encoding = 'UTF-8'; + } + if (empty($Encoding)) { + $Encoding = mb_detect_encoding($Str, 'UTF-8, ISO-8859-1'); + } + if (empty($Encoding)) { + $Encoding = 'ISO-8859-1'; + } + if ($Encoding == 'UTF-8') { + return $Str; + } else { + return @mb_convert_encoding($Str, 'UTF-8', $Encoding); + } } } @@ -75,7 +92,7 @@ function is_utf8($Str) { function display_array($Array, $Escape = array()) { foreach ($Array as $Key => $Val) { - if((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) { + if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) { $Array[$Key] = display_str($Val); } } @@ -84,7 +101,7 @@ function display_array($Array, $Escape = array()) { header('Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0'); header('Pragma:'); -header('Expires: '.date('D, d M Y H:i:s', time()+(2*60*60)).' GMT'); +header('Expires: '.date('D, d M Y H:i:s', time() + (2 * 60 * 60)).' GMT'); header('Last-Modified: '.date('D, d M Y H:i:s').' GMT'); $Feed->UseSSL = (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443); diff --git a/image.php b/image.php index e4d8f8ac..98382ecb 100644 --- a/image.php +++ b/image.php @@ -1,8 +1,8 @@ decrypt($_COOKIE['session']); + $LoginCookie = $Enc->decrypt($_COOKIE['session']); } if (isset($LoginCookie)) { - list($SessionID, $UserID) = explode("|~|",$Enc->decrypt($LoginCookie)); + list($SessionID, $UserID) = explode('|~|', $Enc->decrypt($LoginCookie)); $UserID = (int)$UserID; - $UserInfo = $Cache->get_value('user_info_'.$UserID); + $UserInfo = $Cache->get_value("user_info_$UserID"); $Permissions = $Cache->get_value('perm_'.$UserInfo['PermissionID']); } @@ -55,7 +55,7 @@ function invisible($Image) { } $TotalAlpha = 0; for ($i = 0; $i < $Count; ++$i) { - $Color = imagecolorsforindex($Image,$i); + $Color = imagecolorsforindex($Image, $i); $TotalAlpha += $Color['alpha']; } return (($TotalAlpha/$Count) == 127) ? true : false; @@ -77,19 +77,19 @@ function verysmall($Image) { } function image_type($Data) { - if (!strncmp($Data,'GIF',3)) { + if (!strncmp($Data, 'GIF', 3)) { return 'gif'; } - if (!strncmp($Data,pack('H*','89504E47'),4)) { + if (!strncmp($Data, pack('H*', '89504E47'), 4)) { return 'png'; } - if (!strncmp($Data,pack('H*','FFD8'),2)) { + if (!strncmp($Data, pack('H*', 'FFD8'), 2)) { return 'jpeg'; } - if (!strncmp($Data,'BM',2)) { + if (!strncmp($Data, 'BM', 2)) { return 'bmp'; } - if (!strncmp($Data,'II',2) || !strncmp($Data,'MM',2)) { + if (!strncmp($Data, 'II', 2) || !strncmp($Data, 'MM', 2)) { return 'tiff'; } } @@ -108,10 +108,12 @@ function image_height($Type, $Data) { $Str []= "Started 4, + ".$Block['Length']; while ($Data != '') { // iterate through the blocks until we find the start of frame marker (FFC0) $Block = unpack('CBlock/CType/nLength', $Data); // Get info about the block - if ($Block['Block'] != '255') { break; } // We should be at the start of a new block + if ($Block['Block'] != '255') { // We should be at the start of a new block + break; + } if ($Block['Type'] != '192') { // C0 $Data = substr($Data, $Block['Length'] + 2); // Next block - $Str []= "Started ".$i.", + ".($Block['Length'] + 2); + $Str []= "Started $i, + ".($Block['Length'] + 2); $i += ($Block['Length'] + 2); } else { // We're at the FFC0 block $Data = substr($Data, 5); // Skip FF C0 Length(2) precision(1) @@ -150,31 +152,31 @@ function send_pm($ToID, $FromID, $Subject, $Body, $ConvID = '') { INSERT INTO pm_conversations_users (UserID, ConvID, InInbox, InSentbox, SentDate, ReceivedDate, UnRead) VALUES - ('$ToID', '$ConvID', '1','0','".sqltime()."', '".sqltime()."', '1')"); + ('$ToID', '$ConvID', '1', '0', '".sqltime()."', '".sqltime()."', '1')"); if ($FromID != 0) { $DB->query(" INSERT INTO pm_conversations_users (UserID, ConvID, InInbox, InSentbox, SentDate, ReceivedDate, UnRead) VALUES - ('$FromID', '$ConvID', '0','1','".sqltime()."', '".sqltime()."', '0')"); + ('$FromID', '$ConvID', '0', '1', '".sqltime()."', '".sqltime()."', '0')"); } } else { $DB->query(" UPDATE pm_conversations_users SET - InInbox='1', - UnRead='1', - ReceivedDate='".sqltime()."' - WHERE UserID='$ToID' - AND ConvID='$ConvID'"); + InInbox = '1', + UnRead = '1', + ReceivedDate = '".sqltime()."' + WHERE UserID = '$ToID' + AND ConvID = '$ConvID'"); $DB->query(" UPDATE pm_conversations_users SET - InSentbox='1', - SentDate='".sqltime()."' - WHERE UserID='$FromID' - AND ConvID='$ConvID'"); + InSentbox = '1', + SentDate = '".sqltime()."' + WHERE UserID = '$FromID' + AND ConvID = '$ConvID'"); } $DB->query(" INSERT INTO pm_messages @@ -186,20 +188,20 @@ function send_pm($ToID, $FromID, $Subject, $Body, $ConvID = '') { /*$DB->query(" SELECT UnRead FROM pm_conversations_users - WHERE ConvID='$ConvID' - AND UserID='$ToID'"); + WHERE ConvID = '$ConvID' + AND UserID = '$ToID'"); */ $DB->query(" SELECT COUNT(ConvID) FROM pm_conversations_users WHERE UnRead = '1' - AND UserID='$ToID' + AND UserID = '$ToID' AND InInbox = '1'"); list($UnRead) = $DB->next_record(MYSQLI_BOTH, FALSE); - $Cache->cache_value('inbox_new_'.$ToID, $UnRead); + $Cache->cache_value("inbox_new_$ToID", $UnRead); //if ($UnRead == 0) { - // $Cache->increment('inbox_new_'.$ToID); + // $Cache->increment("inbox_new_$ToID"); //} return $ConvID; } @@ -216,20 +218,26 @@ function display_str($Str) { } if ($Str != '' && !is_number($Str)) { $Str = make_utf8($Str); - $Str = mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8"); - $Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&",$Str); + $Str = mb_convert_encoding($Str, 'HTML-ENTITIES', 'UTF-8'); + $Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str); $Replace = array( "'",'"',"<",">", - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' + '€','‚','ƒ','„','…','†','‡','ˆ', + '‰','Š','‹','Œ','Ž','‘','’','“', + '”','•','–','—','˜','™','š','›', + 'œ','ž','Ÿ' ); $With = array( ''','"','<','>', - '€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ' + '€','‚','ƒ','„','…','†','‡','ˆ', + '‰','Š','‹','Œ','Ž','‘','’','“', + '”','•','–','—','˜','™','š','›', + 'œ','ž','Ÿ' ); - $Str = str_replace($Replace,$With,$Str); + $Str = str_replace($Replace, $With, $Str); } return $Str; } diff --git a/sections/collages/artist_collage.php b/sections/collages/artist_collage.php index 86edee21..a88027ff 100644 --- a/sections/collages/artist_collage.php +++ b/sections/collages/artist_collage.php @@ -142,7 +142,7 @@
Stats
@@ -288,5 +288,5 @@ cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)), 3600); +$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600); ?> diff --git a/sections/collages/torrent_collage.php b/sections/collages/torrent_collage.php index 19a7f8ea..086c34a7 100644 --- a/sections/collages/torrent_collage.php +++ b/sections/collages/torrent_collage.php @@ -385,7 +385,7 @@
  • Artists:
  • -
  • Subscribers:
  • +
  • Subscribers:
  • Built by user 1 ? 's' : '')?>
  • Last updated:
  • @@ -569,5 +569,5 @@ cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)), 3600); +$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600); ?> diff --git a/sections/donate/complete.php b/sections/donate/complete.php index 0a09f938..43d20a27 100644 --- a/sections/donate/complete.php +++ b/sections/donate/complete.php @@ -7,7 +7,7 @@

    Donation Complete

    -

    Thank you for your donation! If this is your first time donating you will now have received 2 invitations and a Donor.

    +

    Thank you for your donation! If this is your first time donating, you will have received two (2) invitations and a Donor.

    diff --git a/sections/torrents/details.php b/sections/torrents/details.php index 0ffcb3a6..9bf93f68 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -689,7 +689,7 @@ function filelist($Str) { - +
    @@ -702,7 +702,7 @@ function filelist($Str) { = 345678 && time() - strtotime($LastReseedRequest) >= 864000) || check_perms('users_mod')) { ?> + if (($Seeders === 0 && $LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) || check_perms('users_mod')) { ?>
    Request re-seed @@ -783,15 +783,15 @@ function filelist($Str) {
    get_value('torrent_collages_'.$GroupID); +$Collages = $Cache->get_value("torrent_collages_$GroupID"); if (!is_array($Collages)) { $DB->query(" SELECT c.Name, c.NumTorrents, c.ID FROM collages AS c - JOIN collages_torrents AS ct ON ct.CollageID=c.ID - WHERE ct.GroupID='$GroupID' - AND Deleted='0' - AND CategoryID!='0'"); + JOIN collages_torrents AS ct ON ct.CollageID = c.ID + WHERE ct.GroupID = '$GroupID' + AND Deleted = '0' + AND CategoryID != '0'"); $Collages = $DB->to_array(); $Cache->cache_value('torrent_collages_'.$GroupID, $Collages, 3600 * 6); } @@ -833,17 +833,17 @@ function filelist($Str) { get_value('torrent_collages_personal_'.$GroupID); +$PersonalCollages = $Cache->get_value("torrent_collages_personal_$GroupID"); if (!is_array($PersonalCollages)) { $DB->query(" SELECT c.Name, c.NumTorrents, c.ID FROM collages AS c - JOIN collages_torrents AS ct ON ct.CollageID=c.ID - WHERE ct.GroupID='$GroupID' - AND Deleted='0' - AND CategoryID='0'"); + JOIN collages_torrents AS ct ON ct.CollageID = c.ID + WHERE ct.GroupID = '$GroupID' + AND Deleted = '0' + AND CategoryID = '0'"); $PersonalCollages = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('torrent_collages_personal_'.$GroupID, $PersonalCollages, 3600 * 6); + $Cache->cache_value("torrent_collages_personal_$GroupID", $PersonalCollages, 3600 * 6); } if (count($PersonalCollages) > 0) { @@ -894,14 +894,14 @@ function filelist($Str) { // --- Comments --- // gets the amount of comments for this group -$Results = $Cache->get_value('torrent_comments_'.$GroupID); +$Results = $Cache->get_value("torrent_comments_$GroupID"); if ($Results === false) { $DB->query(" SELECT COUNT(c.ID) FROM torrents_comments as c WHERE c.GroupID = '$GroupID'"); list($Results) = $DB->next_record(); - $Cache->cache_value('torrent_comments_'.$GroupID, $Results, 0); + $Cache->cache_value("torrent_comments_$GroupID", $Results, 0); } if (isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) { @@ -911,9 +911,9 @@ function filelist($Str) { WHERE GroupID = $GroupID AND ID <= $_GET[postid]"); list($PostNum) = $DB->next_record(); - list($Page, $Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum); + list($Page, $Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE, $PostNum); } else { - list($Page, $Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$Results); + list($Page, $Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE, $Results); } //Get the cache catalogue @@ -923,7 +923,7 @@ function filelist($Str) { //---------- Get some data to start processing // Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page -$Catalogue = $Cache->get_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID); +$Catalogue = $Cache->get_value("torrent_comments_{$GroupID}_catalogue_$CatalogueID"); if ($Catalogue === false) { $DB->query(" SELECT @@ -935,12 +935,12 @@ function filelist($Str) { c.EditedTime, u.Username FROM torrents_comments as c - LEFT JOIN users_main AS u ON u.ID=c.EditedUserID + LEFT JOIN users_main AS u ON u.ID = c.EditedUserID WHERE c.GroupID = '$GroupID' ORDER BY c.ID LIMIT $CatalogueLimit"); - $Catalogue = $DB->to_array(false,MYSQLI_ASSOC); - $Cache->cache_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID, $Catalogue, 0); + $Catalogue = $DB->to_array(false, MYSQLI_ASSOC); + $Cache->cache_value("torrent_comments_{$GroupID}_catalogue_$CatalogueID", $Catalogue, 0); } //This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue @@ -969,9 +969,9 @@ function filelist($Str) {
    # - - Quote + - Quote - - Edit + - Edit - Delete @@ -1015,7 +1015,7 @@ function filelist($Str) { « Last edited by - +
    diff --git a/sections/torrents/merge.php b/sections/torrents/merge.php index db521e3a..5845a218 100644 --- a/sections/torrents/merge.php +++ b/sections/torrents/merge.php @@ -111,6 +111,8 @@ $DB->query("DELETE FROM collages_torrents WHERE GroupID='$OldGroupID' AND CollageID='$CollageID'"); $Cache->delete_value('collage_'.$CollageID); } + $Cache->delete_value('torrent_collages_'.$NewGroupID); + $Cache->delete_value('torrent_collages_personal_'.$NewGroupID); //Requests $DB->query("SELECT ID FROM requests WHERE GroupID='$OldGroupID'"); diff --git a/sections/torrents/reseed.php b/sections/torrents/reseed.php index 1b1dc22e..b50d5847 100644 --- a/sections/torrents/reseed.php +++ b/sections/torrents/reseed.php @@ -35,9 +35,10 @@ $Name .= $GroupName; $DB->query(" - SELECT uid, tstamp + SELECT uid, MAX(tstamp) AS tstamp FROM xbt_snatched WHERE fid='$TorrentID' + GROUP BY uid ORDER BY tstamp DESC LIMIT 10"); if ($DB->record_count() > 0) {