// Private pictures can only be seen by someone who is logged in } else { echo '<div id="photo' . $thisone->photo_id . '">'; echo ' <dt style="text-align:center;">Photo ' . htmlspecialchars($thisone->photo_id) . " </dt> \n"; echo '<div style="text-align:center;">'; if ($_SESSION['user_id'] == $thisone->user_id or $_SESSION['username'] == "Admin") { echo '<input type="button" value="Delete Photo" onclick="deletePic(' . $thisone->photo_id . ')">'; } echo '</div>'; echo '<dd style="text-align:center;"><a href="./view_full_size.php?photoid=' . $thisone->photo_id . '&filelocation=' . urlencode($thisone->filelocation) . ' &caption=' . $thisone->caption . '" target="_blank"><img src="' . $thisone->filelocation . ' " alt="Failure loading image" style="width:auto;height:auto;max-height:500px;max-width:500px;"/> </a><br />'; echo "<i> " . htmlspecialchars($thisone->caption) . " </i> \n"; $commentdata = GetPicComments($dbh, $thisone->photo_id); echo '<div id= "commentText' . $thisone->photo_id . '">'; foreach ($commentdata as $comments) { $uname = GetUsername($dbh, $comments->user_id); echo '<table class="center" id="commentTable' . $comments->comment_id . '">'; echo '<tr><td><strong>' . $uname . ':</strong> ' . $comments->comment_text; if ($uname == $_SESSION['username'] or $_SESSION['username'] == "Admin" or $_SESSION['user_id'] == $thisone->user_id) { echo '<input type="button" style="float:right;" value="Delete" onclick="deleteComment(' . $comments->comment_id . ')"/>'; } echo '</td></tr>'; echo '</table>'; } echo '</div>'; if (isset($_SESSION['username'])) { echo '<table class="center">';
?> <div id="body2"> <p>This page is just used to show pictures in full size with their comments.<br /> Some of the pictures look a little weird if they are gigantic in size, but<br /> I chose to leave it the way it is.Deletion of photos/accounts must be done<br /> on previous page.</p> <?php echo '<div style="text-align:center"><p><strong>Photo ' . $_GET['photoid'] . '</strong></p></div>'; echo '<div style="text-align:center;"><img src="' . $_GET['filelocation'] . '" alt="Failure loading image"/></div><br />'; echo '<div style="text-align:center;"><em>' . $_GET['caption'] . '</em></div>'; include "/export/home/mclaug67/source_html/public_html/awp/PhotoSite/Connect-webuser.php"; include "DB_Functions.php"; $dbh = ConnectDB(); $commentdata = GetPicComments($dbh, $_GET['photoid']); echo '<div id= "commentText' . $_GET['photoid'] . '">'; foreach ($commentdata as $comments) { $uname = GetUsername($dbh, $comments->user_id); echo '<table class="center" id="commentTable' . $comments->comment_id . '">'; echo '<tr><td><strong>' . $uname . ':</strong> ' . $comments->comment_text; echo '</td></tr>'; echo '</table>'; } echo '</div>'; if (isset($_SESSION['username'])) { echo '<table class="center">'; echo "\n<tr><td>Add comment:"; echo '<input type="text" id="commentInput' . $_GET['photoid'] . '">'; echo '<input type="button" value="Comment" onclick="getComment(' . $_GET['photoid'] . ',' . $_SESSION['user_id'] . ')"/>';