4 of 6
4
LiveSearch
Posted: 24 August 2004 10:30 AM   [ Ignore ]   [ # 55 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

Programming school is on my list of to-dos :}

I made the change to the <body> tag—but am still getting an “error on page” The warning icon said- line: 16 char: 1, error:object expected code:0

Profile
 
 
Posted: 24 August 2004 10:43 AM   [ Ignore ]   [ # 56 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Try changing the call to the javascript file:

<script type=“text/javascript” src=”/livesearch.js”></script>

 Signature 
Profile
 
 
Posted: 24 August 2004 10:52 AM   [ Ignore ]   [ # 57 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

Things are improving—when I enter text into the box there is no “error on page” but as soon as I stop typing a second searchbox appears.

If I hit the enter key I get another flashed “error on page” message and an empty page opens.

Profile
 
 
Posted: 24 August 2004 11:02 AM   [ Ignore ]   [ # 58 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

In the JavaScript try making an absolute link as well:

liveSearchReq.open(“GET”, “/welcome.php/KB/livesearch?s=....etc.

 Signature 
Profile
 
 
Posted: 24 August 2004 11:06 AM   [ Ignore ]   [ # 59 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

Yes, this is what the javascript contains.

Profile
 
 
Posted: 24 August 2004 11:08 AM   [ Ignore ]   [ # 60 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

According to my browser it has a ./welcome.php there.  I want to remove the period and make it absolute.  I think the browser’s hate us.

 Signature 
Profile
 
 
Posted: 24 August 2004 11:15 AM   [ Ignore ]   [ # 61 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

...as my son would say “my bad” - I missed the period in the code.

No errors now, but also no results for “search” which generates 5 results via the simple search.

Profile
 
 
Posted: 24 August 2004 11:44 AM   [ Ignore ]   [ # 62 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

I think there is something wrong with the template that does the actual search.  No matter what I put in the URL, I get No Results every time.  Ex:

http://www.yoursite.com/welcome.php/KB/livesearch?s=search

 Signature 
Profile
 
 
Posted: 24 August 2004 11:58 AM   [ Ignore ]   [ # 63 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

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 />’;
}

?>

Profile
 
 
Posted: 24 August 2004 12:05 PM   [ Ignore ]   [ # 64 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Well, call me a fool, I should have seen the problem sooner.  Try this:

liveSearchReq.open(“GET”, “/welcome.php/KB/livesearch/” + document.forms.searchform.s.value + “/”);

 Signature 
Profile
 
 
Posted: 24 August 2004 12:18 PM   [ Ignore ]   [ # 65 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

It works…wise one. Thanks.

Where do I change the search results page that is used? It is dumping out to a different page than the simple search results.

Profile
 
 
Posted: 24 August 2004 12:24 PM   [ Ignore ]   [ # 66 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Upon submission?  The problem is that the EE search is too complicated for such a simple form.  The original incarnation of it had the form go to the first result, but that would require making everything a bit more complicated.

 Signature 
Profile
 
 
Posted: 24 August 2004 12:36 PM   [ Ignore ]   [ # 67 ]  
Lab Assistant
RankRank
Total Posts:  182
Joined  10-07-2003

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.

Profile
 
 
Posted: 24 August 2004 12:39 PM   [ Ignore ]   [ # 68 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

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.

 Signature 
Profile
 
 
Posted: 16 September 2004 08:07 AM   [ Ignore ]   [ # 69 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  276
Joined  06-12-2002

Any more thoughts on making this an actual plugin?

Profile
 
 
Posted: 16 September 2004 08:17 AM   [ Ignore ]   [ # 70 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Still a really cool plugin idea, but still no time soon.  I have a nice list of things I *must* do before I can focus on this, but if anyone wants to try their hand at it I could probably give pointers in the Developer forums.

 Signature 
Profile
 
 
Posted: 30 October 2004 02:31 PM   [ Ignore ]   [ # 71 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  139
Joined  05-18-2004

this is awesome.  I was pulling my hair out trying to get something to work with this script, then I found this thread and viola!  Yay!  thanks smile

 Signature 


EE Services & Migration • Blog Design Small Business Blogs & Websites • Site Development
Member of the EE Professional NetworkGet in touch today!

Profile
 
 
Posted: 09 February 2005 08:55 PM   [ Ignore ]   [ # 72 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  154
Joined  11-11-2004

I just deployed this on my test pages in like 10 minutes… Paul/Chris/LJ thanks for the tips/ideas and code smile

 Signature 

John Hoke

Profile
 
 
   
4 of 6
4
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 23
Total Topics: 82016 Total Anonymous Users: 17
Total Replies: 440817 Total Guests: 170
Total Posts: 522833    
Members ( View Memberlist )