// This code has been obtained from http://www.zend.com/codex.php?id=763&single=1
// and modified for use in this DMS.
/*
php4swish-e 1.1, a web search interface for the swish-e search engine.
swish-e is a popular open-source search engine that runs on many platforms.
More information on swish-e is available at swish-e.org.
This code has been thoroughly tested and is ready for production
on any UNIX or Linux server that has the swish-e search engine installed.
You are free to modify this code as you see fit.
You must specify the path of swish-e ($swish) and
the location of the search index file ($search_index).
You will also need to change the default index file served if it is not index.php.
If you want the meta description information to display completely,
be sure the FALSE";
//print "
LQ=".$last_query;
//print "
SQ=".$search_query;
if( ( ($last_query != $search_query) || (strlen($search_query) < 2) ) && ($page == FALSE) ) dms_clear_search_results();
function dms_clear_search_results()
{
//print "
CLEAR
";
$_SESSION['dms_search_results'] = "";
}
function dms_display_search_results($page = 1)
{
global $dms_config, $search_query, $last_query;
$table_header_flag = FALSE;
$disp_nff_flag = TRUE;
$results_per_page = $dms_config['search_results_per_page'];
$total_number_pages = ceil($_SESSION['dms_search_results']['total_results']/$results_per_page);
$start = $results_per_page * $page - $results_per_page;
$end = $results_per_page * $page - 1;
if($end >= $_SESSION['dms_search_results']['total_results']) $end = $_SESSION['dms_search_results']['total_results'] - 1;
//print "
S: ".$start;
//print "
E: ".$end;
for($i = $start; $i <= $end; $i++)
{
$disp_nff_flag = FALSE;
if ($table_header_flag == FALSE)
{
$table_header_flag = TRUE;
if($_SESSION['dms_search_results']['total_results'] > $results_per_page)
{
print "
\r";
print " | \r";
print "