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 name | +This album is in =count($Collages)?> collage=((count($Collages)>1)?'s':'')?>=$SeeAll?> | # torrents |
=$CollageName?> | =$CollageTorrents?> |