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!
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
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?
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.