<?php	

	require_once('includes/visitor.inc.php');		
	
	$query     = request()->get('query', '');
	$sectionId = (int) request()->get('sectionId');
	$page      = (int) request()->get('page');

	if ($page < 1) {       
		$page = 1;
    }

    $smarty->assign('page', $page);
    $smarty->assign('query', $query);

/* saving visit */
	writeSearchVisit($query, $page);   

	$smarty->display('search.tpl');	

	/* precise load time */	
	updateLoadTime();

