// // $Id: view.php,v 1.8 2004/10/06 20:00:37 jbyers Exp $ // ////////////////////////////////////////////////////////////////////////////// // Security // // include calls are based on static variables // file and image size are read from the filesystem; see FS READ // /////////////////////////////////////////////////////////////////////////////// // detail view // $INDEX -> index of image in directory file list // // fetch directory listing // $data = directory_data($PATH_BASEDIR, $IMAGE_DIR); // FS SEE FUNCTION // fetch size (file and image), exif data on current image // $image_size = getimagesize($data['files'][$INDEX]['path']); // FS READ $file_size = filesize($data['files'][$INDEX]['path']); // FS READ // optionally fetch exifer data // if ($CFG_use_exifer) { include_once 'exif.php'; $exif_data = read_exif_data_raw($data['files'][$INDEX]['path'], 0); } ////////////////////////////////////////////////////////////////////////////// // assign, display templates
// ////////////////////////////////////////////////////////////////////////////// // Security // // include calls are based on static variables. // // No other filesystem calls take place in this view. See // functions.php/directory_data() for directory listing validation. // /////////////////////////////////////////////////////////////////////////////// // list view // $INDEX -> page N of listings, based on $CFG_max_thumbs // // fetch directory listing // $data = directory_data($PATH, "{$IMAGE_DIR}{$IMAGE_FILE}"); // FS SEE FUNCTION // create pagination data // $total_images = sizeof($data['files']); $offset = $INDEX; $offset_prev = -1; $offset_next = -1; if ($offset > $total_images - 1 || $offset < 0) { $offset = 0; } if ($offset > 0 && $CFG_images_per_page != 0) { $offset_prev = max(0, $offset - $CFG_images_per_page); } if ($offset < $total_images - $CFG_images_per_page && $CFG_images_per_page != 0) { $offset_next = min($total_images - 1, $offset + $CFG_images_per_page);