<center>
<table cellpadding="0" cellspacing="0">
<tr>
<?php
$q = mysql_query("SELECT `id`, `imgtitle` FROM `pictures` WHERE `id`>'$id' ORDER by `id` ASC");
$num = mysql_numrows($q);
if($num>0) {
$row = mysql_fetch_array($q);
$link = make_link("pictures/$row[id]/", $row['imgtitle']);
echo "<td><a href=\"$link\"><img src=\"".site_url."images/back.gif\" border=\"0\"></a></td>\n";
}
if($prow['catid'] == 28){
$img = site_url."pictures/img_originals/".$prow['imgoriginalname'];
}else{
$img = site_url."pictures/img_pictures/".$prow['imgoriginalname'];
}
list($width, $height) = getimagesize($img);
$width=455;
$org = site_url."pictures/img_originals/".$prow['imgoriginalname'];
$get = site_url."get.php?id=".$prow['id'];
echo "<td><img src=\"$img\" style=\"border:3px;border-style:solid;border-color:#475167;padding:1px;background-color:#F5F5F5\" width=\"$width\">\n <br /> <a href=\"$get\">Запази изображението</a> <a target=\"blank\" href=\"$org\">Виж в оригинален размер</a></td>\n";
$q = mysql_query("SELECT `id`, `imgtitle` FROM `pictures` WHERE `id`<'$id' ORDER by `id` DESC");
$num = mysql_numrows($q);
if($num>0){
$row = mysql_fetch_array($q);
$link = make_link("pictures/$row[id]/", $row['imgtitle']);
echo "<td><a href=\"$link\"><img src=\"".site_url."images/next.gif\" border=\"0\"></a></td>\n"; }
?>
</tr>
</table>
</center>