Here, more or less, is a step by step process:
1. Grab his livesearch.js file and create your own file by the same name with its content. In that file, you will have to change the URL for grabbing the search data to one of your templates. I named my template ‘livesearch’ of all things. So find this:
liveSearchReq.open("GET", "./livesearch.php?s=" + document.forms.searchform.s.value);
And change it to this:
liveSearchReq.open("GET", "./index.php/livesearch/" + document.forms.searchform.s.value+"/");
Now, put that file at the root of your EE site.
2. Create a new template called ‘livesearch’ and have it set to parse PHP on input. Inside this file you will put the PHP code for performing the search and outputting the results. The search term will be sent along in the URL. Here is my quick example:
<?php
global $IN, $DB, $LOC;
if (!$IN->QSTR)
{
exit;
}
$search_phrase =& urldecode($IN->QSTR);
$query = $DB->query("SELECT distinct(a.entry_id), a.url_title, a.title, b.blog_url
FROM exp_weblog_titles a, exp_weblogs b
WHERE a.weblog_id = b.weblog_id
AND a.status != 'closed'
AND (a.expiration_date > '".$LOC->now."' OR a.expiration_date = '0')
AND a.title LIKE '%{$search_phrase}%'
ORDER BY rand() LIMIT 0,10");
if ($query->num_rows == 0)
{
exit('No Results');
}
foreach($query->result as $row)
{
echo '<a href="'.$row['blog_url'].$row['url_title'].'">'.$row['title'].'</a><br />';
}
?>
3. Determine where you want the search to go on your site. I am using Template 7, so I just substituted the new search for the EE simple search.
<h4>Blog LiveSearch:</h4>
<form onsubmit="return liveSearchSubmit()" name="searchform" method="get" action="/index.php"
>
<input type="text" id="livesearch" name="s" size="15" autocomplete="off" onkeypress="liveSearchStart()" />
</form>
<div id="LSResult" style="display: none;"><div id="LSShadow"></div></div>
Oh, and at the top of the page, you will have to include the javascript file:
<script type="text/javascript" src="livesearch.js"></script>