<?php
/*
* buzzword
* Copyright (c) 2003 Jon Tai
*
* $Id: image.php,v 1.14 2004/01/28 23:10:03 jon Exp $
*
* This file is part of buzzword.
*
* buzzword 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.
*
* buzzword is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with buzzword; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once './config.inc';
$image = new gallery_image(import_gallery_image_key());
if (!$image->exists())
display_error('image does not exist');
$BUZZWORD_BREADCRUMBS = get_gallery_breadcrumbs($image->parent);
$BUZZWORD_BREADCRUMBS[] = "<a href=\"image.php?i={$image->image_key}\">".$image->get_display_short_title()."</a>";
include_once '../includes/header.inc';
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td id="content">
<h1><?php echo $image->get_display_title(); ?></h1>
<div class="content-container">
<?php echo $image->get_display_description(); ?>
<p><img src="display.php?i=<?php echo $image->image_key; ?>" <?php echo $image->get_alt(); ?>
border="0" <?php echo $image->get_display_size(); ?>></p>
</div>
<?php
$comments = get_gallery_image_comments($image);
foreach ($comments as $comment) {
?>
<h1>comment by <?php echo $comment->get_display_author().' on '.$comment->get_display_date_created().' at '.$comment->get_display_time_created(); ?></h1>
<div class="content-container">
<h2><?php echo $comment->get_display_title(); ?></h2>
<?php echo $comment->get_display_body(); ?>
<?php if (defined('ADMIN_LOGGED_IN')) { ?>
<p><a href="delcomment.php?i=<?php echo $image->image_key; ?>&c=<?php echo $comment->comment_key; ?>">delete comment</a></p>
<?php } ?>
</div>
<?php
}
?>
<?php if ($image->parent->allow_comments) { ?>
<a name="comment"></a>
<h1>new comment</h1>
<div class="content-container">
<form method="post" action="newcomment.php">
<input type="hidden" name="i" value="<?php echo $image->image_key; ?>">
<p>author:<br>
<input type="text" name="author" class="input"></p>
<p>e-mail address:<br>
<input type="text" name="email" class="input"></p>
<p>comment title:<br>
<input type="text" name="title" class="input"></p>
<p>comment text:<br>
<textarea name="body" rows="10" cols="10" class="input"></textarea></p>
<p>comment is private:
<input type="checkbox" name="is_private"></p>
<p>do not display my e-mail address:
<input type="checkbox" name="email_is_private" checked></p>
<p><input type="submit" value="submit" class="submit"></p>
</form>
</div>
<?php } ?>
</td>
<td id="sidebar">
<h1>this image</h1>
<div class="sidebar-container">
<p>
<?php
echo $image->get_display_exif();
?>
</p>
<p>
<?php
echo "<a href=\"download.php?i={$image->image_key}\">download image</a><br>\n";
echo number_format(filesize($image->path))." bytes<br>\n";
?>
</p>
</div>
<h1>other images</h1>
<div class="sidebar-container">
<?php
if ($prev = get_prev_gallery_image($image)) {
echo "<p style=\"clear: both;\">\n";
echo "<a href=\"image.php?i={$prev->image_key}\"><img \n";
echo " src=\"thumb.php?i={$prev->image_key}\" ".$prev->get_alt()." \n";
echo " border=\"0\" ".$prev->get_thumb_half_size()." class=\"gallery-thumb-halfsize\"></a>\n";
echo "<a href=\"image.php?i={$prev->image_key}\">".$prev->get_display_short_title(get_pref('buzzword_short_title_length') - round(get_pref('gallery_thumb_width') / 16))."</a><br>\n";
echo "previous image<br>\n";
echo "</p>\n";
}
if ($next = get_next_gallery_image($image)) {
echo "<p style=\"clear: both;\">\n";
echo "<a href=\"image.php?i={$next->image_key}\"><img \n";
echo " src=\"thumb.php?i={$next->image_key}\" ".$next->get_alt()." \n";
echo " border=\"0\" ".$next->get_thumb_half_size()." class=\"gallery-thumb-halfsize\"></a>\n";
echo "<a href=\"image.php?i={$next->image_key}\">".$next->get_display_short_title(get_pref('buzzword_short_title_length') - round(get_pref('gallery_thumb_width') / 16))."</a><br>\n";
echo "next image<br>\n";
echo "</p>\n";
}
?>
</div>
<h1>other galleries</h1>
<div class="sidebar-container">
<p>
<?php
echo get_sidebar_gallery_galleries($image->parent);
?>
</p>
</div>
<?php
echo relevance_hook('gallery_image', $image->image_key);
?>
<?php if (defined('ADMIN_LOGGED_IN')) { ?>
<h1>administration</h1>
<div class="sidebar-container">
<p>
<a href="editimage.php?i=<?php echo $image->image_key; ?>">edit image</a><br>
<a href="rotate.php?i=<?php echo $image->image_key; ?>&r=90">rotate clockwise</a><br>
<a href="rotate.php?i=<?php echo $image->image_key; ?>&r=-90">rotate counter-clockwise</a><br>
<a href="../admin/preferences.php">preferences</a><br>
<a href="../admin/index.php?admin-logout=1">log out</a><br>
</p>
</div>
<?php } ?>
</td>
</tr>
</table>
<?php
include_once '../includes/footer.inc';
?>