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.
Comments
This of course shows the thumbs of the latest albums.
Thanks, anyway.
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.
`<?php define('ZENFOLDER', 'zp-core');<br />
define('WEBPATH', 'pasteventsv3');
require_once (WEBPATH . "/" . ZENFOLDER . "/template-functions.php") ; //load extensions
$_zp_plugin_scripts = array();
$_zp_flash_player = NULL;
$curdir = getcwd();
chdir(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER);
$filelist = safe_glob('*'.'php');
chdir($curdir);
foreach ($filelist as $extension) {
$opt = 'zp_plugin_'.substr($extension, 0, strlen($extension)-4);
if (getOption($opt)) {
require_once(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . $extension);
}
}
?>
<?php void printLatestAlbums( [string $number = 5], [ $showtitle = true], [ $showdate = false], [ $showdesc = false], [ $desclength = 40] ) ?>`
`printLatestAlbums(5, true, false, false, 40);` or if you just want to use the default values as shown in the document `printlatestAlbums()`
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?
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.
in the theme the links are fine, but with this code no, so that i can show the latest albums on another page.
`<?php define('ZENFOLDER', 'zp-core');<br />
define('WEBPATH', 'pasteventsv3');
require_once (WEBPATH . "/" . ZENFOLDER . "/template-functions.php") ; //load extensions
$_zp_plugin_scripts = array();
$_zp_flash_player = NULL;
$curdir = getcwd();
chdir(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER);
$filelist = safe_glob('*'.'php');
chdir($curdir);
foreach ($filelist as $extension) {
$opt = 'zp_plugin_'.substr($extension, 0, strlen($extension)-4);
if (getOption($opt)) {
require_once(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . $extension);
}
}
?>
<?php printLatestAlbums(5, true, true, false, 40); ?>`
`
04 MAY 2008 FEAST OF ST JOSEPH PROCESSION
Sun Jun 1 05:14:40 2008
04 MAY 2008 FEAST OF ST JOSEPH VESPERS AND MASS
Sat May 31 17:44:33 2008
27 APR 08 SANT ANTON END OF QUARANTORE PROCESSION
Mon May 26 09:51:47 2008
27 APR 08 SANT ANTON END OF QUARANTORE
Mon May 26 09:51:10 2008
17 APR 08 THIRD ANNIVERSARY OF ARCHPRIEST REFALO
Mon May 26 09:50:27 2008
`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";
}`