Show Prev/next only when more than one page

Hi guys,

I'm a newbie with Php so I'm sorry if I'm not descriptive enough or sound a little dumb! hehe.

I'm trying to remove the Previous/Next that appear at the bottom of my albums when I have one page only. I found the getTotalPages function but I am unsure how to use it. From another thread of this forum, I figured this syntaxe (at one point it was working.. I don't know what I changed, but it's not working anymore!).

<?php if ($getTotalPages > 1) printPageListWithNav("« ".gettext("prev"), gettext("next")." »"); ?>

In order to try to debug this, I have tried to remove the printPageListWithNav function and replace with a simple Echo. The echo returns data only when gettotalpages < 1! How can I have less than one page? Or is my syntaxe erroneous? This is what I have now:

<?php if ($getTotalPages < 1) echo "there is LESS THAN one page"; ?>

I hope you can help :)

Thanks,
Sabrina

(if it can help, this is the website.. keep in mind it's not finished and I did use some pictures from Windows to get more than one page..)

http://www.sabrinaphoto.ca/zenphoto/

The gallery called "spectacle, the first one, has more than one page)

Comments

  • Most people do that via CSS changes that make those elements the same as the background color. (The links are class disabled or something like that.)

    But if you do wish to do it with code, you need to realize that it is not the code that is causing you your problem. It is instead your math. If you are actually looking at a page, the there must be at least one page.
  • Yeah I realize that the math is the problem as it's impossible that I have less than one page. I just don't understand how that works I guess.. I thought it was a simple less than/greater than.

    I'll try with the CSS, it's probably easier. I didn't realize I could do it that way. Thanks.
  • Oh my god the CSS thing worked like a charm even for me!!!!!

    Thank you so much you made my day.. just 30 seconds of work after your post and I got it working..

    Really, thanks!
  • acrylian Administrator, Developer
    You of course could also hide these elements via the `visibility`or `display` elements with CSS.
Sign In or Register to comment.