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');
}
}
- $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]);
$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));
<tr>
<td><?php echo FILTER_DIRECTORY ?></td>
<td><select name="serendipity[only_path]">
- <option value=""><?php echo ALL_DIRECTORIES ?></option>
+ <option value=""> <?php if (!$limit_path) { echo ALL_DIRECTORIES; } else { echo basename($limit_path);}?></option>
<?php foreach ( $paths as $folder ) { ?>
- <option <?php echo ($serendipity['GET']['only_path'] == $folder['relpath']) ? 'selected="selected"' : '' ?> value="<?php echo $folder['relpath'] ?>"><?php echo str_repeat(' ', $folder['depth']*2) . ' '. $folder['name'] ?></option>
+ <option <?php echo ($serendipity['GET']['only_path'] == $limit_path.$folder['relpath']) ? 'selected="selected"' : '' ?> value="<?php echo $folder['relpath'] ?>"><?php echo str_repeat(' ', $folder['depth']*2) . ' '. $folder['name'] ?></option>
<?php } ?>
</select>
</td>
/* If it is an image, and the thumbnail exists */
if ($is_image && file_exists($img)) {
- $preview .= '<img src="' . $file['imgsrc'] . '" border="0" title="' . $file['path'] . $file['name'] . '" alt="'. $file['name'] . '" />';
+ $preview .= '<img src="' . $serendipity['serendipityHTTPPath'] . $file['imgsrc'] . '" border="0" title="' . $file['path'] . $file['name'] . '" alt="'. $file['name'] . '" />';
if ($url) {
$preview = '<a href="'. $url .'&serendipity[image]='. $file['id'] .'">'. $preview .'</a>';
}
} elseif ($is_image && $file['hotlink']) {
$sizes = serendipity_calculate_aspect_size($file['dimensions_width'], $file['dimensions_height'], $serendipity['thumbSize']);
- $preview .= '<img src="' . $file['path'] . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" border="0" title="' . $file['path'] . '" alt="'. $file['name'] . '" />';
+ $preview .= '<img src="' . $serendipity['serendipityHTTPPath'] . $file['path'] . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" border="0" title="' . $file['path'] . '" alt="'. $file['name'] . '" />';
if ($url) {
$preview = '<a href="'. $url .'&serendipity[image]='. $file['id'] .'">'. $preview .'</a>';
}