Member
Member
weweje   2010-03-14, 15:49
#1
Hello all.
I'm testing the zenpage theme an encountering a bug I can't troubleshoot by myself:
In image.php i've got that code:
`
<?php if(getOption("Use_thickbox")) {
$boxclass = " class=\"thickbox\"";
$tburl = getUnprotectedImageURL();
} else {
$thickboxclass = "";
$tburl = getFullImageURL();
}

if (!empty($tburl)) {
?>
<a>">
<?php
}//end if

printCustomSizedImageMaxSpace(getBareImageTitle(),950,2000); ?>

<?php
if (!empty($tburl)) {
?>
</a>
<?php
}//end if
?>
`
What conditional statement should I use to avoid that getNextImageURL() throws an empty url ( aka when i'm on the last image of a gallery, and make a link to the first image of that gallery )
I've browsed the user guide without finding something useful - i'm lost :$

Thank you very much
Member
Member
weweje   2010-03-14, 16:21
#2
I mean something better than
`

$Index = getGalleryIndexURL(false);

if (!empty($tburl) && $next!=($Index."/.html"))

`
Administrator
Administrator
acrylian   2010-03-14, 16:40
#3
Your code example is broken. You need to put code within `backticks`.

I don't understand the $tburl variable or the full image link in this theme has nothing to do with next/prev images. It is simply display the full image in layer box. No next/prev involved in that.

You did see the `if (hasNextImage())` and `if (hasPrevImage())` parts that also is explained on the theming tutorial? Add an `else` statement to link to the first image if there is no next/prev image.
Member
Member
weweje   2010-03-14, 17:17
#4
Wink you're right it's broken .
here it comes again ( WIP )
`
<?php if(getOption("Use_thickbox")) {
$boxclass = " class=\"thickbox\"";
$tburl = getUnprotectedImageURL();
} else {
$thickboxclass = "";
$tburl = getFullImageURL();
$First = getFirstImageURL();
$Last = getlastImageURL();
$next = getNextImageURL();
$Index = getGalleryIndexURL(false);
}

if (!empty($tburl) && hasNextImage()) {
?>

<?php
}else{?>
<a href="<?php echo $First ?>">
<?php }

printCustomSizedImageMaxSpace(getBareImageTitle(),950,2000); ?>

<?php
if (!empty($tburl) && hasNextImage()) {
?>

<?php
}//end if
?>
`
and tadaa!
hasNextImage() works!
You rock Acrylian!
Many thanks!
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.