I'm running Zenphoto 1.0.3 with a custom theme to integrate with my wordpress site.
On album pages, I would like to display a short list of all other albums available. I am using this code
`
`
This works fine for the first page of each album. I does not work for any subsequent pages. An example is available at
http://www.unihandball.de/fotos/dresden_turnier_2006/ - the list in question is on the right side, labeled "Andere Alben" (site nowhere finished, sorry). Go to the second page of that album, and voila, no list anymore. Could anybody please tell me how to get that working for all pages? Thanks a lot!
Comments
STEP 1: Create a new function in `classes.php`:
Copy and paste the function `getAlbums()` in `classes.php`
Rename the function `getAlbumsAll()`
Replace the lines:
`$albums_per_page = zp_conf('albums_per_page');`
`return array_slice($this->albums, $albums_per_page*($page-1), $albums_per_page);`
with:
`return $this->albums;`
STEP 2: Create a new function in `template_functions.php`:
Copy and paste the function `next_album()`
Rename the function `next_album_all()`
Replace the function:
`getAlbums($_zp_page)`
with:
`getAlbumsAll($_zp_page)`
STEP 3: Replace `next_album()` with `next_album_all()`:
In your template pages, replace the function `next_album()` with `next_album_all()` in your `while` conditions.
And that's it! I know there might be a way to streamline the codes, but hopefully this will work for you.
Turns out this is just not what the function is intended for in its original version (display the next set of available albums depending on where you are in the album list and how many albums per page there are). Should have taken a look at the code ....
Thanks again, very helpful!