This is the PHP code for the new search.php using Smarty
===============================================================
wwsr_register_css('wwsrSearch.css');
$smarty->wwsr_set_section_title('Search');
$smarty->wwsr_set_page_title('Search WWSR');
$smarty->wwsr_register_facet('search_wwsr.tpl');
$smarty->display('searchPage');
if(isset($_REQUEST['searchSelection']) )
{
$smarty->wwsr_register_facet('search.tpl');
switch($_REQUEST['searchSelection'])
{
case "people":
$searchString = $_GET['searchQuery'];
$searchPeople = new WWSR_Search(WWSR_DB_DB,WWSR_DB_US,WWSR_DB_PA,"$searchString","people",WWSR_DB_HOST);
// Validate the search string, if nothing is entered, show a message and exit.
$resultSet = array();
$resultSet = $searchPeople->validateSearch();
if( count($resultSet) > 0 )
{
$smarty->assign('searchClass', 'noRecord' );
$smarty->assign('searchResult', '$resultSet');
break;
}
// User has entered a search string, perform the search.
$resultSet = array();
$searchPeople->doBasicSearch('long','0','10');
$resultSet = $searchPeople->getResult();
if(count($resultSet) == 0 )
....
....
This is the code of the template search.tpl (residing in templates directory)
================================================================================
<%* main WWSR frame template
$Id: search.tpl 130 2006-06-02 22:09:16Z rajib $
*%>
<% if $searchClass eq "noRecord" %>
Too many results returned, please enter keywords to narrow down your search
<%/if%> <% if $searchClass eq "people" %>No results found for <% searchString %>
No results found for <% searchString %>