From 875a6b15c89f168e15faf74af9efe180e1bb909e Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 15 May 2006 22:21:08 +0000 Subject: merge -r1312:1313 from branch 1.6 to trunk (bug 373 fixed) git-svn-id: http://piwigo.org/svn/trunk@1314 68402e56-0260-453c-a942-63ccdbb3a9ee --- search.php | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'search.php') diff --git a/search.php b/search.php index 0701eafa1..5131680d6 100644 --- a/search.php +++ b/search.php @@ -177,28 +177,39 @@ include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames( array('search'=>'search.tpl') ); +$template->assign_vars( + array( + 'TODAY_DAY' => date('d', time()), + 'TODAY_MONTH' => date('m', time()), + 'TODAY_YEAR' => date('Y', time()), + 'S_SEARCH_ACTION' => 'search.php', + 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=search', + 'U_HOME' => make_index_url(), + ) + ); + $available_tags = get_available_tags( isset($user['forbidden_categories']) ? explode(',', $user['forbidden_categories']) : null ); -usort( $available_tags, 'name_compare'); - -$template->assign_vars(array( - 'TODAY_DAY' => date('d', time()), - 'TODAY_MONTH' => date('m', time()), - 'TODAY_YEAR' => date('Y', time()), - 'S_SEARCH_ACTION' => 'search.php', - 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=search', - 'U_HOME' => make_index_url(), - - 'TAG_SELECTION' => get_html_tag_selection( - $available_tags, - 'tags', - isset($_POST['tags']) ? $_POST['tags'] : array() - ), - ) -); + +if (count($available_tags) > 0) +{ + usort( $available_tags, 'name_compare'); + + $template->assign_block_vars('tags', array()); + + $template->assign_vars( + array( + 'TAG_SELECTION' => get_html_tag_selection( + $available_tags, + 'tags', + isset($_POST['tags']) ? $_POST['tags'] : array() + ), + ) + ); +} //------------------------------------------------------------- categories form $query = ' -- cgit v1.2.3