I've search into forum several times without find a solution, so i'm gonna explain what i'm looking for.
I'd like to do a search into a certain album, for example now if you search "photo" you'll find all the photos of all the albums that have the word "photo" in their meta. i'd like to have the possibility to do a search of "photo" into just an album, could anybody help me out?
Then compare and read the documentation before the function:
New in nightly:
function printSearchForm($prevtext=NULL, $id='search', $buttonSource=NULL, $buttontext='', $iconsource=NULL, $query_fields=NULL, $album_list=NULL)
Old 1.2.4:
printSearchForm($prevtext=NULL, $id='search', $buttonSource=NULL,$buttontext='', $iconsource=NULL)
im sorry im not a developer :-)
The searchform is already in album.php, and i add this
$album_list = array($_zp_current_album->name);
just below the function function printSearchForm()
But it doesn't work...so i'm asking where i have to add the array
Thanks again for the fast reply...
You of course need to pass the parameter to the function. After your $album_list definition you need printSearchForm(NULL, 'search', NULL, 'Seach album', NULL, NULL, $album_list).
Please read also this: http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/
sorry i don't understand...my function is:
`
function printSearchForm($prevtext=NULL, $id='search', $buttonSource=NULL, $buttontext='', $iconsource=NULL, $query_fields=NULL, $album_list=NULL) {
$album_list = array($_zp_current_album->name);
global $_zp_adminJS_loaded;
if(empty($buttontext)) {
$buttontext = gettext("Search");
} else {
$buttontext = sanitize($buttontext);
}
if (checkforPassword(true)) { return; }
$zf = WEBPATH."/".ZENFOLDER;
$dataid = $id . '_data';
$searchwords = (isset($_POST['words']) ? html_encode(sanitize($_REQUEST['words'],0),false) : '');
if (empty($buttonSource)) {
$type = 'submit';
$buttontext = 'value="'.$buttontext.'"';
} else {
$buttonSource = 'src="' . $buttonSource . '" alt="'.$buttontext.'"';
$buttontext = 'title="'.$buttontext.'"';
$type = 'image';
}
if (empty($iconsource)) {
$iconsource = WEBPATH.'/'.ZENFOLDER.'/images/searchfields_icon.png';
}
if (getOption('mod_rewrite')) { $searchurl = '/page/search/'; } else { $searchurl = "/index.php?p=search"; }
$engine = new SearchEngine();
$fields = array_flip($engine->allowedSearchFields());
if (!$_zp_adminJS_loaded) {
$_zp_adminJS_loaded = true;
?>
" />
I did but it got the same result...
in my album.php i add:
while in my template-function.php i have:
function printSearchForm($prevtext=NULL, $id='search', $buttonSource=NULL, $buttontext='', $iconsource=NULL, $query_fields=NULL, $album_list =NULL)
am i in the right way?