ZenphotoCMS Forum
Change of album.php for a specific album - 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: Change of album.php for a specific album (/thread-7946.html)



Change of album.php for a specific album - minutepapillon - 2010-12-12

Hi everyone,
I need to slightly change the album.php page for a specific album (to add the description of the present image.)
I know that a theme can be affected to this album, but as this theme is barely the same as the current theme, it seems a bit heavy to duplicate it, just for a tiny modification. (Later improvements of the theme will have to be done twice etc ... boring.)
I haven't found in zp any equivalent of the child theme feature (wordpress) so I wonder if there is a more elegant way to get the job done.

Thank's for any advice !




Change of album.php for a specific album - acrylian - 2010-12-12

The next version (or the nightly if you want to try) will contain a plugin named "mutliple_layouts" that will allow to assign special layout theme pages to all main itlems (as there are images, albums, Zenpage pages, news articles and categories)

Meanwhile you will have to do this using the object model directly (see the tutorial for that and if you haven't already the theming tutorial as well). Check for the album name with a if/else or a switch() clause and then do your special stuff.




Change of album.php for a specific album - minutepapillon - 2010-12-24

Thanks Acrylian,
Well, I'm going to wait for the next version. The plugin you mention sounds great ...
(which one by the way ? ... in one month ? in six ? ... when should it be expected approximately ?)

... but as I'm writing these words I think "try to do the php trick yourself ... don't be such a lazy slug ..."
Being a little less stupid every day is good.
Well, let's go. Testing the name of the current album does not sound too difficult.
But testing if it is contained by an album named "shop" for example ... I don't know which function I could use ...
Any clue ?
Thanks and bye ...




Change of album.php for a specific album - sbillard - 2010-12-25

http://www.zenphoto.org/trac/roadmap

(Of course, this is only a projection.)




Change of album.php for a specific album - sbillard - 2010-12-25

Not exactly sure what test you are asking. But here is a guess:

$foldernames = explode('/',$_zp_current_album->name); if (array_search('shop',$foldernames) !== false)) {there is 'shop' somewhere in the album name;}




Change of album.php for a specific album - minutepapillon - 2010-12-25

Thanks,
Waou ! ... 1.4.0 is near !
...
in the mean time, I found :
`

*you're in shop*

`
... which proves that even a total zero in php can move its little ass and find a solution ... (by the way it seems to work ...)

As you guess I don't do this to display you're in shop ...
but instead, the description of the current image (we are in album.php)

The next code (from image.php) does not work in album.php :
``
... and here ... I have no clue ...
Thanks !!




Change of album.php for a specific album - sbillard - 2010-12-25

printImageDesc() is only valid when there is an image context setup. Like in the next_image() loop or on the image page. I would guess that you have no image at the time you called it. It would depend on where you made the call.




Change of album.php for a specific album - sbillard - 2010-12-25

BTW, your other code has a lurking flaw. If "shop" happens to start the album name your if ($pos) will not succeed. You need if ($pos != false) to be sure. One of those strange things about PHP that you just have to get used to. The value zero is also false.




Change of album.php for a specific album - minutepapillon - 2010-12-25

Thanks for the != false stuff.

For the printImageDesc() , I use it with the zpgalleriffic theme, in between the image and the thumbs.
Do you know if there is a way to make the image display be identified as a "current image" ?

I guess it's a specific zpgalleriffic problem ... isn't it ?

Suddently I get pessimistic ... :o( ....




Change of album.php for a specific album - sbillard - 2010-12-26

I'm not familiar with that theme at all. If you know the image you want, look for the "makeimagecurrent" function. (or something like that, don't have the source handy at the moment)

Otherwise, maybe the theme author will step in and help.




Change of album.php for a specific album - minutepapillon - 2010-12-28

Ok ...
Thanks for for your constantly excellent support ...