photo gallery
Posted: Fri Nov 23, 2012 9:34 pm
Hello,
in this photo gallery I am trying to get the thumbnails and full image on the same page but it is not working good.
This is the address of my site http://www.robcnossen.nl/login/view_alb ... album_id=5.
The design comes later.
Maybe you have seen what the problem is, the full image is not showing up in the rectangle when you open this page and when you click on a thumbnail the full image is showing up but then the thumbnail-box is empty.
When I clicked on a thumbnail the ?album_id=5 part disappears so I am out of this album and the thumbnails are away.
My questions are, how can I display a full image when I open this page and how can I not make the thumbnails disappear when clicking on a thumbnail.
The code is;
Cheers
in this photo gallery I am trying to get the thumbnails and full image on the same page but it is not working good.
This is the address of my site http://www.robcnossen.nl/login/view_alb ... album_id=5.
The design comes later.
Maybe you have seen what the problem is, the full image is not showing up in the rectangle when you open this page and when you click on a thumbnail the full image is showing up but then the thumbnail-box is empty.
When I clicked on a thumbnail the ?album_id=5 part disappears so I am out of this album and the thumbnails are away.
My questions are, how can I display a full image when I open this page and how can I not make the thumbnails disappear when clicking on a thumbnail.
The code is;
<?php include 'core/init.php'; if (isset($_GET['album_id'])) { $album_id = $_GET['album_id']; $album_data = album_data($album_id, 'name', 'description'); echo '<h3>', $album_data['name'], '</h3><p>', $album_data['description'], '</p>'; $images = get_images($album_id); } <div id="wrap"> <div id="sidebarleft"> <?php if (empty($images)) { echo 'Er zijn geen foto\'s in dit album'; } else { foreach ($images as $image) { echo'<a href="?full_img=uploads/', $image['album'], '/', $image['id'], '.', $image['ext'], '"><img src="uploads/thumbs/', $image['album'], '/', $image['id'], '.', $image['ext'], '" title="" /></a> <a href="delete_image.php?image_id=', $image['id'],'">x</a> '; } } ?> </div> <div id="imagecontainer"> <div id="image"> <?php $full_image=(isset($_GET['full_img'])) ? $_GET['full_img'] : $images[0]; echo'<a href="?full_img=uploads/', $image['album'], '/', $image['id'], '.', $image['ext'], '"><img src="',htmlentities($full_image), '" title="" />'; ?>Maybe not necessary but this is the code to make the albums with;
<?php $albums = get_albums(); if (empty($albums)) { echo '<p>Je hebt nog geen album</p>'; } else { foreach ($albums as $album) { echo '<p><a href="view_album.php?album_id=', $album['id'], '">', $album['name'], '</a> (', $album['count'], ' foto\'s)<br /> ', $album['description'], '...<br /> <a href="edit_album.php?album_id=', $album['id'], '">bewerken</a> / <a href="delete_album.php?album_id=', $album['id'], '">Verwijderen</a> </p>'; } } ?>
Cheers