Member
Member
jeronimo42   15-12-2013, 02:30
#1

Is there a way to setup zp to search only certain albums? On my site I have one directory where I keep all my photos, and then several dynamic albums that are generated by tags. Unfortunately when I search for an image I'm get duplicate results, one for every instance of the photo. Is there a way to limit the search to only ONE folder or album?

Administrator
Administrator
acrylian   15-12-2013, 09:37
#2

Yes, via coding. The official themes actually do this.

Member
Member
jeronimo42   15-12-2013, 16:49
#3

Could you provide the code for this? Thank you.

Administrator
Administrator
acrylian   15-12-2013, 18:21
#4

http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintSearchForm

Example in album.php of official themes like Zenpage or Default.

Member
Member
jeronimo42   18-12-2013, 00:54
#5

Thanks. Here's the code that worked for me where 'all' is the name of the album I'm searching:

`$album_list = array('albums'=>'all','pages'=>'0', 'news'=>'0');

printSearchForm('','searchform','',gettext('Search'),"$_zp_themeroot/images/media-eject-inv.png",null,$album_list);`

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