Adding descriptions to Image Gallery?
Posted: Fri Jan 08, 2010 4:01 am
Hi everyone, first post!
I have started working on an image gallery for a website I am creating. The basic code I am using below works without any issues, but I would like to be able to add the following functionality
Thumbnails would have a short description below each one.
When a thumbnail is clicked, its associated full size image will appear in a Javascript-written pop-up containing the short description and also a long description.
I would like the descriptions to be stored in a flat file, without using MySQL as the server I am using does not allow MySQL.
This is the the code I have used to create my image gallery.
What would I need to add to this to allow the use of short and long descriptions?
Thank you in advance to anyone who can help me with this.
I have started working on an image gallery for a website I am creating. The basic code I am using below works without any issues, but I would like to be able to add the following functionality
Thumbnails would have a short description below each one.
When a thumbnail is clicked, its associated full size image will appear in a Javascript-written pop-up containing the short description and also a long description.
I would like the descriptions to be stored in a flat file, without using MySQL as the server I am using does not allow MySQL.
This is the the code I have used to create my image gallery.
Code: Select all
<?php
$a = '0';
$filepath = "thumb";
$url_path = "main";
$dir = dir($filepath);
echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" width=\"75%\">";
while($entry=$dir->read()) {
if($entry == "." || $entry == "..") {
continue;
}
$fp = @fopen("$filepath/$entry","r");
if ($a == '0') {echo "<tr>";}
if ($a == '5') {echo "<tr>";}
if ($a == '10') {echo "<tr>";}
if ($a == '15') {echo "<tr>";}
?><td>
<a href="<? echo "$url_path/$entry" ?>">
<img src="<? echo "$filepath/$entry" ?>" alt="<? echo $entry ?>"></a>
</td>
<?
$a = $a + 1;
}
?>
Thank you in advance to anyone who can help me with this.