By looking at another theme, I've managed to add the "Images 1-10 of 57" option to the album pages of the theme I'm working on by using the method below:
`
<?php
$firstImage = null;
$lastImage = null;
if ($myimagepage > 1) {
?>
<?php
}
while (next_image(false, $firstPageImages)) {
if (is_null($firstImage)) {
$lastImage = imageNumber();
$firstImage = $lastImage;
} else {
$lastImage++;
}
if (isLandscape()) {
$iw = 89;
$ih = NULL;
$cw = 89;
$ch = 67;
} else {
$iw = NULL;
$ih = 89;
$ch = 89;
$cw = 67;
}
echo '';
}
if (!is_null($lastImage) && $lastImage < getNumImages()) {
$np = getCurrentPage()+1;
?>
<?php
}
?>
<?php
if (!is_null($firstImage)) {
echo '<div class="count">';
printf(gettext('Images %1$u-%2$u of %3$u'), $firstImage, $lastImage, getNumImages());
echo "";
}
?>
`
I have two questions.
1. Is this the most efficient method of doing this?
2. Is there a way to display a similar function on the images page, ie "Image 4 of 57"? I suspect I have to change the `printf(gettext('Images %1$u-%2$u of %3$u'), $firstImage, $lastImage, getNumImages());` part to something else, but what?
Thanks a lot.
Comments
Since yout set the number of images per page you can use `getOption('images_per_page')` to calculate the x to y of z number thing.
the `printf()/gettext()` in your example is just for translation support via gettext. If you don't need that at all you can skip that. Without this would read `echo "Images ".$firstimage." - ".$lastimage. " of ".getNumImages()`
Edit // Never mind, just had to change "firstimage" to "firstImage", and "lastimage" to "lastImage". Thanks for the help!
`
if (isLandscape()) {
$iw = 89;
$ih = NULL;
$cw = 89;
$ch = 67;
} else {
$iw = NULL;
$ih = 89;
$ch = 89;
$cw = 67;
`
being careful, of course to not screw up the if/else sets.
look at the Effervescence+ theme customfunctions. It has a `printNofM()` function.