How to setup number of albums per page

Sorry if I'm posting something so obvious, but I have been searching the forum for the last 2 hours, and I haven't been able to find the answer.

I have album with 2 pages. The first page has 6 albums and second page has 2 albums. I would like to have only one page (gallery) with all 8 albums featured.

What files I need to edit and how?

Thanks a log!

Comments

  • Depends on the theme your site is using. If it's using `normalizeColumns()`, then I would suggest taking a look at this from the Troubleshooting Zenphoto guide: http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/#20
  • I'm using default theme, but I took a look at that document, but am unable to understand what file i need to edit and how.

    Please help me if you can with more detailed explanation.
  • What should I change here?

    function normalizeColumns($albumColumns, $imageColumns) {
    global $_zp_current_album, $firstPageImages;
    $albcount = max(1, getOption('albums_per_page'));
    if (($albcount % $albumColumns) != 0) {
    setOption('albums_per_page', $albcount = ((floor($albcount / $albumColumns) + 1) * $albumColumns), false);
    }
    $imgcount = max(1, getOption('images_per_page'));
    if (($imgcount % $imageColumns) != 0) {
    setOption('images_per_page', $imgcount = ((floor($imgcount / $imageColumns) + 1) * $imageColumns), false);
    }
  • Never mind, I solved it. Just in case someone else is stupid like myself, I changed "$albcount = max(1, getOption('albums_per_page'));" to "$albcount = max(1, getOption('8'));" and edited my theme index.php, album.php and search.php files.

    $firstPageImages = normalizeColumns('2', '6');?>

    I changed to

    $firstPageImages = normalizeColumns('8', '6');?>
  • Probably do not want to use `getOption('8')`. Just an 8 will suffice. Besides that there is unlikely to be an opton named "8" set. As well, you could simply set the 'albums_per_page' option to 8 in the back end and not need to change that code at all.

    Generally it is not needed nor a good idea to modify the core functons. Doing so will cause you troubles when you upgrade Zenphoto versions.

    So, the recommended solution for you would be to change the option on the options/theme tab.

    In addition, I think you have probably mis-interpreted the normalizeColumns() function. The first parameter represents the number of columns there are for albums, the second represents the number of columns there are for images. Both these are determined by your theme CSS. In the case of the default theme, unless you have modified it, only two album thumbs are displayed per "line" so that number MUST remain 2.
  • I understand what you mean, but I tried to go to Admin toolbox / Options / Theme. I then changed "Albums per page" from 5 to 8, and clicked on SAVE button. When the page refreshed I noticed that "Albums per page" was back to 5. No matter what number I tried to change it to, the script won't accept and save the change.

    NOTE: I had no problem changing the "Thumbnails per page".

    What could be the issue here?
  • acrylian Administrator, Developer
    Is it possible that you are not running the latest release? Also what theme, as it might be overriding the backend options.
  • Most likely a problem with an old version of Zenphoto as he has said earlier that he is using the `default` theme.
  • # Zenphoto version 1.3 [5479] (Official Build)
    # Current gallery theme: Default
    # PHP version: 5.2.13
    # Graphics support: PHP GD library bundled (2.0.34 compatible)
    # PHP memory limit: 96M (Note: Your server might allocate less!)
    # MySQL version: 5.1.47
  • Ok, I have tracked down the issue. There is a bug with saving theme options. It will be corrected in the nightly build tonight. Thanks for your patience and information.
  • Well, that is really strange. I wanted to make some changes again, and tried to change number of albums per page to 8, and this time the script accepted the change. Before doing that I have updated the script, but after doing that I tried to change the number of albums per page and didn't succeed. However, everything is fine now.
  • Yes, the circumstances where it will work/not work are pretty obscure. (Which makes finding and fixing interesting.) Suffice it to say that it will become reliable with the nightly build.
Sign In or Register to comment.