Member
Member
minutepapillon   26-11-2010, 20:15
#1

Hi guys,
i am trying to create a search button that will retun results contained only in the current album (and its sub albums).
I use this variable of the printSearchForm function:
array $album_list: optional array of albums to search

I try to create my array (I'm a zero in php, I only use AS3 ...)
But I don't know what to give to the fuction ( album id, name ?) and how to give it (php syntax, ZP ignorance ...)
See my last attempt

            `               




            `

Thanks for your help !
bye

Member
Member
kagutsuchi   26-11-2010, 21:50
#2

The $album_list variable should be an array of folder names for each album you want included in the search.

Please do note, however, that printSearchForm() will be changing in the next release. After 1.3.2, the format of $album_list will change to be a multi-dimensional array, so you should pass the list in the form of:

array('albums' => $album_list);

Member
Member
minutepapillon   26-11-2010, 22:01
#3

Thanks kagutsuchi,
So how can I create the $album_list array to contain the name of the current album and its subalums ?

Member
Member
kagutsuchi   27-11-2010, 00:13
#4

I'm not sure whether or not an album automatically includes its subalbums or not. If it does, then you should simply be able to add $_zp_current_album->name to the array. If not, then you will have to manually add its subalbums to the array.

Member
Member
minutepapillon   27-11-2010, 00:14
#5

Got it !
`
$album_list = $_zp_current_album->getAlbums();
$album_list[] = $_zp_current_album->name;

if (getOption('Allow_search')) { printSearchForm( '','searchform','',gettext('SEARCH'),"$_zp_themeroot/images/search-drop.png",NULL,$album_list ); }
`

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