Member
Member
missyani   2008-05-25, 02:17
#1

I really like the new way plugins are being managed in ZP 1.1.6. I'm currently playing around a little with integrating the print_album_menu into a theme, but I'm wondering if there's a way of limiting the number of albums it lists when using the "list" option instead of the dropdown menu. I'd like to have it so it lists, for example, the 10 most recently added albums.

Or perhaps there's another way of achieving this, outside of using the album menu plugin? I'll admit my PHP is limited, but any suggestions on how to accomplish this would be greatly appreciated.

Administrator
Administrator
acrylian   2008-05-25, 10:38
#2

Since the album menu is a menu it is clearly not meant for this and there is no way unless you want to code yourself. But we have a function for the latest albums: http://www.zenphoto.org/documentation-official/zenphoto/_plugins---image_album_statistics.php.html#functionprintLatestAlbums

This of course shows the thumbs of the latest albums.

Member
Member
missyani   2008-05-27, 00:29
#3

Right. Except I don't want the album thumbs to show up, only a text links list. Since my list of albums is rather long, I didn't want all of them to be listed (I wanted to integrate the album menu as a sidebar menu, clearly a use for which it was designed, I'm sure).

Thanks, anyway.

Administrator
Administrator
acrylian   2008-05-27, 08:42
#4

Right, the menu was designed for that, but not for the latest x albums..:-)

I would suggest that you take a look at the plugin image_album_statistic.php that has the function for latest albums. The nightly build's version has been updated to optionally show title, desc and date. Since Zenphoto is about images I never thought of skipping them.... Would be not that hard, maybe I add that as an option.

Meanwhile, you could double and rename that function and make a custom function for your theme where you take out the image display. Of course you could just "hack" that function but you will have to remember that with any further updates. See our theming tutorial about the usage of custom functions.

Member
Member
wilsul   2008-05-31, 22:04
#5

Can the code below be used to show latest albums on the main page?

`

`

Member
Member
sbillard   2008-05-31, 23:59
#6

Not quite. functions in PHP are called by listing the function name followed by the parameters enclosed in open and close parens. So the code you want from your example above is:

printLatestAlbums(5, true, false, false, 40); or if you just want to use the default values as shown in the document printlatestAlbums()

Member
Member
wilsul   2008-06-01, 10:03
#7

thanks now it works, and is showing the latest albums but the path to the album is not showing good.

My zenphoto is located in a folder called pasteventsv3/zp-core

albums are showing www.site.com/album not www.site.com/pasteventsv3/album

how can i solve this?

Administrator
Administrator
acrylian   2008-06-01, 11:06
#8

You just found a bug....:-( I will take care of that.

EDIT: Sorry, not a bug, please check your htaccess file and run setup again. Maybe you forgot to copy thte included htaccess file.
Also try disabling mod_rewrite in the options.

Member
Member
wilsul   2008-06-01, 11:58
#9

I checked the htacces, and run setup again,
in the theme the links are fine, but with this code no, so that i can show the latest albums on another page.
`

`

Administrator
Administrator
acrylian   2008-06-01, 12:32
#10

Then it must be related to the ZENFOLDER and WEBPATH definitions. So I assume the page you want to show the latest albums on is on top level?

Member
Member
wilsul   2008-06-01, 13:30
#11

yes

Member
Member
wilsul   2008-06-01, 14:49
#12

this is the result html i get
`

[list][*]

[img]pasteventsv3/cache/2008/04%20MAY%202008%20-%20FEAST%20OF%20ST%20JOSEPH%20-%20PROCESSION/A1%20Procession%20leaves%20Basilica.jpg_100_cw85_ch85.jpg[/img]

04 MAY 2008 FEAST OF ST JOSEPH PROCESSION

Sun Jun 1 05:14:40 2008
[*]

[img]pasteventsv3/cache/2008/04%20MAY%202008%20-%20FEAST%20OF%20ST%20JOSEPH%20-%20VESPERS%20AND%20MASS/H8%20Concelebrants%20in%20procession%20back%20to%20Sacristy.jpg_100_cw85_ch85.jpg[/img]

04 MAY 2008 FEAST OF ST JOSEPH VESPERS AND MASS

Sat May 31 17:44:33 2008
[*]

[img]pasteventsv3/cache/2008/27%20APR%2008%20-%20SANT%20ANTON%20-%20END%20OF%20QUARANTORE%20-%20PROCESSION/F7.jpg_100_cw85_ch85.jpg[/img]

27 APR 08 SANT ANTON END OF QUARANTORE PROCESSION

Mon May 26 09:51:47 2008
[*]

[img]pasteventsv3/cache/2008/27%20APR%2008%20-%20SANT%20ANTON%20-%20END%20OF%20QUARANTORE/A6.jpg_100_cw85_ch85.jpg[/img]

27 APR 08 SANT ANTON END OF QUARANTORE

Mon May 26 09:51:10 2008
[*]

[img]pasteventsv3/cache/2008/17%20APR%2008%20-%20THIRD%20ANNIVERSARY%20OF%20ARCHPRIEST%20REFALO/D8%20Start%20of%20Adoration%20of%20Holy%20Eucharist.jpg_100_cw85_ch85.jpg[/img]

17 APR 08 THIRD ANNIVERSARY OF ARCHPRIEST REFALO

Mon May 26 09:50:27 2008
[/list]`

Member
Member
wilsul   2008-06-01, 21:06
#13

i solved it by adding the folder name in the following code on image_album_statistics.php
`function printAlbumStatisticItem($album, $option, $showtitle=false, $showdate=false, $showdesc=false, $desclength=40) {

global $_zp_gallery;

$tempalbum = new Album($_zp_gallery, $album['folder']);

    echo "name)."\" title=\"" . $tempalbum->getTitle() . "\">n";

    echo "getAlbumThumb()."\">n

";

    if($showtitle) {

        echo "name)."\" title=\"" . $tempalbum->getTitle() . "\">n";

        echo $tempalbum->getTitle()."n";

    }`
Administrator
Administrator
acrylian   2008-06-02, 07:41
#14

Ok, I see you apparently were using the 1.1.6, please try also the nightly, that corrects some issue in that plugin.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.