@@ -702,7 +702,7 @@ function filelist($Str) {
}
}
- if (($Seeders === 0 &&$LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 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
}
@@ -715,14 +715,14 @@ function filelist($Str) {
} ?>
@@ -783,15 +783,15 @@ function filelist($Str) {
}
-$Collages = $Cache->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) {
}
-$PersonalCollages = $Cache->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) {
|
#=$PostID?>
=Users::format_username($AuthorID, true, true, true, true)?> =time_diff($AddedTime)?>
- - Quote
+ - Quote
if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
- - Edit
+ - Edit
}
if (check_perms('site_moderate_forums')) { ?>
- Delete
@@ -1015,7 +1015,7 @@ function filelist($Str) {
«
} ?>
Last edited by
- =Users::format_username($EditedUserID, false, false, false) ?> =time_diff($EditedTime,2,true,true)?>
+ =Users::format_username($EditedUserID, false, false, false) ?> =time_diff($EditedTime, 2, true, true)?>
} ?>
|
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) {