I have created a thumnail based image gallery link to two external directories i.e thumnails and large images. These are conected together via an external .txt file. All three of these are placed within one folder.
The gallery display works fine, however i can't figure out how to get the correct image name to display underneath the large display.
basically i dont know how to put two operations on one onClick function.
I originally atempted to link it to $start however this was not successful...Please HELP!!
this is the code:
<?php
function trim_value(&$value)
{
$value = trim($value);
}
$story_file = "$storytypeContent/story.txt";
$large_dir= "$storytypeContent/large/";
$num_rows = 4;
$photos_per_row = 3;
$photos_per_row_large = 1;
$num_rows_large = 1;
$photos = file($story_file);
$photos_large = file($story_file);
array_walk($photos_large, 'trim_value');
$photo_size_large = getimagesize("$photo");
$total_photos_large = sizeof($photos);
$photo_size = getimagesize("$photo");
$total_photos = sizeof($photos);
$photo_size_large = getimagesize("$large_photo");
$total_photos_large = sizeof($large_photos);
$photos_per_page = $num_rows * $photos_per_row;
$thumbnail_dir = "$storytypeContent/thumbs/";
if(!isSet($start)){
$start =0;
}
$i = $start;
$prev_start = $start - $photos_per_page;
$next_start = $start + $photos_per_page;
for ($row=0; $row < $num_rows; $row++){print("<tr>");
for ($col=0; $col < $photos_per_row; $col++){if($i < $total_photos){$thumbnail = $thumbnail_dir.trim($photos[$i]);
echo "<a href ='#' onClick=";
echo "\"document.the_image.src=";
echo "'$large_dir$photos_large[$i]'";
echo "\">";
echo "<img src=\"".$thumbnail. "\" ";
echo "title = \"$photos_large[$i]\">";
echo "</a>";
echo "</div>";
}
$i++;
}
}
fclose($fp);
if(($start == 0) && ($next_start < $total_photos)){
<a href="gallery.php?storytypeContent=<?php echo $storytypeContent;?>&start=<?PHP print($next_start);?>"><img src="pageimg/next.gif" alt= "next page"></a>
}
elseif (($start > 0) && ($next_start < $total_photos)){
<a href="gallery.php?storytypeContent=<?php echo $storytypeContent;?>&start=<?PHP print($prev_start); ?>"><img src="pageimg/prev.gif" alt= "previous page"></a>
<a href="gallery.php?storytypeContent=<?php echo $storytypeContent;?>&start=<?PHP print($next_start); ?>"><img src="pageimg/next.gif" alt= "next page"></a>
<?PHP
}
elseif(($start == 0) && ($next_start > $total_photos)){
*
}
else {
<a href="gallery.php?storytypeContent=<?php echo $storytypeContent;?>&start=<?PHP print($prev_start); ?>"><img src="pageimg/prev.gif" alt= "previous page"></a>
}
echo "<DIV id = \"rightcol\" >";
echo "<img src = \"pageimg/gallery.gif\" >";
echo "<img src=\"$large_dir$photos_large[1]\" name=\"the_image\" title = \"$large_dir$photos_large[$i]\" >";
echo "Ref :";
echo "$start = \"$photos_large[$i]" ;
echo $person_data[$elementPos]['synopsis'];
?>