Re: [chris] Photo Gallery setup
Still not working..
what i need to change to make it work strat from page 1 and add jump to page with out error.
this is my code:
<?php
$photosPerPage = 15;
$photoPage = @$_REQUEST['photoPage'];
$firstIndex = $photoPage * $photosPerPage;
$lastIndex = min($firstIndex + $photosPerPage, sizeof($clubsRecord['images'])) - 1;
foreach (range($firstIndex, $lastIndex) as $photoIndex):
$upload = $clubsRecord['images'][$photoIndex]
?>
<td align="center"><div class="pic"><a href="<?php echo $upload['urlPath'] ?>" rel="enlargeimage::click" rev="photoload"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt='' width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" align="middle" class="displayed" /></a></div></td>
<?php $maxCols=3; if (@++$count % $maxCols == 0): ?>
</tr><tr>
<?php endif ?>
<?php endforeach; ?>
</tr></table>
<p><br/>
<?php if ($firstIndex > 0): ?>
<a href="?photoPage=<?php echo $photoPage-1; ?>&=<?php echo $clubsRecord['num'] ?>"><img src="images/back.png" width="20" height="16" border="0" align="absmiddle" /></a>
<?php endif ?>
עמוד <?php echo($photoPage + 1); ?> מתוך <?php echo(ceil(sizeof($clubsRecord['images']) / $photosPerPage)); ?>
<?php if ($lastIndex < sizeof($clubsRecord['images']) - 1): ?>
<a href="?photoPage=<?php echo $photoPage+1; ?>&=<?php echo $clubsRecord['num'] ?>"><img src="images/next.png" width="20" height="16" border="0" align="absmiddle" /></a><br />
<?php endif ?>