getDirectory($selected_dir); if (!empty($list[1])) $list = array_values($list[1]); else $list = false; $back_url = get_url('album', $selected_dir); if (!empty($list)) { if ($selected_file) { $current = $f->getInfos($selected_file, $selected_dir); } else { $current = current($list); } } } elseif (!empty($selected_tag)) { $list = array_values($f->getByTag($selected_tag)); $back_url = get_url('tag', $selected_tag); if (!empty($list)) { if (!empty($current_index) && !empty($list[$current_index - 1])) { $current = $list[$current_index - 1]; } else { $current = current($list); } } } if (isset($_GET['hd']) || isset($_GET['zoom'])) { if (isset($_GET['hd'])) $hd = ! $hd; else $zoom = ! $zoom; setcookie('slideshow', ($zoom ? 'z' : '') . ($hd ? 'hd' : ''), time() + (3600 * 24 * 365), '/'); if (!empty($selected_tag)) { $current = $selected_tag . '/' . ($current_index); } header('Location: '.get_url($type, $current)); exit; } echo ' '.escape($title).' '; if (empty($list)) { echo '

'.__('No picture found.').'

'; } else { echo '
'; if (!empty($current['comment'])) { echo '

'.$f->formatText($current['comment']).'

'; } $url = get_url('real_image', $current); if (($mode == 'embed' || !$hd) && file_exists($f->getSmallPath($current['hash']))) { $url = get_url('cache_small', $current); } if ($current['width'] > MAX_IMAGE_SIZE || $current['height'] > MAX_IMAGE_SIZE) { echo '

'; echo __("This picture is too big (%W x %H) to be displayed in this page.", 'REPLACE', array('%W' => $current['width'], '%H' => $current['height'])); echo '

'; } else { if ($zoom || $hd) { echo '

'; } else { echo '

'; } echo ''.escape($current['filename']).''; echo '

'; } echo '
'; $index = array_search($current, $list); $prev = $index == 0 ? count($list) - 1 : $index - 1; $next = $index == (count($list) - 1) ? 0 : $index + 1; if (!empty($selected_tag)) { $prev = $selected_tag . '/' . ($prev + 1); $next = $selected_tag . '/' . ($next + 1); $current = $selected_tag . '/' . ($index + 1); } else { $prev = $list[$prev]; $next = $list[$next]; } echo ' '; } echo ' '; ?>