Florian,
Our forum xss filter will remove <script> and </script> if you try to put them in a post, hence the * - replace it with an i.
That first line of code goes into the template that you filled with php. That tag does the actual processing of the post request when you start to search.
Hey Pascal,
I successfully extended the plugin to pull from three weblogs. The autocomplete works great but I would like for the autocomplete search window to disappear when I click somewhere else on the page. Right now it seems the only way to get rid of the window is to delete the entered search characters. Any ideas of what I’d have to add to the plugin?
thank you, kindly Florian
This is a great.
As it only has the ability to search titles does anyone know how to edit the plugin php so it can do this:
Live search returns no results. Instead of the default “No Result”, it returns:
“No result. Click here to use our advanced search page”
With the link going to a specified URL. i.e www.mysite.com/site/advanced_search/
thanks anyone
I couldn’t use
$('#keywords').livesearch('{site_url}search/livesearch/11/');
to search a specific section. Maybe it’s better to alter the following code in pi.live_search.php at line 54:
change:
$search_phrase =& $IN->QSTR;
in:
$search_phrase = (! isset($IN->SEGS[sizeof($IN->SEGS)])) ? '' : $IN->SEGS[sizeof($IN->SEGS)];
In this case, the plugin always searches the last segment.
Just my 2 cents..
Actually, I managed to fix that problem. However, now that I have the URLs working for my Structure pages, the links for my ‘standard’ weblogs don’t work, the ones with no page URLs. This is my code right now:
global $PREFS;
$site_pages = $PREFS->ini('site_pages');
$data = '[';
foreach($query->result as $row)
{
if (false !== $site_pages
&& isset($site_pages['uris'])
&& isset($site_pages['uris'][$row['entry_id']])
)
{
$path = $site_pages['uris'][$row['entry_id']];
}
else{
$path = $row[$link_to];
}
$data .= '{ "title" : "'.$row['title'].'", "path" : "'.$path.'" }, ';
}
// Take off the last comma
$data = substr($data, 0, -2);
$data .= ']';
echo $data;
exit;
This post describes how to limit it to a particular weblog. Doing the opposite is a little more complicated, but it’ll still be something along those lines.
Nevermind, IE6 wasn’t cool with gzipped JSON results. For posterity: if your livesearch.js implementation is giving you “invalid character” or other not-so-helpful errors in IE6 only, examine your page headers. I set up a test on a different server which worked, and finally got down to GZIP being the problem.
Thanks again, IE6.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.