We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Live Search Plugin

Development and Programming

cshort's avatar
cshort
59 posts
16 years ago
cshort's avatar cshort
Hey, an update should be coming soon 😉! I’m shure Pascal Kriete will post it here.

Yeah…. 😊

Anyway, I figured it out and it’s something I should have checked sooner. The plugin has a trailing comma in the return JSON formatted string. While FF, Safari and other browsers play well with this, IE thinks there is a missing item because of it.

       
mschoening's avatar
mschoening
71 posts
16 years ago
mschoening's avatar mschoening

Yep you did figure it out 😉! Thats what the update includes hahaha!

       
cshort's avatar
cshort
59 posts
16 years ago
cshort's avatar cshort
Yep you did figure it out 😉! Thats what the update includes hahaha!

Which update? Every version of the plugin file I’ve found, including those linked here, have the same bug.

       
mschoening's avatar
mschoening
71 posts
16 years ago
mschoening's avatar mschoening

My prior post:

update should be coming soon
       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

I think he possibly means the update which “should be coming soon” 😉

       
mschoening's avatar
mschoening
71 posts
16 years ago
mschoening's avatar mschoening
I think he possibly means the update which “should be coming soon” 😉

There you go! :D

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete

The newest version is up. I’ve attached it to the first post until I get the download section of my site up and running.

Now with more awesome! Along with IE support it also adds two js options: width and center_results Example:

// Make the result box 200px wide and center it
$('#keywords').livesearch('http://example.com/search_results/livesearch/', {
        width: '200',
        center_results: true
});
       
cshort's avatar
cshort
59 posts
16 years ago
cshort's avatar cshort
I think he possibly means the update which “should be coming soon” 😉
There you go! :D

Sorry, I took that as sarcasm with the wink and all. 😊 Especially since it seems the next release for anything is always coming soon around here…

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Sorry it wasn’t meant to sound like sarcasm. My British humour getting the worst of me again!

I was just explaining what I thought he meant by it and the speech bit was just a copy of what had been said before, thus the wink.

Sorry about that it was never my intention for sarcasm, I try my best to steer clear of that beast wherever I can.

Best wishes,

Mark

       
cshort's avatar
cshort
59 posts
16 years ago
cshort's avatar cshort

Mark,

The interpreted sarcasm wasn’t from you, but maximilianschoening. Unless you’re posting under both ID’s. 😊 No biggie anyway…

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Oh okay I see now.

No I’m not both Max and myself, definitely two different people although in Max’s defence the wink was mine 😉

Best wishes,

Mark

       
cshort's avatar
cshort
59 posts
16 years ago
cshort's avatar cshort

lol…. Last comment on this thread… He had a wink too in his note about an update… 😊

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Agggghhh!!! You’re right. Didn’t see that one 😉 😊 😉

       
evarose's avatar
evarose
34 posts
16 years ago
evarose's avatar evarose

Many thanks for this most excellent plugin! I’ve got it installed and working… now, I just have to customize it to work as planned on my site.

My home page includes a program search and a presenter search (in addition to a standard keyword search) and I’d like to use livesearch for both of these, having the fields autosuggest titles from those two specific blogs only. So, based on that, I have two questions for you:

1) I have three search boxes running on the home page of my site – I’d like to implement livesearch on two of them. They all have unique ids (keywords, keywords2, keywords3) and I’ve modified the script to use the correct id, e.g.,

<scr*pt type="text/javascript" charset="utf-8">
            $('#keywords2').livesearch('{site_url}includes/livesearch/');
    </scr*pt>

Livesearch is working on the first of these search boxes, but not on the second. Any tips as to how I might further adjust to make this work? I tried creating & linking to a second livesearch template (includes/livesearch2) as a quick fix but this did not work…

2) Perhaps more important, is there any way to restrict the livesearch to a single blog? My search form is restricted, but livesearch is currently searching all entries and pulling up titles of entries (marker entries, admin guide) that should not be public.

Is this possible within the parameters of livesearch as currently constructed?

Thanks!

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
16 years ago
Pascal Kriete's avatar Pascal Kriete
1) I have three search boxes running on the home page of my site – I’d like to implement livesearch on two of them. They all have unique ids (keywords, keywords2, keywords3) and I’ve modified the script to use the correct id, e.g.,
<scr*pt type="text/javascript" charset="utf-8">
            $('#keywords2').livesearch('{site_url}includes/livesearch/');
    </scr*pt>

That’s what I would’ve done - I will take a look in a moment.

2) Perhaps more important, is there any way to restrict the livesearch to a single blog? My search form is restricted, but livesearch is currently searching all entries and pulling up titles of entries (marker entries, admin guide) that should not be public.

As of right now, it’s not available as a parameter. I have plans to do a major overhaul once EE2 is out to add features like this. For now, you can easily add it. Change this:

$sql = "SELECT distinct(a.entry_id), a.url_title, a.title, b.blog_url, b.comment_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 a.title ASC LIMIT 0,10";

To this:

$sql = "SELECT distinct(a.entry_id), a.url_title, a.title, b.blog_url, b.comment_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}%' ";
        
        if( $weblog = $TMPL->fetch_param('weblog') )
        {
            $sql .= "AND b.blog_name = '{$weblog}' ";
        }

$sql .=    "ORDER BY a.title ASC LIMIT 0,10";

Untested, but that should allow you to do: {exp:live_search:results weblog="weblogshortname"}

       
1 2 3 4 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.