I've got a script working real well for reading the .jpg's within a folder, and printing them to screen (thumbs) via foreach() loop
my ultimate goal is to come up w/ a way to do the following:
User selects a thumbnail from my gallery, which itself is displayed via a glob() script function
desired larger-size image is displayed on its own HTML "slide" page (it's currently linking direct to .jpg, w/out the HTML slide container file)
to enhance user experience using a pop-up for the image display, need to enable a "previous / next" style navigation from w/in the pop-up (if the user decides to use that method-- she could go back to the thumbs if desired)
my plan is to use put the consecutive thumbnail $items, read by the glob() function, into a string array, so i can come back later and make html files from the strings in that array-- thinking that i can use that info also for making my "previous -- next" navigation-- the point being of course never to have to hard-code any of the html side-files, or the links to the thumbs, etc.
here's what i'm working with-- i thiink i'm on the right track, but my string array is fouled up.
$filelist = "";
$folder = 'images/stadiumjump';
$pics = count(alpharead3($folder));
$pn = "";
foreach(alpharead3($folder) as $item) {
if ($item != "thumbs") {
$pn = $pn++;
$photonum = array($pn => $item);
$filelist .= '<div class="float"><a href="'.$folder.'/'.$item.'"><img src="'.$folder.'/thumbs/'.$item.'" alt=" "'.$item.'" /></a><br /></div>';
} elseif ($item == "thumbs") {
break;
}
}
print_r ($photonum); /* $photonum is my array TEST -- which proves i'm not there yet. the $filelist is okay */
echo $filelist;
which outputs to the screen:
Array ( [] => stadium.jpg )
<!-- image --> <!-- image2 --> <!-- etc -->
stadium.jpg being the last file of the images folder
what have i done wrong w/ my array, causing it to output ([] => stadium.jpb) ? really-- that's what i want to know-- if i can figure out how to get the code below i think i'll be set for the second part-- the html slides.
$photonum[0] = imageone.jpg
$photonum[1] = imagetwo.jpg
thanks.