Album page navigation (shouldn't be there...)

I'm new to Zenphoto and playing with the default theme. Now I've set the album display to 8 albums per page, but I get the album navigation everywhere, even when only using 2 albums. The page navigation turns to normal when I the album itself with the pictures.

Anyone who recognizes this? It's not a fault in my theming, because I switched to a default theme for testing, but got the same problem.

Comments

  • I really don't understand what you are saying. Can you post a link to the site?
  • jackdaw Member
    I'm sorry I wasn't so clear :). Here you can see a testpage. Only one album in this album, but the page/album navigation is present (album navigation is set to 8 albums per page). Also, clicking on 'next' results in a page with the images of that album and not the next (not existing) album.

    Hope this helps...
  • Please try this with the nightly build as it may have a correction for the issue.
  • jackdaw Member
    Just downloaded and upgraded with zenphoto-2008-05-12-trunk, but the links are still present, in every theme.
    I followed the upload instructions, deleted all the files (except for /themes etc.) and ran upgrade.php.
  • I just visited your site and do not see the links now. Has something else changed?
  • jackdaw Member
    Now, that IS strange :(. Yesterday they still showed up, and now (after a few hours of restless sleep) they're gone! I'll keep an eye on it if it ever occurs again. Can't think of anything I changed. The links are now gone, also within the other themes...
  • jlang Member
    Probably your browser cache had the older incorrect version. After it had a sleep, it downloaded the fixed ones.
  • jackdaw Member
    Damn... ;) the pagenavigation returned and I don't know why...
    Yesterday it was present so I thought it would be a cache problem. But now it's still there...

    I'm using this function: printPageListWithNav.

    I discovered a few things:
    1. When I'm viewing a page with only albums, and I set the album display under 'theme options' in both 'gallery' and my main album 'fotografie' to 500, the page navigation will still be present, even if that album page only contains/shows 6 subalbums. However, when that page has 4 or less albums, the page navigation is gone.
    2. When I set the 'image display' in both 'gallery' and 'fotografie' to 500 IMAGES per page, then also the page navigation is gone. But I'm viewing a page with albums(!) and not with images, so I don't understand what's wrong here :(...

    To be able to check out the 'wrong' navigation, I've set the display back to 12 albums per page and 12 images per page...

    http://www.spoenk.nl/albums/fotografie/
  • acrylian Administrator, Developer
    Weird, I have never seen or encountered that. Does that really appear if you use one of the standard themes, too?
  • jackdaw Member
    Yes. Take a look again at the gallery. I just activated the default theme (no-rating activated). Same problem I'm afraid :(...
    Any new ideas why this is happening?
  • acrylian Administrator, Developer
    Did you refresh the database, do you maybe have some invisible files in your albums folders? Sorry, no real ideas.
  • jackdaw Member
    Yes, I did refresh the database. And no, I can't find any hidden files, except for that one .htaccess file in the root folder of the ZP-installation, but that looks normal to me. I also checked all folders inside the main folder for hidden files...

    The only thing I could try is to purge the cache again, but I don't thinks that will help...
  • acrylian Administrator, Developer
    Well, were just helpless guesses. Since I can't reproduce the problem, I have no idea. Maybe sbillard (or anyone else) has when he shows up later.
  • jackdaw Member
    Found it!!! :) Sigh...

    Removing

    `$firstPageImages = normalizeColumns('2', '6');`

    from

    `<?php if (!defined('WEBPATH')) die(); $themeResult = getTheme($zenCSS, $themeColor, 'light'); $firstPageImages = normalizeColumns('2', '6');?>`

    in the head of the album.php (no matter what theme) and the album page navigation is working again as it should. So I wonder if this is a bug or not, because it happened in each and every theme I tested and caused my album navigation to go wrong, sometimes displaying navigation for three albumpages where there was only one (so clicking to page two or three resulted in empty pages).

    Perhaps someone else can test it. In my case it went wrong with albums that contained more than six subalbums.
  • Well, in viewing your site what I see is a gallery with apparently 7 albums in it. The first six are displayed on page 1 and the 7th on page 2. That would tend to indicate that the albums per page was set to 6.

    The one thing you should look at is the function `normalizeColumns()`. Many times problems with mis-matches of pagination stem from not using this function correctly.
  • jackdaw Member
    That would tend to indicate that the albums per page was set to 6.

    Yes, I just set it to 6 to test the pages after I removed that line, so what you see now is ok. But before that it was set to 20 or 500 and even then the page navigation for the albums was present.
    If you want I can put the line back for you to see what happened? :)

    About that function... Because it was present in all the themes I assumed it was a necessary line of code for the gallery to work, to 'switch' to a few albums less or more, just to make it flow nicely on the screen, but I guess I was wrong. Never thought about removing it.

    Perhaps it went wrong because I don't use 'transition' pages?
  • If you don't have the transition pages, you should not be using the `normalizeColumns()` function.
  • jackdaw Member
    OK, thanks. Perhaps, even if I was the first who had this 'problem', it is a good idea to put this in the theming tutorial. There is a very small section that refers to this piece of code and that it is used for transitional pages, but it does not say that it is to be used only(!) when using transitional pages, and that it would be better otherwise to remove it.

    Perhaps (and just thinking from a users perspective) it would be an idea to let the code check IF albums AND images or both present on that page, and only then actually applying/running it. This way that piece of code can stay in the head of all the pages, no matter how someone wants to fill his/her gallery :).

    Like I said, in my case the problem is solved and I know what to do now, but I'm just thinking of new users...
  • The function actually works fine when there are no images on the page (so long as it is setup correctly). The part that 'gets' most people is when the column values do not match their CSS.
  • I also ran into this problem (I'm using version 1.1.6). Page navigation would be displayed even if I had only one page worth of albums. For example, I had 9 albums, I had my albums per page set to 12, and the page navigation would show that there were 3 pages. However, if I actually navigated to those pages, they didn't have any albums. Removing `$firstPageImages = normalizeColumns('2', '6');` fixed it for me as well. Thanks jackdaw!
Sign In or Register to comment.