Here is the contents of the template “KB/livesearch” It was copied from this thread.
<?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 />’;
}
?>