[AJAX] Live Search

mastram

New Member
Version: 3.7.x

This is mod rewrite of that: Live Search 1.0 (AJAX) - vBulletin.org Forum

I'm added few functions:
  • search only, if typed >= 3 symbols;
  • header to window with button close;
  • message about no result;
  • limit number of threads;
  • highlight words in result
  • trim title of thread, if it large
Installation:
Upload all files from folder "upload" in root directory of your forum.
Import product
If you use vbadvanced, open vbulletin_ajax_live_search.js and add your forum path in var hurl="", like var hurl="http://your_site.com/forum/"
If you dont have opened search field, add this code where you prefer:

HTML:
<form action="search.php?do=process" method="post">
                    <div id="tb-searchdiv">
                        <div id="tb-searchbox"><input type="text" id="search_input" name="query" tabindex="1001" maxlength="128" value="$vbphrase[search_forums]" onfocus="if(this.value=='$vbphrase[search_forums]')this.value='';" onblur="if(this.value=='$vbphrase[search_forums]')this.value='';" onkeyup="showHint(this.value)" /></div>
                        <input type="hidden" name="do" value="process" />
                        <input type="hidden" name="quicksearch" value="1" />
                        <input type="hidden" name="childforums" value="1" />
                        <input type="hidden" name="exactname" value="1" />
                        <input type="hidden" name="s" value="$session[sessionhash]" />
                        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                    </div>
                    </form>

If you already have this form, find <input type="text" ... /> and after type="text" add id="search_input" onkeyup="showHint(this.value)"

Tuning:
For change position window and him style open template lsearch.
Edit this string:

HTML:
<div id="result_cont" class="alt2 tborder" style="width: 300px; height: 200px; position: absolute; top: 74px; right: 45px; z-index: 1000;">

and

HTML:
<div style="padding: $stylevar[cellpadding]px; height: 200px; overflow: auto;" id="search_results">

right: 74px // indentation from the right edge of the screen (left from left), set in px or in %
top: 45px // indentation from the top edge of the screen (bottom from bottom), set in px or in %
width: 300px // width of window, set in px or in %
height: 200px // height of window, set in px or in %
If you want change background color of window, replace alt2 with alt1, or remove alt2 and left of width add background-color: #XXXXXX, were XXXXXX - code your color.

Live DEMO: http://mixplay.ru/
Live video: YouTube - Live Search
 

buzzybuzz23

New Member
xHalloweenx said:
i couldn't get this to work

I use VBulletin 3.7.3 and it works perfectly..

Just find in NAVBAR: (in admincp)

Code:
<td class="vbmenu_option" title="nohilite">
				<form action="search.php?do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text"

And replace with:

Code:
<td class="vbmenu_option" title="nohilite">
				<form action="search.php?do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text" id="search_input" name="query" onkeyup="showHint(this.value)"

good luck!
 

Blagger

New Member
buzzybuzz23 said:
I use VBulletin 3.7.3 and it works perfectly..

Just find in NAVBAR: (in admincp)


Fantastic. Works perfectly.

I was going to have it running along side my normal search but couldnt work out how to put a fancy border and graphic around it and move the first window to somewhere else other than the left hand side of the forum.

Awesome
 

edzai

New Member
i get this error

Fatal error: Call to undefined function: str_ireplace() in /home/nonubcom/public_html/ajax_search.php on line 48
 

AHDL

New Member
edzai said:
i get this error

Fatal error: Call to undefined function: str_ireplace() in /home/nonubcom/public_html/ajax_search.php on line 48

I get same problem , please help
 

mad@Max

New Member
Mod is updated.
I grouped the templates and added another template.
Fatal error: Call to undefined function: str_ireplace() in /home/nonubcom/public_html/ajax_search.php on line 48
Ask your hosting provider why they deny this.
edzai, update mod to lasted version.
 

Damien White

New Member
It would be helpful if you started adding version numbers to your mods, or a change log so we can tell if the one in post #10 is different from post #1 and how they are different.
 

Curtis129

New Member
wow thanks man, this really works, can i possibly customise the actual text box itself? like make a image and then get the text box to be in the image?
 

leegao

New Member
Thanks, works perfectly here.

Remember to add a q_search and search_results element if you're using a custom style ;)
 

kazimhussain

New Member
buzzybuzz23 said:
I use VBulletin 3.7.3 and it works perfectly..

Just find in NAVBAR: (in admincp)

Code:
<td class="vbmenu_option" title="nohilite">
				<form action="search.php?do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text"

And replace with:

Code:
<td class="vbmenu_option" title="nohilite">
				<form action=[i][u]"search.php?[/i][/u]do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text" id="search_input" name="query" onkeyup="showHint(this.value)"

good luck!

Sorry but may i know if we re using AJAX LIVE SEARCH so why we would add SEARCH.PHP Instead of AJAX_SEARCH.PHP ?
 

h@ck3r

New Member
buzzybuzz23 said:
I use VBulletin 3.7.3 and it works perfectly..

Just find in NAVBAR: (in admincp)

Code:
<td class="vbmenu_option" title="nohilite">
				<form action="search.php?do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text"

And replace with:

Code:
<td class="vbmenu_option" title="nohilite">
				<form action="search.php?do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text" id="search_input" name="query" onkeyup="showHint(this.value)"

good luck!

When you say-

Just find in NAVBAR: (in admincp)

What do you mean by this exactly? Will there be a file on my server called NAVBAR, or do I find thise coding via logging into my admin cpanel? If I need to login and find this coding, where can I find it exactly? I can't find it :(
 

Curtis129

New Member
in your admin cp

style & templates> style manager > edit templates.
then scroll down to find navigation and breadcrumb templates>NAVBAR
 

h@ck3r

New Member
Curtis129 said:
in your admin cp

style & templates> style manager > edit templates.
then scroll down to find navigation and breadcrumb templates>NAVBAR

Thanks... I've done it now but I have an error.

Here's what I done to try and install this mod-


1. Upload all files from folder "upload" in root directory of your forum.
2. Import product
3. Found the following code-
Code:
<td class="vbmenu_option" title="nohilite">
				<form action="search.php?do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text"

...And replaced with-

Code:
<td class="vbmenu_option" title="nohilite">
				<form action="search.php?do=process" method="post">
					<input type="hidden" name="do" value="process" />
					<input type="hidden" name="quicksearch" value="1" />
					<input type="hidden" name="childforums" value="1" />
					<input type="hidden" name="exactname" value="1" />
					<input type="hidden" name="s" value="$session[sessionhash]" />
					<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
					<div><input type="text" id="search_input" name="query" onkeyup="showHint(this.value)"

Now when I click "search" on my forums homepage, type something in, then click search, I get this error-

vBulletin Message

Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.

Any idea's what the problem is?

Should I still be using the original search box or do I need to add this coding to create a new search box?

Code:
<form action="search.php?do=process" method="post">
                    <div id="tb-searchdiv">
                        <div id="tb-searchbox"><input type="text" id="search_input" name="query" tabindex="1001" maxlength="128" value="$vbphrase[search_forums]" onfocus="if(this.value=='$vbphrase[search_forums]')this.value='';" onblur="if(this.value=='$vbphrase[search_forums]')this.value='';" onkeyup="showHint(this.value)" /></div>
                        <input type="hidden" name="do" value="process" />
                        <input type="hidden" name="quicksearch" value="1" />
                        <input type="hidden" name="childforums" value="1" />
                        <input type="hidden" name="exactname" value="1" />
                        <input type="hidden" name="s" value="$session[sessionhash]" />
                        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                    </div>
                    </form>
 
Top