image gallery doesn't show all images

i wanted to make an image gallery showing only 40 images at a time through the highslide js plugin, all is well except when i get to the end of what the gallery should be, i get a blank page, or a page with the wrong number of images.

the images are labeled #-freebies.jpg for convenience, making the for() loop show what image is relative to what loop # its on. IE loop 30 shows image 30-freebie.jpg. to see what i am referring to look here: http://freebiespages.hostzi.com/PastPrizes.php?start=840&end=880 clicking next should display images 881 - 922 of the 951 or so images.

[php]

weedfreebies past winners
<?php ini_set('display_errors',1); include("Admin-panel/tracker/tracker.php"); $selfPost = $_SERVER['PHP_SELF']; $path = 'images/weedfreebies/'; $saved_imgs = glob($path . "*.jpg"); if(isset($_GET['start'])) $start = $_GET['start']; else $start = 1; if(isset($_GET['end'])){ $end = $_GET['end']; if($end>count($saved_imgs)) $end = count($saved_imgs)-1; if($end<0) $end = 20; } else $end = 40;

$nts = $start + 40;
$nte = $end + 40;
$bts = $start - 40;
$bte = $end - 40;
echo <<<EOF


EOF;

echo ‘

’;
for($i=$start;$i!=$end+1;$i++){
if(file_exists($path.$i."-freebie.jpg")){
$imagesize = @getimagesize($saved_imgs[$i]);
if($imagesize[3] == ‘width=“132” height=“64”’)
echo " “;
else{
$freebieslink = “http://weedfreebies.com/index.php?option=com_zoo&task=item&item_id=$i&Itemid=102”;
$page = ‘’;
$page .= ‘Highslide JS
’;
$page .= ‘
’;
$page .= 'Weedfreebies :<a href=”’.$freebieslink.’"’.$imagesize[3].’ target="_blank">Prize Page
’;
$page .= ’
 ';
echo $page;
}
}
if(!file_exists($path.$i."-freebie.jpg")){
$end++;
if($end>count($saved_imgs)){
$end = count($saved_imgs)-1;
}
}
}
echo ‘
’;
echo ‘back::::next
’;
?>
[/php]

i have realized glob() only sees 887 images in its array ( odd that’s not how i am accessing the images). and if i change the back and next buttons to only change 10 at a time, i get to images 923. images are labeled via their prize ID# ending with 951 @11:20AM -8GMT.

Sponsor our Newsletter | Privacy Policy | Terms of Service