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 />’; }
?>
I found the errant setting for search results and corrected it in the search preferences.
How does Livesearch choose which weblog to use for the templates? It currently is choosing the original “weblog1” settings.
Also, can the searching be restricted to a single weblog?
Livesearch appears to only be searching the title - is this true?
Can the simple_search be modified to accept 2 characters (3 seems to be the default)?
Do you think that the “keyboard navigation” will be added to the EE version.
Thanks Paul.
It searches all weblogs via title currently, and then creates the links based on that entry’s weblog’s Weblog URL.
Yes, only title.
Yes, but it requires a javascript change, look for this and change the 4 to a 3:
if (liveSearchReq && liveSearchReq.readyState < 4)
Sure, why not. This add-on is not a high priority so do not expect to see it for a while yet.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.