From 08cb7c2eb842ae29a879d617117f35d68fef585c Mon Sep 17 00:00:00 2001 From: Git Date: Fri, 10 Aug 2012 08:00:14 +0000 Subject: [PATCH] Empty commit --- sections/torrents/details.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sections/torrents/details.php b/sections/torrents/details.php index b99052c7..f79d8b45 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -5,6 +5,7 @@ function compare($X, $Y){ } define('MAX_PERS_COLLAGES', 3); // How many personal collages should be shown by default +define('MAX_COLLAGES', 5); // How many normal collages should be shown by default include(SERVER_ROOT.'/sections/bookmarks/functions.php'); // has_bookmarked() include(SERVER_ROOT.'/classes/class_text.php'); @@ -646,19 +647,38 @@ function filelist($Str) { $Cache->cache_value('torrent_collages_'.$GroupID, $Collages, 3600*6); } if(count($Collages)>0) { + if (count($Collages) > MAX_COLLAGES) { + // Pick some at random + $Range = range(0,count($Collages) - 1); + shuffle($Range); + $Indices = array_slice($Range, 0, MAX_COLLAGES); + $SeeAll = ' (See all)'; + } else { + $Indices = range(0, count($Collages)-1); + $SeeAll = ''; + } ?> - + - + + + + +
Collage nameThis album is in collage1)?'s':'')?> # torrents
0) { if (count($PersonalCollages) > MAX_PERS_COLLAGES) { - // Pick 5 at random + // Pick some at random $Range = range(0,count($PersonalCollages) - 1); shuffle($Range); $Indices = array_slice($Range, 0, MAX_PERS_COLLAGES);