Share
Jeff Rambo 1:50am, 11 January 2005
Has anyone written a walkthrough on how to implement livesearch using kubrick and 1.5?

I've been redoing my site all day long but so far livesearch and adding the menu to my header are the two things I can't seem to figure out, and reviewing the past posts here have not helped much thus far. Frustrating...
mattmaber.com 17 years ago
Am I right in thinking you havent tried on your live site yet? As it doesnt seem to have any of the livesearch code in it.

And how do you mean "adding the menu to my header"? Which menu?
Jeff Rambo 17 years ago
Well I wasn't able to get past figuring out how to set it up in the first place, so you don't see it included in my code. I just uploaded the livesearch.js file once again and tried it a second time with no luck.

I went here for the instructions, but they weren't exactly easy to follow being new to this stuff: blog4.bitflux.ch/wiki/LiveSearch

Regarding the header, I managed to figure that out by viewing Michael's source. It seems as if the majority of my site will consist of crediting you all once it launches.
If you look at my site and grab the files then hopefully itll make more sense. It did take me a while to get working and theres a few things to note.

if you already know any of the following then sorry, but hopefully itll get you some way. BTW, [ & ] = trangular brackets so it doesnt freak out flickr

in the head
[script type="text/javascript" src="http://path/to/livesearch.js"] [/script]
[script type="text/javascript" src="http://path/to/addLoadEvent.js"] [/script]
[script type="text/javascript" src="http://path/to/liverequest.js"] [/script]
One of those is for livepreview but I cant remember which, also note I used abolute paths, not relative. You can just grab the files from my site if you like as they should be fine.

body tag
[body onload="liveSearchInit()"]
note that this seems to interfere with live preview so Ive turned off from my single pages, however the live preview script seems to do something which initiates livesearch as the only difference removing onload="liveSearchInit()" on single pages does is prevent using the arrow keys to navigate the search results

search area - ok, this could be dificult to write in flikr so you may like to just grab my code
[form style="margin: 8px 30px; padding: 0; float: right;" onsubmit="return liveSearchSubmit()" id="searchform" name="searchform" method="get" action="http://www.mybloghomepage.com" autocomplete="off"]
[input type="text" id="livesearch" name="s" value="search" size="22" onkeypress="liveSearchStart()" onblur="setTimeout('closeResults()',2000); if (this.value == '') {this.value = 'search blog archives';}" onfocus="if (this.value == 'search blog archives') {this.value = '';}" class="inputboxes" /]
[div id="LSResult" style="display: none;"><div id="LSShadow"][/div][/div]
[/form]
if you look in my css file, all the stuff starting LS is I think the livesearch stuff.


HOPEFULLY that is some help.
Jeff Rambo 17 years ago
Thanks Matthew, I'll try it out in the morning. Time to hit the bed for now.
Jeff Rambo 17 years ago
I *believe* I followed your steps to the t but I am having no luck.

www.jefframbo.com/justicerestored/

See search repository. Any idea what went wrong?
stimulating bucket [deleted] 17 years ago
Which "livesearch.php" are you using?

post a .phps?
Jeff Rambo 17 years ago
I don't have a livesearch.php...?
BradMcGonigle 17 years ago
I have most stuff working on my site but when I start typing something the results box pops up but says:

the requested url /livesearch.php was not found on the server.

I think this might be what fernando was referring to. Anyone know a fix for this...?
BradMcGonigle 17 years ago
Nevermind, I figured it out. I had to have a livesearch.php in the main wordpress directory. I used Michael's code that can be found here
Jeff Rambo 17 years ago
Hmm, I grabbed Michael's code and uploaded it but still can't figure it out. I shall continue to try.

The trials and tribulations, quite fun if I do say so myself...
:::evil chuckle:: I got it to work! Thanks everyone.

Although I am now noticing an error on all of my posts in IE. Can someone possibly tell me what is causing it?

www.jefframbo.com/justicerestored/ -- there is also an error being caused when you type in a search phrase (use "test) and then esc out of the livesearch results.
at2 17 years ago
hi !
I've been trying to follow all these steps and get Livesearch working but it doesn't... :(
I've first tried it with the Somefool code, then the search button was ok on my site and the search began on Somefool's site. OK
So I've tried to change the URL in "form style action=http://at2server.free.fr/wordpress" with mine but it doesn't work.
I start the search and it goes on my site index.

If anybody 's got time to answer or to check the site ;) Thanks a lot ! at2server.free.fr/wordpress
at2 17 years ago
Oh men ! I don't understand what's goin' on with my site but since i've posted my message a few seconds ago, the livesearch works fine... :) I didn't do anything for that ... Wordpress needs some time to refresh or what ?

Anyway..; what about the xml file ? What should I put in it ?
Thanks
at2 17 years ago
Then one more second later, it doesn't work anymore ! it's really drivin me crazy :( Help !
breakfastclubber 16 years ago
I'm looking at the code but I don't see where the livesearch.php is called. I followed all the instructions, but I don't know where to put the livesearch.php
clean ring [deleted] 16 years ago
livesearch.php should most likely go in the root of your blog.

I'm working on implementing livesearch directly into K2, no configuration necessary.
breakfastclubber 16 years ago
Thanks for the help! The livesearch wonderful, and I'm looking forward to having it on my site. I'm a bit new to PHP, but I'm taking a course in C/C++ (which I *think* PHP is related to), so I hope that I can soon make a contribution back to the blogging world, as a thank you for all the wonderful plugins and themes availible.
breakfastclubber 16 years ago
By the way, K2 is a beautiful theme, and it really sets itself apart from Kubrick. I'm looking forward to seeing the rest of the changes you're adding to it.
ahdont™ 16 years ago
where is that pt.php? what does it do?
knotty collar [deleted] 16 years ago
I am kind of wondering the same thing with the pt.php thing. I am running WP1.5 and I followed all the steps here, I have all the files setup, but nothing happens when I input something in the searchbox. Any thoughts?
stimulating bucket [deleted]
I got livesearch working here

Used the exact same files/method here but it doesn't work.

returns a "$base" error
clean ring [deleted] 16 years ago
(K2 will be in beta shortly, it should work in there and you can simply rip it from there.)
knotty collar [deleted] 16 years ago
Oh cool, can't wait :)
stimulating bucket [deleted] 16 years ago
K2!
Groups Beta