I’m building a photo gallery for a website. I don’t know * a lot
I am using a PHP script to pull and shrink every image from a singlefolder and post them on a page… now I want to be able to click on the image and have it open the picture in full resolution on a new layer (darkening the page)..
so while i’ve been trying to accomplish this, i stumbled across this old post about hidden fields and layering and what not..
[URL=”http://www.webdeveloper.com/forum/showthread.php?t=171288″]http://www.webdeveloper.com/forum/showthread.php?t=171288
I’ve been toying with it, and i just want to be able to add some html tag to the photo script being generated by my PHP to change which appears in the feature_div based on what picture they click on from the gallery..
here is what i have so far:
[code=php]
<?php
$a = ‘0’;
$filepath = “photos”;
$dir = dir($filepath);
echo “<table border=”0″ cellpadding=”2″ cellspacing=”1″ width=”520″ align=”center”>”;
while($entry=$dir->read()) {
if($entry == “.” || $entry == “..”) {
continue;
}
$fp = @fopen(“$filepath/$entry”,”r”);
$image_stats = GetImageSize($filepath.”/”.$entry);
$imagewidth = $image_stats[0];
$imageheight = $image_stats[1];
$ratio = ($imagewidth / 1.3);
$ratio2 = ($imagewidth / 1.5);
$ratio3 = ($imagewidth / 1.8);
if($ratio3 > “518”) {
$w_ratio = ($imagewidth / 2.3);
$h_ratio = ($imageheight / 2.3);
} elseif ($ratio2 > “518”) {
$w_ratio = ($imagewidth / 1.8);
$h_ratio = ($imageheight / 1.8);
} elseif ($ratio1 > “518”) {
$w_ratio = ($imagewidth / 1.5);
$h_ratio = ($imageheight / 1.5);
} else {
$w_ratio = ($imagewidth / 1.3);
$h_ratio = ($imageheight / 1.3);
}
?>
<tr>
<td align=”center”>
<a href=”<? echo “$filepath/$entry” ?>”><img src=”<? echo “$filepath/$entry” ?>” width=”<? echo “$w_ratio” ?>” height=”<? echo “$h_ratio” ?>” border=”1″ onclick=”highlight_div()”></a>
</td>
<?
$a = $a + 1;
}
?>
and the link above shows the highlight function i am trying to use..
i would greatly appreciate any help accomplishing this goal!
ray