<html>
<head>
<title>SCAR:RED GALLERY</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#666666" text="#CC0000" link="#CC0000" vlink="#CC0000" alink="#CC0000">
<table width="99%" height="398" border="3" align="center" cellspacing="5" bordercolor="#333333">
<tr valign="top" bgcolor="#000000">
<td height="134"><div align="center"><img src="Skull.jpg" width="77" height="105" align="top" />
<img src="LOGO.gif" width="464" height="130" align="top" /><img src="Skull.jpg" width="77" height="105" align="top" /></div></td>
</tr>
<tr bgcolor="#000000">
<td width="18%" height="23" valign="top"><p align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="862" height="32">
<param name="movie" value="ScarredMenu.swf">
<param name="quality" value="high"><param name="BGCOLOR" value="#000000">
<embed src="ScarredMenu.swf" width="862" height="32" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#000000"></embed>
</object>
</p></td>
</tr>
<tr bgcolor="#000000">
<td height="200" valign="top"><div align="center"><br>
<table width="95%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="33%"><div align="left"><a href='<?php echo $prevlink ?>'><img src="ImagePrev.gif" width="171" height="45" alt="Previous" border="0"></a></div></td>
<td width="34%"><div align="center"><a href='<?php echo $returnlink ?>'><img src="ImageReturn.gif" width="121" height="45" alt="Return to Gallery" border="0"></a></div></td>
<td width="33%"><div align="right"><a href='<?php echo $nextlink ?>'><img src="ImageNext.gif" width="120" height="45" alt="Next" border="0"></a></div></td>
</tr>
</table>
<p>
<?php
$getlocation = mysql_result(mysql_query("SELECT image_location FROM Galleries WHERE image_id='$imageid'",$connection),0);
$watermark = imagecreatefrompng('Watermark.png');
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
$image = imagecreatetruecolor($watermark_width, $watermark_height);
$image = imagecreatefromjpeg('Photos/'.$getlocation);
$size = getimagesize('Photos/'.$getlocation);
$dest_x = $size[0] - $watermark_width - 5;
$dest_y = $size[1] - $watermark_height - 5;
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);
imagejpeg($image);
imagedestroy($image);
imagedestroy($watermark);
$getcomments = mysql_query("SELECT *, DATE_FORMAT(comment_date, '%d/%m/%Y') AS date1, TIME_FORMAT(comment_time, '%h:%i%p') AS time1 FROM ImageComments WHERE image_id='$imageid' ORDER BY comment_date DESC, comment_time DESC",$connection) or die(mysql_error());
$nocomments = mysql_num_rows($getcomments);
if ($nocomments==0) {
echo "<i><a href='ImageComment.php?phid=$imageid'>Be the first to make a comment about this photo here</a></i><br><br>";
}else{
echo "<table width='50%' align='center' border='1' cellpadding='5' cellspacing='0'>";
while ($getcoms=mysql_fetch_array($getcomments)) {
$comment_from = $getcoms['comment_from'];
$comment_date = $getcoms['date1'];
$comment_time = $getcoms['time1'];
$comment_comment = $getcoms['comment'];
$echocomms .= "<tr><td valign='top'><font size='-1' color='#999999'><b>$comment_from says: (posted on $comment_date at $comment_time)</font></b><br><br><font color='#999999'>$comment_comment</font></td></tr>";
}
echo $echocomms;
echo "<tr><td align='center'><font size='-1'><i><a href='ImageComment.php?phid=$imageid'>Leave a Comment...</a></i></font></td></tr></table><br>";
}
?>
</p>
</div></td></tr>
</table>
</body>
</html>