Undefined variable with latest nightly

I updated to the latest nightly and I started getting this error:

Notice: Undefined variable: myimagepage in /zen-installation/themes/default/image.php on line 34

Of the code below, line 34 is the 4th, or `if ($myimagepage > 1) {`

`
<?php
$firstImage = null;
$lastImage = null;
if ($myimagepage > 1) {
?>

<?php
}
while (next_image(false, $firstPageImages)) {
if (is_null($firstImage)) {
$lastImage = imageNumber();
$firstImage = $lastImage;
} else {
$lastImage++;
}
}
echo '';
if (!is_null($lastImage) && $lastImage < getNumImages()) {
$np = getCurrentPage()+1;
?>

<?php
}
?>
`
This is the code I use to show how many images there are in the album and which image the user is viewing.

How could I avoid the error?

Comments

  • acrylian Administrator, Developer
    Where does that variable $myimagepage come from? You need to define that before usage and I don't see that on your example.

    So you are trying to do something like "x of y images"? Why don't you just use `echo imageNumber()` that gets the number of the current image?
  • Haha. You know, I don't know. I thank you again, kind sir :)
Sign In or Register to comment.