ZenphotoCMS Forum
Using only one album - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Themes (https://forum.zenphoto.org/forum-5.html)
+--- Thread: Using only one album (/thread-3233.html)

Pages: 1 2


Using only one album - fakestar - 05-07-2008

Hi, i want to use Zenphoto wih one album only.

And i want to show the thumbnails of this album in index.php...
I tried to copy album.php (i'm using default template) to index.php but i get error.

How can i make this works? I want to update only one album and show the latest thumbnails in index.php

Thanks in advance!




Using only one album - sbillard - 05-07-2008

I think that others have done something like this. I suggest you search the forum to see what has been posted.




Using only one album - fakestar - 05-07-2008

sbillard thank you, i gonna search.
I realize that i need to change in index.php (not in template) right? But i still getting errors.




Using only one album - sbillard - 06-07-2008

You need to create an index.php file with much the same structure as the album.php file but instead of a next_album() loop you need to do something like:

`$albums = $_zp_current_gallery->getAlbums();

$_zp_current_album = new Album($_zp_current_gallery, $albums[0]);`

Note that I have not tried this myself.




Using only one album - fakestar - 06-07-2008

i take off (and the content between?) ?

Sorry, i'm pretty newbie in php...




Using only one album - sbillard - 06-07-2008

Yes




Using only one album - fakestar - 12-07-2008

it doesn't work :/




Using only one album - sbillard - 13-07-2008

A working single album based on the default theme. Use this as the index.php script.

`




Using only one album - fakestar - 13-07-2008

the best support ever. :)




Using only one album - Joen - 17-07-2008

This is very nice, and does almost what I have in mind.

Can it be extended, though?

I'm looking for a Flickr like "stream of all images". Basically, i would like for index.php to simply show the contents of ALL folders in one continously paginated sequence, ideally a sequence that respects the individual folder sorting order.




Using only one album - sbillard - 17-07-2008

It is yours to do what ever you want with. Look through our documentation. I am sure you will find the support functions you need.http://www.zenphoto.org/category/User-Guide/




Using only one album - Joen - 17-07-2008

I guess I'll try and adopt some code from the rss.php file. I'll let the forum know whether I manage to add pagination to that.

That said, my guess was that zenphoto had such a function built-in; it seems to me that a flat, paginated view containing every picture is a userfriendly way of showing a gallery. Benefits include giving people an idea of how many pictures there are in total, how new the pictures are (page 1 means newest) and so on. I would guess that's why Flickr has that as its default view. Asking here, whether such a function existed seemed like a shortcut at the time, my being stumped at what keyword(s) to search for.

Thanks for taking your time to reply here, and let me know if there's anything I can help you with, to pay back for the time the whole zp team spend here. I'm proficient in design and usability :)




Using only one album - acrylian - 17-07-2008

I think that depends what you want to do..:-) I am fine with the normal albums as categories, but I can see the use of it, wether it is in order or just latest to oldest.

For the latter the rss feed is a good start.

If you want the images in album order and not lastest first here is a short round up for the first subalbum level:
`global $_zp_gallery;

$gallery = $_zp_gallery;

$albums = $_zp_gallery->getAlbums();

// gets every top level album within this you can get the images with $topalbum->getImages()

foreach ($albums as $toplevelalbum) {

$topalbum = new Album($gallery,$toplevelalbum,true);

        $subalbums1 = $topalbum->getSubAlbums();

    foreach($subalbums1 as $sublevelalbum1) { // gets every sub level album of the current top level one in the loop.

      $subalbum1 = new Album($gallery,$sublevelalbum1,true);

            }

}`

Within the subalbums1 foreach you can do it all again so you get the next subalbum level and so on (I do this with the printalbumenu up to the 4th level - And before anyone says anything, yes I know that actually should be done rekursively some time, but the direct way was faster for me and 4 levels are actually enough usability wise..:-))




Using only one album - Joen - 18-07-2008

Acrylian,

That seems to work perfectly! I had to tweak it a bit. Here's what I have:

`

                    ">

















                          "> 



                                 ">

`

Edit: The only thing it seems to be "missing" is the pagination -- it doesn't obey the "galleries per page", nor does it seem to add pagination, but I can live with that. And the sorting works! Excellent.

Keep that design/usability review favor in mind, I'd like to help again. :)

Edit 2: Actually that pagination problem was me being stupid. Pagination DOES work, it just doesn't take its pagination info from "albums per page" but from "images per page". Woo!




Using only one album - jackie - 21-07-2008

Hi - I'm trying (hate to admit how many hrs!) to get one album on a page, regular php page in my site, altho I have many albums in the gallery. Each page of my site needs a specific album... or 2.
I have the code from above "single album" working... I have only 2 albums in the gallery now but notice that the array #0 is the second one I set up, and #1 is the first (?)
But my question is: is there a way to display a specific album on a php page calling it by name, by the album's $folder name?

thank you
Jackie




Using only one album - acrylian - 21-07-2008

Why don't you just link directly into an album?




Using only one album - jackie - 21-07-2008

Thank you acrylian for your response.
yes - I can do that - but I wanted it to display in a spry tabbed panel on the page. (Don't we always want the 'next' thing?)
I think the code posted above will do that for me but I was wondering if there was a way to display one album by calling it by name.




Using only one album - sbillard - 22-07-2008

What do you mean "calling it by name"? As acrylian said you can create a direct link to www.mydomain.com/zenphoto/album which will display that album. You can also create code that does the same thing as album.php to display the album in place.




Using only one album - jackie - 22-07-2008

By 'calling it by name' I meant a possible function that would display the album within another page ( like a link would) - but that's actually what your code above does. Where you could pass the album folder name as a parameter. However I have it ok now -
I am using your 'one album' code - which displays the thumbnails and then the user can click into the album.
Thanks for the help and it's a great app. Once I read more of the core code functions I'll know more how it works.




Using only one album - edbury - 23-07-2008

Joen, could you post the entirety of that file?