/*************************************************************************** * copyright : (C) 2003 Bruno Haller * email : bruno@hil.net * * $Id: view.php,v 1.15 2003/04/02 18:42:06 brunohaller Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ require('./start.inc.php'); $image = url_image(base64_decode($_GET["path"]), true); $permissions = get_permissions($image['rel']); if (!$permissions['view']) { sendLoginForm(); } db_connect(); if ($is_admin && $_GET['action'] == 'savedesc') { mysql_query("UPDATE " . $config['mysql']['tableprefix'] . "images SET description = '" . $_POST['description'] . "' WHERE hash = '" . $image['filehash'] . "'"); } $resource = mysql_query("SELECT * FROM " . $config['mysql']['tableprefix'] . "images WHERE hash = '" . $image['filehash'] . "'"); if ($result = mysql_fetch_array($resource)) { $description = $result['description']; $views = $result['views']; if ($_GET['action'] == 'count') { mysql_query("UPDATE " . $config['mysql']['tableprefix'] . "images SET views = views + 1 WHERE hash = '" . $image['filehash'] . "'"); $views++; } } else { mysql_query("INSERT INTO " . $config['mysql']['tableprefix'] . "images (hash, views) VALUES ('" . $image['filehash'] . "', 1)"); $views = 1; } $path = substr($image['abs'], 0, strrpos($image['abs'], '/')) . '/'; $tmp = base64_decode($_GET['path']); $relpath = substr($tmp, 0, strrpos($tmp, '/')) . '/'; $filename = basename(base64_decode($_GET['path'])); list($directories, $images) = read_dir($path); $imagecount = count($images); $currimage = array_search($filename, $images); if ($config['design']['viewinline']) { require('./header.inc.php'); } else { ?>
$imagesize = getimagesize($image['abs']); if ($config['design']['maxwidth'] > 0 && $imagesize[0] > $config['design']['maxwidth']) { $imagesize[0] = $config['design']['maxwidth']; } if ($config['design']['maxheight'] > 0 && $imagesize[1] > $config['design']['maxheight']) { $imagesize[1] = $config['design']['maxheight']; } ?> } ?>if ($config['design']['viewinline']) { ?>[ echo $lang['index.root'] ?>] $dir_tree = explode('/', $image['rel']); for ($i = 1; $i < count($dir_tree); $i++) { $browse_path = "/"; for ($j = 1; $j <= $i; $j++) { $browse_path .= $dir_tree[$j] . "/"; } if ($i < count($dir_tree) - 1) { ?> / echo cutoff($dir_tree[$i]) ?> } else { echo " / " . cutoff($dir_tree[$i]); } } } else { echo cutoff($filename); } ?> | if ($currimage > 0) { $navlinks .= "" . $lang['view.previous'] . " | "; } $navlinks .= ($currimage + 1) . ' / ' . $imagecount; if ($currimage < $imagecount - 1) { $navlinks .= " | " . $lang['view.next'] . ""; } echo $navlinks; ?> |
echo $lang['view.download'] ?> if ($is_admin) { ?> | &action=editdesc" class="nav2"> echo $lang['view.editdesc'] ?> } ?> | echo $lang['view.views'] ?>: echo $views ?> | |
if ($is_admin && $_GET['action'] == 'editdesc') { ?> } else if ($description != "") { echo nl2br($description); } ?> | |
if ($config['design']['viewinline']) {
?>
|
|
© 2006 www.jennybauer.de | echo $navlinks ?> |