########################################################################
# KBase Express #
# http://www.sensationdesigns.com/products/scripts/kbase_express #
# #
# Website: http://www.sensationdesigns.com #
# Contact: sales@sensationdesigns.com #
# Support: support@sensationdesigns.com #
# #
# KBase Express is NOT free software. It may NOT be redistributed in #
# any way. Please see the license agreement for further information: #
# http://www.sensationdesigns.com/policies/license.php #
# #
# Copyright (c) 2005 Sensation Designs. All rights reserved. #
########################################################################
require('data/config.php');
require('includes/functions.php');
dbConnect($cfg['db_host'], $cfg['db_user'], $cfg['db_pass'], $cfg['db_name']);
if ($_POST) { $searchterm = $_POST['searchterm']; }
elseif ($_GET) { $searchterm = $_GET['searchterm']; }
$errmsg = '';
if ($searchterm == '')
$errmsg = 'You did not enter in a search term';
elseif (strlen($searchterm) < 3)
$errmsg = 'Your search term must be at least 3 characters long';
if ($errmsg) {
require($cfg['tpl_dir'].'/error.php');
die();
}
$query = "SELECT id, cat_id, UNIX_TIMESTAMP(created) AS created, UNIX_TIMESTAMP(last_updated) AS last_updated, title, short_desc, view_count, print_count, email_count, ratings_1, ratings_2, ratings_3, ratings_4, ratings_5, MATCH(title, short_desc, body) AGAINST('ESPOO') AS score FROM articles WHERE MATCH(title, short_desc, body) AGAINST('$searchterm')";
$searchresults = mysql_query($query) or die('Error in MySQL query!
'.$query.'
Error #'.mysql_errno().': '.mysql_error());
require($cfg['tpl_dir'].'/search_results.php');
displayCopyright();
?>