From fcc940d4945b2f4d4df8a36cf104ebb2dd5dbb59 Mon Sep 17 00:00:00 2001 From: mgroeninger Date: Wed, 25 May 2005 02:22:30 +0000 Subject: [PATCH] Changes to serendipity_displayImageList to allow passing of argument to restrict folder. Change to serendipity_displayImageList to use absolute path for images so that function can be used in permalink pages below main directory level. --- include/functions_images.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/functions_images.inc.php b/include/functions_images.inc.php index 2eea3a3..b8967e9 100644 --- a/include/functions_images.inc.php +++ b/include/functions_images.inc.php @@ -869,7 +869,7 @@ function serendipity_calculate_aspect_size($width, $height, $newwidth) { return array($newwidth, $newheight); } -function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = false, $url = NULL, $show_upload = false) { +function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = false, $url = NULL, $show_upload = false, $limit_path = NULL) { global $serendipity; $sort_row_interval = array(8, 16, 50, 100); $sortParams = array('perpage', 'order', 'ordermode'); @@ -897,7 +897,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa } } - $serendipity['GET']['only_path'] = serendipity_uploadSecure($serendipity['GET']['only_path'], true); + $serendipity['GET']['only_path'] = serendipity_uploadSecure($limit_path . $serendipity['GET']['only_path'], true); $serendipity['GET']['only_filename'] = str_replace(array('*', '?'), array('%', '_'), $serendipity['GET']['only_filename']); $perPage = (!empty($serendipity['GET']['sortorder']['perpage']) ? $serendipity['GET']['sortorder']['perpage'] : $sort_row_interval[0]); @@ -917,7 +917,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa $linkPrevious = '?' . $extraParems . 'serendipity[page]=' . ($page-1); $linkNext = '?' . $extraParems . 'serendipity[page]=' . ($page+1); $sort_order = serendipity_getImageFields(); - $paths = serendipity_traversePath($serendipity['serendipityPath'] . $serendipity['uploadPath']); + $paths = serendipity_traversePath($serendipity['serendipityPath'] . $serendipity['uploadPath']. $limit_path); if (is_null($lineBreak)) { $lineBreak = floor(750 / ($serendipity['thumbSize'] + 20)); @@ -938,9 +938,9 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa @@ -1020,13 +1020,13 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa /* If it is an image, and the thumbnail exists */ if ($is_image && file_exists($img)) { - $preview .= ''. $file['name'] . ''; + $preview .= ''. $file['name'] . ''; if ($url) { $preview = ''. $preview .''; } } elseif ($is_image && $file['hotlink']) { $sizes = serendipity_calculate_aspect_size($file['dimensions_width'], $file['dimensions_height'], $serendipity['thumbSize']); - $preview .= ''. $file['name'] . ''; + $preview .= ''. $file['name'] . ''; if ($url) { $preview = ''. $preview .''; } -- 2.39.5