I?m having a bit of trouble trying to get something to work. First i though i did something wrong using Floatbox, since i couldn?t find a simular problem on this forum i started looking elswhere. Well, i did found the problem but can?t find a solution simple due to my lack of programming skills.
Floatbox is just working perfectly, so not directly a Floatbox question.
What i?m trying to fix, having a simple script putting a few random images on the frontpage:
<?php
// rotate images randomly but w/o dups on same page - format:
// <img src='rotate.php?i=0'> - rotate image #0 - use 'i=1'
// for second, etc
// (c) 2004 David Pankhurst - use freely, but please leave in my credit
$images=array( // list of files to rotate - add as needed
"001.jpg", "002.jpg", "003.jpg", "004.jpg", "005.jpg", "006.jpg", "007.jpg", );
$total=count($images);
$secondsFixed=15; // seconds to keep list the same
$seedValue=(int)(time()/$secondsFixed);
srand($seedValue);
for ($i=0;$i<$total;++$i) // shuffle list 'randomly'
{
$r=rand(0,$total-1);
$temp =$images[$i];
$images[$i]=$images[$r];
$images[$r]=$temp;
}
$index=(int)($_GET['i']); // image index passed in
$i=$index%$total; // make sure index always in bounds
$file=$images[$i];
header("Location: gfx/thumbs/$file"); // and pass file reference back
?>
This just works perfectly! Second i?m trying to make the thumbnail clickable and using floatbox to view the image. This is where it goes wrong. I copied the original php script and used this one to generate the link to the picture. This also works, thumbail and picture are the same and the picture opens (after clikcing the thumbnail) using floatbox. Unfortunally the image will not resize!!
This is the HTML code
<a rel="floatbox" href='rotate_p.php?i=0' ><img src='rotate_t.php?i=0'></a>
<a rel="floatbox" href='rotate_p.php?i=1' ><img src='rotate_t.php?i=1'></a>
<a rel="floatbox" href='rotate_p.php?i=2' ><img src='rotate_t.php?i=2'></a>
<a rel="floatbox" href='rotate_p.php?i=3' ><img src='rotate_t.php?i=3'></a>
I know for a fact it can be done much more easier. I also know that it has to do something with the 'rotate_p.php?i=0', if i adjust this one directly to a picture it will show perfectly, but ofcourse it's not the same image as the thumbnail (well, maybe 1 out of ? times).
Can some help me out or point me to a much more simple solution (but not having to installing a complete image gallery)?
Gr,
Erwin