![]() |
|
help with printAlbumMenuListCustom - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: help with printAlbumMenuListCustom (/thread-6459.html) |
help with printAlbumMenuListCustom - breglis - 2010-01-15 Hi Guys, I would like to modify this function in a way so that I can pass in the gallery name to start. the function printAlbumMenuListCustom sits in custom-functions.php in line 325: $albums = $_zp_gallery->getAlbums(); is set and is then passed into 'printAlbumMenuListAlbumCustom' function. How do I set $albums to my album 'Rooms' explicitly to make it root. so that only rooms subalbums are shown ? please see here: http://www.dev.bregler.net/ help with printAlbumMenuListCustom - acrylian - 2010-01-15 Sorry, that is not a official function. Also I don't understand what you actually want to do. Do you want to check for the parent album? there is a function and there is also one for the "uralbum" to get the toplevel album of any of its subalbums. See the documentation, I don't have the links at hand. Just to note: Nice site and usage of Zenphoto in general, that is the type of usage I/we actually had in mind when making the Zenpage plugin. Be sure to submit that to the showcase when it is ready..;-) Btw, you might want to consider to update to the stable 1.2.8 release as you are using the RC1. help with printAlbumMenuListCustom - breglis - 2010-01-15 thanks for the nice feedback on my design ! its much appreciated. I personally find the dynamic galleries the most striking feature of ZP ! I am more in the design side, hence my noob coding question ! in said custom function I am sure many can give me a quick hint : this line: $albums = $_zp_gallery->getAlbums(); produces : Array ( [0] => bigpicture [1] => video [2] => rooms !!!! <- where I want to set the start [3] => gallery [4] => london.alb [5] => 2009.alb ) what I want is not to take the top-level gallery as root, but the rooms album instead. http://www.bregler.net/backup/rooms.png I tried stuff like this but its wrong ! $albums = $Album[2]->getAlbums(); Please help ! help with printAlbumMenuListCustom - acrylian - 2010-01-15 If I look at http://www.dev.bregler.net/rooms/China.alb I see "Room | China". Isn't that what you want? Maybe I don't understand it yet. You could always get the top level to each album using this: Yohttp://www.zenphoto.org/documentation/functions/_functions.php.html#functiongetUrAlbum help with printAlbumMenuListCustom - breglis - 2010-01-15 this is only about the navigation in the header not the breadcrumbs ! do you see that under 'ROOMS' you find All albums ? I want it to start just from Rooms and hide the rest I updated the screenshot even more : http://www.bregler.net/backup/rooms.png Do I need a new class ? like $topalbum = new Album($_zp_gallery,.....); ? help with printAlbumMenuListCustom - breglis - 2010-01-15 am I on the right way with this ? $topalbum = new Album($_zp_gallery,$albums[2],false); $albums = $topalbum->getSubalbums(); help with printAlbumMenuListCustom - acrylian - 2010-01-15 Ah now I get it! Yes, you assumed correctly, you have to setup the album object of that album: ` $album = new Album($_zp_gallery, "rooms"); $subalbums = $roomsobj->getSubAlbums(); ` help with printAlbumMenuListCustom - acrylian - 2010-01-15 Posted at the same time..;-) help with printAlbumMenuListCustom - breglis - 2010-01-15 Ha ! I got it ! http://www.coolmyspacebackgrounds.org/wp-content/uploads/2007/12/mrburns_excellent1.JPG !!! Thanks for taking the time acrylian ! Coming back to my breadcrumb problem : click on any sub-album under http://www.dev.bregler.net/rooms/China.alb and you will see the breadcrumbs disappear.. Thats the bit I think is a bug What do you think of using HTTP_REFERRER ? help with printAlbumMenuListCustom - acrylian - 2010-01-15 Hm, the problem is that a subalbum within a dynamic album is not really subalbum of that dynamic album as you can see at the url: http://www.dev.bregler.net/rooms/China.alb but http://www.dev.bregler.net/rooms/2006/060101_Urumqi_Peofowl-Mansion_301_7.6/ That album could also be the subalbum of another dynamic album, so this is not unique for the breadcrumb, Zenphoto is foremost filesystem based, so this would be complicated. I fear using the HTTP_REFERRER might be an option or you add the album name via url (GET). help with printAlbumMenuListCustom - breglis - 2010-01-15 ok, thanks for confirming. So how would I then at least give the physical breadcrumb (through folder structure) ignoring the logical path ? i.e from "rooms | china " it would then jumb to "rooms | 2006 | Urumqi..." help with printAlbumMenuListCustom - breglis - 2010-01-15 ahh man, I was prepared for some dirty string operation here but ZP did it all for me ! hasDynamicAlbumSuffix($_SERVER['HTTP_REFERER']) ZP is awesome ! So whenever one ends up in a physical folder one can retrace the logical breadcrumbs too with : $breadcrumb = str_replace (".alb","",$_SERVER['HTTP_REFERER']); $parts = explode("/", $breadcrumb); |