PDA

View Full Version : Add-On Releases - Live Search 1.0 (AJAX)


coderphp
08-07-2007, 10:00 PM
About the hack
==============
The hack adds a quick live search form to your forum's at any place you want it,
results are to be shown exactly under the search field as you type (by ajax)

Supported browsers
==============
IE6, IE7, FF2, Opera 9

Demo
====================
http://www.montadaphp.net
right under the logo :)

How to Install
==============
1- Add the following code to the end of ur "headinclude" template:
<script type="text/javascript">
/***********************************************
* Drop Down/ Overlapping Content- ? Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display="block"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0)
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}
var xmlHttp3
function showHint(word)
{
document.getElementById('search_results').innerHTM L = '<p></p><p></p><p align="center" class="smallfont"><img src="images/progress.gif" />Searching..</p>';
xmlHttp3=GetXmlHttpObject3()
if (xmlHttp3==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="ajax_search.php"
url=url+"?query="+word
xmlHttp3.onreadystatechange=stateChanged3
xmlHttp3.open("GET",url,true)
xmlHttp3.send(null)
}

function stateChanged3()
{
if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
{
document.getElementById("search_results"). innerHTML='<div align="left"><a href="#" onClick="overlayclose(\'search_results\'); return false">x</a></div>'+xmlHttp3.responseText;
return overlay(this, 'search_results')
}
}

function GetXmlHttpObject3()
{
var objXMLHttp3=null
if (window.XMLHttpRequest)
{
objXMLHttp3=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp3=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp3
}
</script>2- Add the following code wherever you want the search field to appear, for me i added to the "header" template exactly under the logo:
<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]" />
Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>3- Upload the contents of folder "Upload" to ur froum's home directory.

and u r done

If u like the hack please dont forget to click INSTALL :)

beduino
08-08-2007, 07:01 PM
Interesting!
Tks 4 share
Beduino

JD45
08-08-2007, 07:12 PM
Could this be integrated in to the existing search field instead of creating another one?

coderphp
08-08-2007, 07:18 PM
Could this be integrated in to the existing search field instead of creating another one?

of course it could

How?
do steps 1 and 3
then
add the onclick event to the search field:

onkeyup="showHint(this.value)"


then, after the field, add the hidden div where the search results appears:

<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>

ahmedeldeep
08-08-2007, 07:27 PM
Goog work mahmoud

coderphp
08-08-2007, 07:28 PM
Goog work mahmoud
thanx ahmed for ur support ;)

dethfire
08-08-2007, 07:57 PM
how server intensive is this? could it be abused?

coderphp
08-08-2007, 08:01 PM
how server intensive is this? could it be abused?
there is no limitation for the search frequency, as the code is to be executed on every key press

for me i didnt suffer from any abuse of usage
u can decide ur self if it is suitable for u or not :)

iogames
08-08-2007, 09:04 PM
Queries?

cairocairo
08-08-2007, 10:01 PM
Goog work mahmoud

TheBlackPoet
08-08-2007, 10:33 PM
this is very nice... it is efficient.. and it gives my site that...... RIGHT NOW feel.. for a microwave age....

installed!

4x4 Mecca
08-08-2007, 11:04 PM
I still see some foreign language when I am changing search terms... How do I fix that?

4x4 Mecca
08-08-2007, 11:45 PM
Ok, I found it in the first edit, and changed it to "Searching..."

asw
08-08-2007, 11:55 PM
And I'm glad you did! I've been looking and looking on how to remove the foreign language as well.
Many thanks! Great Hack!

4x4 Mecca
08-09-2007, 12:04 AM
Right now all my search result text is white for some reason.. I made the background navy to see the text, where would I change the text color?

coderphp
08-09-2007, 12:45 AM
Queries?
Only one query which searches the database

coderphp
08-09-2007, 12:46 AM
Goog work mahmoud

thanx

coderphp
08-09-2007, 12:46 AM
this is very nice... it is efficient.. and it gives my site that...... RIGHT NOW feel.. for a microwave age....

installed!

thank u

coderphp
08-09-2007, 12:47 AM
I still see some foreign language when I am changing search terms... How do I fix that?

Ok, I found it in the first edit, and changed it to "Searching..."

fixed in the original post... sorry for the mess

coderphp
08-09-2007, 12:50 AM
And I'm glad you did! I've been looking and looking on how to remove the foreign language as well.
Many thanks! Great Hack!
many thanx to u

Right now all my search result text is white for some reason.. I made the background navy to see the text, where would I change the text color?
the search results text is taking the color of ur "smallfont" class..
if it is white it will be white too

dbirosel
08-09-2007, 04:03 AM
Will this ever work for the Opera Browser? Subscribed.

JD45
08-09-2007, 04:10 AM
of course it could

How?
do steps 1 and 3
then
add the onclick event to the search field:

onkeyup="showHint(this.value)"


then, after the field, add the hidden div where the search results appears:

<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


Thank you much!

FreshFroot
08-09-2007, 04:25 AM
i'll try this out, looks great.

TheBlackPoet
08-09-2007, 04:35 AM
Right now all my search result text is white for some reason.. I made the background navy to see the text, where would I change the text color?


if you want to change the text code... its probably in the Main CSS

<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


that worked for me....

I was looking at the css.. and if i have time tomorrow (if the coder dont mind).. i want to see if i can make the background with a little less opacity (transparent).... that'll be cool...

Brew
08-09-2007, 06:13 AM
There is a bug in the ajax_search.php file

You've forgotten to add code in there for table prefixes.

In my setup I used vb_ for my tables of vBulletin so this mod gives DB errors.

I included an image showing the DB error below.

I hard coded my table prefix to the file but you'll need to use the variable to fix it.

It's working BTW.

Good job!

apdcanari
08-09-2007, 06:20 AM
Good hack :)

/images/progress.gif (empty)

Overflow

<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]" />
<strong>Live Search</strong> <input type="text" name="query" size="25" class="search" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none; overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>

Brew
08-09-2007, 06:29 AM
Good hack :)

/images/progress.gif (empty)

Overflow

<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]" />
<strong>Live Search</strong> <input type="text" name="query" size="25" class="search" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none; overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>

Thanks!

That looks much better :)

rainyleaves
08-09-2007, 07:26 AM
Great mod.
But you have forgotten to add code in there for table prefixes.

Database error in vBulletin 3.6.8:

Invalid SQL:
SELECT * FROM `thread` WHERE `title` LIKE '%24%' AND `thread`.`forumid` NOT IN (0 );

MySQL Error : Table '*****.thread' doesn't exist
Error Number : 1146
Date : Thursday, August 9th 2007 @ 05:23:39 PM
Script : http://*****.***/forums/ajax_search.php?query=24
Referrer : http://*****.***/forums/newthread.php?do=newthread&f=6
IP Address : *******
Username : *****
Classname : vB_Database

Please help...
Thanks.. :)

StrifeX
08-09-2007, 07:41 AM
I'm having the same problem, i get a database error saying there is a problem with the table prefix...

FReeSTER
08-09-2007, 07:55 AM
Im getting a data base error. :confused:

Database error in vBulletin 3.6.5:

Invalid SQL:
SELECT * FROM `thread` WHERE `title` LIKE '%c%' AND `thread`.`forumid` NOT IN (0 ,186);

MySQL Error : Table 'satpro_web.thread' doesn't exist
Error Number : 1146
Date : Thursday, August 9th 2007 @ 06:03:07 AM
Script : http://www.satprolatino.tv/ajax_search.php?query=c
Referrer : http://www.satprolatino.tv/foro.php
IP Address : **.242.***.7
Username : El Intocable
Classname : vb_database

FReeSTER
08-09-2007, 08:01 AM
Damn, do this work for vb3.6.5 ?:o

coderphp
08-09-2007, 08:25 AM
Will this ever work for the Opera Browser? Subscribed.
yes tested on Opera 9.x and it is working

coderphp
08-09-2007, 08:27 AM
i'll try this out, looks great.

thanx

coderphp
08-09-2007, 08:28 AM
if you want to change the text code... its probably in the Main CSS

<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


that worked for me....

I was looking at the css.. and if i have time tomorrow (if the coder dont mind).. i want to see if i can make the background with a little less opacity (transparent).... that'll be cool...

thank u for ur support
of course u can add what ever code modification to the mod ... also u can put it here for the other members

coderphp
08-09-2007, 08:30 AM
There is a bug in the ajax_search.php file

You've forgotten to add code in there for table prefixes.

In my setup I used vb_ for my tables of vBulletin so this mod gives DB errors.

I included an image showing the DB error below.

I hard coded my table prefix to the file but you'll need to use the variable to fix it.

It's working BTW.

Good job!
fixed.. please re-download the attached file :)

coderphp
08-09-2007, 08:34 AM
Good hack :)

/images/progress.gif (empty)

Overflow

<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]" />
<strong>Live Search</strong> <input type="text" name="query" size="25" class="search" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none; overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>

thanx that looks better...

if u dont mind added to the original file

coderphp
08-09-2007, 08:36 AM
Great mod.
But you have forgotten to add code in there for table prefixes.



Please help...
Thanks.. :)

I'm having the same problem, i get a database error saying there is a problem with the table prefix...

fixed :)

coderphp
08-09-2007, 08:37 AM
Damn, do this work for vb3.6.5 ?:o

of course it is working

rainyleaves
08-09-2007, 08:43 AM
Re-downloaded and re-install.
Same error...

Database error in vBulletin 3.6.8:

Invalid SQL:
SELECT * FROM `thread` WHERE `title` LIKE '%24%' AND `thread`.`forumid` NOT IN (0 );

MySQL Error : Table '*****.thread' doesn't exist
Error Number : 1146
Date : Thursday, August 9th 2007 @ 06:40:48 PM
Script : http://*******/forums/ajax_search.php?query=24
Referrer : http://******/forums/index.php
IP Address : ************
Username : ********
Classname : vB_Database

Thanks.. :)

coderphp
08-09-2007, 10:04 AM
Re-downloaded and re-install.
Same error...



Thanks.. :)

updated now
please redownload

rainyleaves
08-09-2007, 10:36 AM
I got Another error.
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Then, I hard coded my table prefix...

$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist)");
---------->
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND ". TABLE_PREFIX ."thread . forumid NOT IN (0 $excludelist)");
Now works fine.... :)

BTW, Awesome mod !!!!
Thanks, Coderphp :)

coderphp
08-09-2007, 10:41 AM
I got Another error.

Then, I hard coded my table prefix...


Now works fine.... :)

BTW, Awesome mod !!!!
Thanks, Coderphp :)

thanx ..

please click install if u like it :)

rainyleaves
08-09-2007, 10:53 AM
Just Installed and MOTM :)

Crazy Serb
08-09-2007, 11:27 AM
you do realize that this script behaves differently on Firefox and IE browsers... on Firefox it displays the results div either far left or far right on the page (NOT beside the search box), while on IE it does display it right beside the search box but it comes up with some JavaScript error (check your status bar).

Any way to make this work on FF the same way it does on IE?

StrifeX
08-09-2007, 11:42 AM
I got Another error.

Then, I hard coded my table prefix...


Now works fine.... :)

BTW, Awesome mod !!!!
Thanks, Coderphp :)Wow, thanks for the solution to my problem :)

Btw coderphp, i downloaded the new version of your mod and i had the same problem, you might want to add rainyleaves' code into your php file... And you might also want to update the version of your hack to like 1.01 :p.

Also, how do i get the text to show "Searching..." instead of "???? ???????.." while searching?

Magnumutz
08-09-2007, 12:55 PM
This is awesome... Thanks.
*Installed*

Regs
08-09-2007, 01:00 PM
Someone asked earlier about queries... does this not query the server on every key press?

It's a very good idea but not too sure it is friendly for a large, busy site?

Cheers,

~Regs.

Magnumutz
08-09-2007, 01:06 PM
There's only 1 (ONE) query: https://vborg.vbsupport.ru/showpost.php?p=1313195&postcount=16

Regs
08-09-2007, 01:41 PM
Yes, I read that. But my question remains - is this one query on every keystroke?

Brew
08-09-2007, 02:15 PM
In FireFox the mod looks great but it's a bit different in IE. The box comes up too small in IE.

EDIT:
I forgot to mention that the below pics were taken after adding the code for the div statement from another reply; overflow:auto; height:200px but the layout is the same with or without the change.

Examples below..The first image is FF the second is IE..

Brew
08-09-2007, 02:18 PM
Yes, I read that. But my question remains - is this one query on every keystroke?

Seeing as how the script grabs info from the server in order to insert the links I would say it's safe to assume that each keystroke causes one query.

coderphp
08-09-2007, 04:12 PM
When i type in the search field, this error pops out in search results table..



Any ideas.. as I would install this on my live site in a snap...

Thanks.
it seems u have a problem in the file "ajax_search.php"
Please try to upload the file again... and tell me if the problem presists

This is awesome... Thanks.
*Installed*
thanx :)

Someone asked earlier about queries... does this not query the server on every key press?

It's a very good idea but not too sure it is friendly for a large, busy site?

Cheers,

~Regs.
Yes ti do one query every keypress
again i tested on medium forum (mine) and it didnt show any problems till now
i didnt test on large forums
if it appear to be a problem on large forums we could add a time limit then :) but i dont like to do so now cause it no longer be LIVE SEARCH

Yes, I read that. But my question remains - is this one query on every keystroke?
yes as mentioned on every key stroke

In FireFox the mod looks great but it's a bit different in IE. The box comes up too small in IE.

EDIT:
I forgot to mention that the below pics were taken after adding the code for the div statement from another reply; overflow:auto; height:200px but the layout is the same with or without the change.

Examples below..The first image is FF the second is IE..
what versions do u use of browsers? i tested it on the browsers mentioned in the first post and it is working good :)

coderphp
08-09-2007, 04:14 PM
Wow, thanks for the solution to my problem :)

Btw coderphp, i downloaded the new version of your mod and i had the same problem, you might want to add rainyleaves' code into your php file... And you might also want to update the version of your hack to like 1.01 :p.

Also, how do i get the text to show "Searching..." instead of "???? ???????.." while searching?
table prefix already added
also template edit updated.. please install the updated ones

coderphp
08-09-2007, 04:17 PM
In FireFox the mod looks great but it's a bit different in IE. The box comes up too small in IE.

EDIT:
I forgot to mention that the below pics were taken after adding the code for the div statement from another reply; overflow:auto; height:200px but the layout is the same with or without the change.

Examples below..The first image is FF the second is IE..
i think that is because u combine the mod to the DHTML search menu
infact i didnt test it in the DHTML menu but only in the header portion of the page, outside the DHTML menu

Brew
08-09-2007, 04:51 PM
i think that is because u combine the mod to the DHTML search menu
infact i didnt test it in the DHTML menu but only in the header portion of the page, outside the DHTML menu

I really don't know much about DHTML and AJAX.

I wonder if there is something to add to either the DHTML or this mod to make it work correctly in IE within the stock search dropdown.

BTW, My Internet Explorer version is 7.0.5730.11

Quantnet
08-09-2007, 05:06 PM
Very nice mod. Installed.

In my search, there is a radio button to select Post or Thread, can you modify the code so it can search post as supposed to search Thread by default now.

You can look at the site on my signature to see my search box

Quantnet
08-09-2007, 05:17 PM
not sure if this is a bug

On FF, the search result displayed on the ajax box is left aligned while in Opera 9.22, it's right aligned

Also, i have a wiki on my site at www.quantnet.org/wiki but the search box is no longer working there. The default select radio button is disappear on the wiki site. Thread is selected by default on the forum site but as soon as i go to my wiki site, the select disappear so i can't search anymore

Quantnet
08-09-2007, 05:30 PM
Here is the code of the search box that i have in my navbar template

<!-- search -->
<if condition="$show['searchbuttons']">
<td align="right" nowrap="nowrap" valign="top">
<if condition="$show['member']">
<form action="search.php?do=process" method="post">
<else />
<form action="search.php$session[sessionurl_q]" method="post">
</if>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px" title="nohilite">




<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]" />


Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


</td>
<td nowrap="nowrap" id="navbar_search" class="smallfont">&nbsp;<a href="search.php$session[sessionurl_q]">Options</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
</tr>
<tr>
<td colspan="2" style="font-size:10px" title="nohilite" nowrap="nowrap">
Show: <label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked" />threads</label>

<label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003" />posts</label>
</td>
</tr>
</table>
</form>
<!-- / search -->

Quantnet
08-09-2007, 05:34 PM
Found another error:

I have this error when i search while I'm on the home page (i have vbAdvanced as homepage)

http://www.mysite.com/ 68.198.xxx.xxx /ajax_search.php?query=ds www.mysite.com Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 404 Please contact admin@xxx.org if you can not find the content you are looking for.

coderphp
08-09-2007, 05:43 PM
I really don't know much about DHTML and AJAX.

I wonder if there is something to add to either the DHTML or this mod to make it work correctly in IE within the stock search dropdown.

BTW, My Internet Explorer version is 7.0.5730.11

again the problem is the width of DHTML drop down menu is fixed
so u should better install this mod directly in the header portion of the page
or any place outside the drop down menu

Brew
08-09-2007, 05:46 PM
I'm sorry but I have to uninstall this mod, as much as I want to use it.

I just don't have anywhere to put a custom search box on the site. The default location of the box in the navbar is the only place I can use this, but it does not work there with Internet Explorer.

If anyone can make it work in the standard search box (the DHTML dropdown search form) please post here ?

Thanks!

coderphp
08-09-2007, 05:49 PM
Very nice mod. Installed.

In my search, there is a radio button to select Post or Thread, can you modify the code so it can search post as supposed to search Thread by default now.

You can look at the site on my signature to see my search box
searching posts will have a high load on server
so i dont think it will be good to do that using Live Search

not sure if this is a bug

On FF, the search result displayed on the ajax box is left aligned while in Opera 9.22, it's right aligned

Also, i have a wiki on my site at www.quantnet.org/wiki (http://www.quantnet.org/wiki) but the search box is no longer working there. The default select radio button is disappear on the wiki site. Thread is selected by default on the forum site but as soon as i go to my wiki site, the select disappear so i can't search anymore
please re-install the template modification as i think u did something wrong with it
the alignment is adjusted automatically according to ur forums alignment

Found another error:

I have this error when i search while I'm on the home page (i have vbAdvanced as homepage)

http://www.mysite.com/ 68.198.xxx.xxx /ajax_search.php?query=ds www.mysite.com (http://www.mysite.com) Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 404 Please contact admin@xxx.org if you can not find the content you are looking for.
this is not an error
the Mod is supposed to work only on forum's pages
not tested on VBAdvanced or any other Mod

thanx :)

TheBlackPoet
08-09-2007, 06:42 PM
I added an opacity to this cool hack... i also added it to a customed table... so notice the <td></td> tag....

if you want to lighten or darken the opacity... (transparency)

make the change here
<div id="search_results" class="smallfont" style="position:absolute; border: 5px solid #999999; color:white; filter:alpha(opacity=85); background-color: gray; width: 300px; padding: 8px; display:none">

coderphp
08-09-2007, 08:22 PM
I added an opacity to this cool hack... i also added it to a customed table... so notice the <td></td> tag....

if you want to lighten or darken the opacity... (transparency)

make the change here
<div id="search_results" class="smallfont" style="position:absolute; border: 5px solid #999999; color:white; filter:alpha(opacity=85); background-color: gray; width: 300px; padding: 8px; display:none">

Excellent Malik !!

I put ur version to my forum :)

i also added:

-moz-opacity:.85;opacity:.85;

for the code to work on Firefox 2

Deepdog009
08-09-2007, 09:08 PM
I added an opacity to this cool hack... i also added it to a customed table... so notice the <td></td> tag....

if you want to lighten or darken the opacity... (transparency)

make the change here
<div id="search_results" class="smallfont" style="position:absolute; border: 5px solid #999999; color:white; filter:alpha(opacity=85); background-color: gray; width: 300px; padding: 8px; display:none">


Didn't think I needed this, but now I do...

Great work
***********
coderphp
TheBlackPoet

Quantnet
08-09-2007, 10:11 PM
this is not an error
the Mod is supposed to work only on forum's pages
not tested on VBAdvanced or any other Mod
thanx :)
I see.

Do you think it will be a next feature :D

Lot of people use vbAdvanced so it would make sense to have the same search side-wide

StrifeX
08-10-2007, 12:29 AM
Suggestion: Make it say "No results found" when there is no search text or if nothing is found.

Corrections: This messes up my Shoutbox (by Inferno technologies), and my style chooser (anyone else having this problem?)

Edit: Pretty much anything on my site that uses AJAX doesn't work :( Any ideas?

rainyleaves
08-10-2007, 01:14 AM
this is not an error
the Mod is supposed to work only on forum's pages
not tested on VBAdvanced or any other Mod

thanx :)

You need Edit code if you wanna to use with CMPS.
* /forums/ or /forum/ , It's mean forum root name.
You just change /forums/ to your site's forum root name.

===========================================

1. ajax_search.php-------------
echo "<a href=\"showthread.php?t=".$result['threadid']."\">" . $result['title'] . "</a><br />";

--->

echo "<a href=\"/forums/showthread.php?t=".$result['threadid']."\">" . $result['title'] . "</a><br />";


2. "headinclude" template--------------

var url="ajax_search.php"
url=url+"?query="+word
xmlHttp3.onreadystatechange=stateChanged3
xmlHttp3.open("GET",url,true)
xmlHttp3.send(null)

---->

var url="/forums/ajax_search.php"
url=url+"?query="+word
xmlHttp3.onreadystatechange=stateChanged3
xmlHttp3.open("GET",url,true)
xmlHttp3.send(null)


3. "header" template-----------------

<form action="search.php?do=process" method="post">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="quicksearch" value="1" />

--->

<form action="/forums/search.php?do=process" method="post">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="quicksearch" value="1" />

Good luck :)

rjmjr69
08-10-2007, 03:34 AM
Whats the benefits of using this over any other search? One query for each key stroke seems excessive no?

Brew
08-10-2007, 03:56 AM
Whats the benefits of using this over any other search? One query for each key stroke seems excessive no?

I don't think it's excessive.

How many queries does your site currently have to load up the search screens? All together I would bet that there would be less with this system.

I think most people would find a thread they like in the first five to ten characters. That would probably be about even without having this but this is much easier.

One thing he could add to this would be a limit on key strokes option in the admin area. That would keep someone from causing too many queries.

FReeSTER
08-10-2007, 04:26 AM
of course it is workingCan you help me out getting this right.... I love this Mod eventhough is not working property in my site... What you think is the problem for the data base error Im getting?


Any help will be much appreciate it..

TY

Gunshot
08-10-2007, 04:31 AM
hmmmm

I have a major problem with this hack as it stands

When I login as a registered member and do a search it shows thread titles for private forums. This could be somewhat embarrassing

It won't allow you to view the thread, but some titles are enough to get you in trouble..
..if you know what I mean

StrifeX
08-10-2007, 05:00 AM
Can you help me out getting this right.... I love this Mod eventhough is not working property in my site... What you think is the problem for the data base error Im getting?


Any help will be much appreciate it..

TY
https://vborg.vbsupport.ru/showpost.php?p=1313479&postcount=41

Magnumutz
08-10-2007, 05:23 AM
Too bad it only searches Thread titles...

rjmjr69
08-10-2007, 06:53 AM
I don't think it's excessive.

How many queries does your site currently have to load up the search screens? All together I would bet that there would be less with this system.

I think most people would find a thread they like in the first five to ten characters. That would probably be about even without having this but this is much easier.

One thing he could add to this would be a limit on key strokes option in the admin area. That would keep someone from causing too many queries.


Ah I see what your saying now. Well with the description of the hack you have up does it no justice. So basically as soon as you type a character it starts searching from the character Pretty neat. I'll wait for the bugs to be worked out.

rainyleaves
08-10-2007, 01:51 PM
Can I excluding specify forum for search result?

coderphp
08-10-2007, 03:11 PM
Whats the benefits of using this over any other search? One query for each key stroke seems excessive no?
ordinary search needs 10+ queries to be done
this needs only 1 query..
so i think it is not excessive at all

Can you help me out getting this right.... I love this Mod eventhough is not working property in my site... What you think is the problem for the data base error Im getting?


Any help will be much appreciate it..

TY
Please re-download and re-install the Mod

hmmmm

I have a major problem with this hack as it stands

When I login as a registered member and do a search it shows thread titles for private forums. This could be somewhat embarrassing

It won't allow you to view the thread, but some titles are enough to get you in trouble..
..if you know what I mean
No it is not showing thread titles unless user can see it
the Mod is using the same user validation functions as the original search module do

Too bad it only searches Thread titles...
again searching posts will cause too much load on the mysql server
and i dont like to do so

Can I excluding specify forum for search result?
of course u can
edit the file ajax_search.php
find

(0 $excludelist)

replace with


(0, $forumnum1, $forumnum2 $excludelist)


Regards for all :)

Quantnet
08-10-2007, 03:16 PM
why you put progress.gif under/images/

You should have put it under some folder like /misc/ and updated the code accordingly.

rainyleaves
08-10-2007, 03:27 PM
of course u can
edit the file ajax_search.php
find

(0 $excludelist)

replace with


(0, $forumnum1, $forumnum2 $excludelist)


Regards for all :)
Great!!!

I edited like this.
(0, 34, 57 $excludelist)

Works charm~ :)
Thanks!!

grazianno
08-10-2007, 05:01 PM
nice nice mod thx man ;)

coderphp
08-10-2007, 06:19 PM
nice nice mod thx man ;)

anytime

StrifeX
08-10-2007, 07:27 PM
So, do you plan on fixing the problems it causes with Javascript or not? This has messed up every piece of Javascript on my site.

I'm really looking forward to setting this up properly, so for now I guess I'll just have to uninstall.

staff80
08-10-2007, 08:48 PM
not suitable for large forums i think

coderphp
08-10-2007, 09:01 PM
So, do you plan on fixing the problems it causes with Javascript or not? This has messed up every piece of Javascript on my site.

I'm really looking forward to setting this up properly, so for now I guess I'll just have to uninstall.
what javascript problems?
please write them here to be fixed

not suitable for large forums i think
didnt test on large forums till now

Gunshot
08-10-2007, 09:12 PM
No it is not showing thread titles unless user can see it
the Mod is using the same user validation functions as the original search module do


you are mistaken..it shows thread titles from private forums to anyone that does a search.....
....it will not allow you to view the thread....but you can see the title

try it yourself

coderphp
08-10-2007, 09:42 PM
you are mistaken..it shows thread titles from private forums to anyone that does a search.....
....it will not allow you to view the thread....but you can see the title

try it yourself

of course i tried it too many times and im sure of what i m saying :)
anyway u have the choice to use or not to use it

gg4gg
08-10-2007, 10:18 PM
Great Hack
Installed
على الرغم من انني لم اركب الهاك لأنني و لكن لكونه رائع ولكون مبرمجه عربي فقد دعمته
لك تحياتي

Quantnet
08-10-2007, 10:34 PM
I can confirm that guests can't not search for private threads. I just test it.

Quantnet
08-10-2007, 10:36 PM
This is one of the best mods so far. i have installed close to 30 mods on my site and none of my members say anything. When i installed this mod, my members love it and post to say thank you.

I hope the author improve or add new features to this mod ;)

TheMilkCarton
08-10-2007, 10:39 PM
@CoderPHP: Any reason this doesn't add "highlight" to the links you click in the results box??

For instance, searching for "please" at your site would result in a link that goes to http://www.montadaphp.net/showthread.php?t=828&highlight=please

Since this doesn't search individual posts, highlighting please would at least help the users find what they were looking for more easily.

Well... just a suggestion, I'll most likely get around to installing this mod sometime, if only for Admins, Mods, and VIPs. :)

*installed* (so I remember to get around to it) :)

ymy
08-10-2007, 10:48 PM
After install my VB not working

also I can`t log in to admin cp

what can i do ?

StrifeX
08-10-2007, 10:48 PM
After install my VB not working

also I can`t log in to admin cp

what can i do ?

1) Try to get in by going to yoursite.com/forums/admincp/index.php

If that doesn't work (I don't know if this will do anything...):

2) Edit config.php, and at the top add "define('DISABLE_HOOKS', 1);" (without quotes), and then delete the additions you made for the hack. Don't forget to get rid of that code in config.php when you're done. I'm pretty sure this has nothing to do with plugins/products but you might as well give it a try :p.

3) Also, it may be a different hack that you recently installed... Try step 2 and disable the latest few hacks you installed.

what javascript problems?
please write them here to be fixed


didnt test on large forums till now
Many things such as my Shoutbox and Style Chooser don't work, along with some other hacks that use AJAX and/or javascript.

TheBlackPoet
08-10-2007, 10:54 PM
After install my VB not working

also I can`t log in to admin cp

what can i do ?


wow!!! i dont think it was the ORIGINAL simplified version that caused this.. but the many other (really good enhancements).... that dont answer your question, but... i think going back to the basics would help...

it IS possible to over do a good thing


either install your tools.php to your admincp directory... (located in your DO NOT UPLOAD FOLDER..... )... and go to it through your browser... and go through the back way....... or .... (i think that will work)...

StrifeX
08-10-2007, 10:57 PM
wow!!! i dont think it was the ORIGINAL simplified version that caused this.. but the many other (really good enhancements).... that dont answer your question, but... i think going back to the basics would help...

it IS possible to over do a good thing


either install your tools.php to your admincp directory... (located in your DO NOT UPLOAD FOLDER..... )... and go to it through your browser... and go through the back way....... or .... (i think that will work)...
Umm, what?

coderphp
08-10-2007, 11:00 PM
Great Hack
Installed
على الرغم من انني لم اركب الهاك لأنني و لكن لكونه رائع ولكون مبرمجه عربي فقد دعمته
لك تحياتي
many thanx
أشكرك بقوة على دعمك وذوقك الرفيع
وان شاء الله نردهالك في الأفراح
تحياتي
محمود

coderphp
08-10-2007, 11:01 PM
I can confirm that guests can't not search for private threads. I just test it.
thank u for u confirmation :)
regards

coderphp
08-10-2007, 11:10 PM
This is one of the best mods so far. i have installed close to 30 mods on my site and none of my members say anything. When i installed this mod, my members love it and post to say thank you.

I hope the author improve or add new features to this mod ;)
thanx Quantnet.org
and i hope u put here what u wish to c in the future version ;)

@CoderPHP: Any reason this doesn't add "highlight" to the links you click in the results box??
this is not highlighting the post becoz we are only searching titles not posts
thanx for ur feedback
and indeed im thinking of adding an option to just let certain usergroups use this Mod

After install my VB not working

also I can`t log in to admin cp

what can i do ?
I dont think this have any issue with ur admincp
maybe u installed any other hack that affects ur forum
try to do like StrifeX saied



Many things such as my Shoutbox and Style Chooser don't work, along with some other hacks that use AJAX and/or javascript.
ok as that is not a problem with the original VB code, I ask u to tell me what hacks are installed in ur forum affected by this hack, please tell me exact versions with urls to be able to solve this

Milad
08-10-2007, 11:39 PM
This is very good.

does it search in threads titles only? does it search in posts content?

Regards

coderphp
08-10-2007, 11:43 PM
This is very good.

does it search in threads titles only? does it search in posts content?

Regards

only search in thread titles

Milad
08-10-2007, 11:43 PM
There are two things:
1- I prefer you use the default AJAX class of vBulletin.
2- It's better to move the java code in the first step to a file in clientscript folder, and include it by joining this
<script type="text/javascript" src="clientscript/vbulletin_livesearch.js?v=368"></script>

to the template "headerincludes".

Regards

ymy
08-10-2007, 11:50 PM
StrifeX
Thanks a lot for your help
I follow your instruction and everything back to normal
Thanks again


TheBlackPoet , coderphp
I will try to find what's problem
I have another JavaScript in the headinclude. Do think there is any conflict with Live Search hack

=========

<script language="JavaScript1.2">
var rector=3
var stopit=0
var a=1
function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}
function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}
function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}
</script>


=========


<script language="JavaScript1.2">
function flashit(){
if (!document.all)
return
if (myexample.style.borderColor=="blue")
myexample.style.borderColor="red"
else
myexample.style.borderColor="blue"
}
setInterval("flashit()", 200)
</script>

=========


Thanks

coderphp
08-10-2007, 11:55 PM
There are two things:
1- I prefer you use the default AJAX class of vBulletin.
2- It's better to move the java code in the first step to a file in clientscript folder, and include it by joining this
<script type="text/javascript" src="clientscript/vbulletin_livesearch.js?v=368"></script> to the template "headerincludes".

Regards
I have no much experience with VB's AJAX class
anyway ill think about using it in the future
thanx again Milad :)

StrifeX
Thanks a lot for your help
I follow your instruction and everything back to normal
Thanks again


TheBlackPoet , coderphp
I will try to find what's problem
I have another JavaScript in the headinclude. Do think there is any conflict with Live Search hack

=========

<script language="JavaScript1.2">
var rector=3
var stopit=0
var a=1
function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}
function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}
function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}
</script>


=========


<script language="JavaScript1.2">
function flashit(){
if (!document.all)
return
if (myexample.style.borderColor=="blue")
myexample.style.borderColor="red"
else
myexample.style.borderColor="blue"
}
setInterval("flashit()", 200)
</script>

=========


Thanks
Glad to hear ur forum is back
i dont think ur code has any interfere with Mod's code

StrifeX
08-11-2007, 04:28 AM
ok as that is not a problem with the original VB code, I ask u to tell me what hacks are installed in ur forum affected by this hack, please tell me exact versions with urls to be able to solve thisI'm quite sure it's not the fault of any hack, I've tried disabling nearly everything.

coderphp
08-11-2007, 04:34 AM
I'm quite sure it's not the fault of any hack, I've tried disabling nearly everything.

Thanx StrifeX for ur reply
i wish i could help but really i see no probems in javascript when using this Mod on the original forum without any other Mod

ok could u please put ur JAVASCRIPT errors here??

StrifeX
08-11-2007, 04:35 AM
There are two things:
1- I prefer you use the default AJAX class of vBulletin.
2- It's better to move the java code in the first step to a file in clientscript folder, and include it by joining this
<script type="text/javascript" src="clientscript/vbulletin_livesearch.js?v=368"></script>

to the template "headerincludes".

Regards
I did that myself, but what is the "v=368" at the end for?

Also, one of the things that doesn't work is the "[ITech] [AJAX] Inferno vBShout Lite 1.0.1", which can be found here: https://vborg.vbsupport.ru/showthread.php?t=147346&highlight=%5Bitech%5D+inferno - When I refresh the page it just says "Loading...".

Quantnet
08-11-2007, 06:53 AM
When search, the oldest threads appear on top. How can I make the latest thread appear on top ?

StrifeX
08-11-2007, 09:16 PM
Nvrm, I just fixed the problem :)

coderphp
08-11-2007, 11:17 PM
When search, the oldest threads appear on top. How can I make the latest thread appear on top ?
edit ajax_search.php file
search for:

$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist)");

replace with:

$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist) ORDER BY `lastpost` DESC");


Nvrm, I just fixed the problem :)
good to head that

Quantnet
08-11-2007, 11:40 PM
thanks,

Now I'm thinking of enhancements that I like to see in next release ;)

coderphp
08-12-2007, 01:45 AM
thanks,

Now I'm thinking of enhancements that I like to see in next release ;)
gr8
let me know when u finish :D

Quantnet
08-12-2007, 01:50 AM
There seems to be a problem with +,++ or +++ (maybe more but this is what i just noticed)

When search for C++, it shows all thread that has C in it (which is so many). It shows the same results for C+, C++, C+++, C++++, etc

Something with how you parse the + sign

Quantnet
08-12-2007, 02:16 AM
ideas for future enhancements:

Options to apply this mod to Search this thread (search for post) and Search this forum (search for thread title as before)

coderphp
08-12-2007, 02:40 AM
There seems to be a problem with +,++ or +++ (maybe more but this is what i just noticed)

When search for C++, it shows all thread that has C in it (which is so many). It shows the same results for C+, C++, C+++, C++++, etc

Something with how you parse the + sign
Indeed it is a bug
the + sign is not appearing in the php script
i think the problem is concerned to using GET method for sending variables
ill check that & tell u soon

ideas for future enhancements:

Options to apply this mod to Search this thread (search for post) and Search this forum (search for thread title as before)

thanx for the improvments
of course ill add them in the future version :)

Quantnet
08-12-2007, 03:35 AM
I just check for different browser platform and here is where everything is different. I tested with IE7, Opera and FF.

For IE7 (The Live Search word is on top of the search box instead of on the left of it and the popup stay on the right)
https://vborg.vbsupport.ru/

For Opera (looks fine but the search result is right aligned
https://vborg.vbsupport.ru/

For FF (this looks perfect)
https://vborg.vbsupport.ru/


I include here the search code which I insert into navbar template (I have a highly customized style). I would really appreciate if you can see what's wrong

<!-- search -->
<if condition="$show['searchbuttons']">
<td align="right" nowrap="nowrap" valign="top">
<if condition="$show['member']">
<form action="/forum/search.php?do=process" method="post">
<else />
<form action="search.php$session[sessionurl_q]" method="post">
</if>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px" title="nohilite">

<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]" />


Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


</td>
<td nowrap="nowrap" id="navbar_search" class="smallfont">&nbsp;<a href="search.php$session[sessionurl_q]">Options</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
</tr>

</table>
</form>
<!-- / search -->

Magnumutz
08-12-2007, 05:43 AM
My style is also HEAVILY modified and i had a lot of trouble making it work. But this depends on th Browser... IMO FF is the best browser...

coderphp
08-12-2007, 08:17 PM
I just check for different browser platform and here is where everything is different. I tested with IE7, Opera and FF.

For IE7 (The Live Search word is on top of the search box instead of on the left of it and the popup stay on the right)
https://vborg.vbsupport.ru/

For Opera (looks fine but the search result is right aligned
https://vborg.vbsupport.ru/

For FF (this looks perfect)
https://vborg.vbsupport.ru/


I include here the search code which I insert into navbar template (I have a highly customized style). I would really appreciate if you can see what's wrong

<!-- search -->
<if condition="$show['searchbuttons']">
<td align="right" nowrap="nowrap" valign="top">
<if condition="$show['member']">
<form action="/forum/search.php?do=process" method="post">
<else />
<form action="search.php$session[sessionurl_q]" method="post">
</if>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px" title="nohilite">

<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]" />


Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


</td>
<td nowrap="nowrap" id="navbar_search" class="smallfont">&nbsp;<a href="search.php$session[sessionurl_q]">Options</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
</tr>

</table>
</form>
<!-- / search -->

id dont know what is the problem
ill check the code and let u know

thanx

rainyleaves
08-13-2007, 05:17 AM
I just check for different browser platform and here is where everything is different. I tested with IE7, Opera and FF.

For IE7 (The Live Search word is on top of the search box instead of on the left of it and the popup stay on the right)
https://vborg.vbsupport.ru/

For Opera (looks fine but the search result is right aligned
https://vborg.vbsupport.ru/

For FF (this looks perfect)
https://vborg.vbsupport.ru/


I include here the search code which I insert into navbar template (I have a highly customized style). I would really appreciate if you can see what's wrong

<!-- search -->
<if condition="$show['searchbuttons']">
<td align="right" nowrap="nowrap" valign="top">
<if condition="$show['member']">
<form action="/forum/search.php?do=process" method="post">
<else />
<form action="search.php$session[sessionurl_q]" method="post">
</if>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px" title="nohilite">

<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]" />


Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


</td>
<td nowrap="nowrap" id="navbar_search" class="smallfont">&nbsp;<a href="search.php$session[sessionurl_q]">Options</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
</tr>

</table>
</form>
<!-- / search -->


This can help you... :)

Just add <br /> abobe of the 'header' code.


<br />
<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]" />
Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form><br />
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>

Quantnet
08-13-2007, 05:47 AM
Thanks for helping but it does not make any difference

rainyleaves
08-13-2007, 05:56 AM
Thanks for helping but it does not make any difference

Oops!!
Sorry my mistaken.

This code...
Red <br />.
<br />
<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]" />
Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form><br />
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>

Quantnet
08-13-2007, 07:30 AM
Again, I appreciate your help a great deal.

i added as suggested, edited other part of the template to no avail.

ArabSQuad
08-13-2007, 10:16 AM
Awesome
Thanks alot bro :)

coderphp
08-15-2007, 05:18 PM
I just check for different browser platform and here is where everything is different. I tested with IE7, Opera and FF.

For IE7 (The Live Search word is on top of the search box instead of on the left of it and the popup stay on the right)
http://img227.imageshack.us/img227/5132/ie7eg7.gif

For Opera (looks fine but the search result is right aligned
http://img227.imageshack.us/img227/849/operazt0.gif

For FF (this looks perfect)
http://img227.imageshack.us/img227/4404/firefoxzq3.gif


I include here the search code which I insert into navbar template (I have a highly customized style). I would really appreciate if you can see what's wrong

<!-- search -->
<if condition="$show['searchbuttons']">
<td align="right" nowrap="nowrap" valign="top">
<if condition="$show['member']">
<form action="/forum/search.php?do=process" method="post">
<else />
<form action="search.php$session[sessionurl_q]" method="post">
</if>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px" title="nohilite">

<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]" />


Live search <input type="text" name="query" size="25" class="header_search_field" onkeyup="showHint(this.value)" />
</form>
<div id="search_results" class="smallfont" style="position:absolute; border: 2px solid orange; color:blue; background-color: white; width: 300px; padding: 8px; display:none;overflow:auto; height:200px">
<div align="left"><a href="#" onClick="overlayclose('search_results'); return false">x</a></div>
</div>


</td>
<td nowrap="nowrap" id="navbar_search" class="smallfont">&nbsp;<a href="search.php$session[sessionurl_q]">Options</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
</tr>

</table>
</form>
<!-- / search -->

i checked the code twice.. i didnt find anything wrong with it.. sorry i wish i could help further :(

coderphp
08-15-2007, 05:19 PM
Awesome
Thanks alot bro :)

thanx ArabSQuad :)

hoangminh
08-16-2007, 01:24 AM
If your database uses prefix, then this script will cause DB Error

To fix, at line 23
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist)");


Change to:
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `". TABLE_PREFIX ."thread`.`forumid` NOT IN (0 $excludelist)");

StrifeX
08-16-2007, 06:01 AM
I've done some custom work to the modification, and it's really looking awesome.

Great job buddy, I'm glad you came around with something like this. :)

coderphp
08-23-2007, 04:52 AM
If your database uses prefix, then this script will cause DB Error

To fix, at line 23


Change to:
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `". TABLE_PREFIX ."thread`.`forumid` NOT IN (0 $excludelist)");


I've done some custom work to the modification, and it's really looking awesome.

Great job buddy, I'm glad you came around with something like this. :)

THANX

SBlueman
09-02-2007, 01:40 PM
I love this mod! Thank you!

69lakalle
09-07-2007, 12:57 PM
i tried to install but wont work ......i click install so ....for the next release . i have and email for the update

nesta2006
10-28-2007, 05:25 AM
hello .
my problem lock page!!
please see : http://i21.tinypic.com/30t45xh.jpg
3 windows open inside! and lock scrol

please help me

coderphp
10-28-2007, 12:02 PM
hello .
my problem lock page!!
please see : http://i21.tinypic.com/30t45xh.jpg
3 windows open inside! and lock scrol

please help me
I think you did something wrong..
please re-install the mod

coderphp
10-28-2007, 12:03 PM
I love this mod! Thank you!
many thanx

i tried to install but wont work ......i click install so ....for the next release . i have and email for the update
Please tell me what is the error u had when installed??

l2-inferno
01-27-2008, 01:39 AM
This hack work with vBSEO 3.x ?

vietfancy
03-18-2008, 11:12 AM
this hack has nothing to do with vbseo so it should be working just fine.

Thanks to coderphp for this great mod. Will install on my forum when I get back.

voted for MOTM

Suggestion: It would be nice if It could give out message like: we can't find topic contains "asdf;lkjg" if we type in something like this "asdf;lkjg"

Thanks

Quantnet
03-26-2008, 03:00 AM
suddenly the script is not working anymore. you can try it on my signature.
Vietfancy, you have PM.

Gosef
03-26-2008, 03:38 PM
Goog work mahmoud

Quantnet
04-03-2008, 09:39 AM
2 questions.

1) how do we make the live search to work site wide instead of only under /forum/.
If i have a search box in www.site.com. www.site.com/wiki/

where do we use the absolute path ?

Right now, if i search under www.site.com, it will show this error
http://www.site.com/ xx.xxx.xx.xxx /ajax_search.php?query=and www.site.com Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13 404 Please contact admin@site.com if you can not find the content you are looking for.

3) The live search stops working after I added a new plug in. Found out it was a new plug in for openX i added.
If i disable it, it works fine.

Here is the instruction for the plug in

Product: vbulletin
hook location: global_start
title: OpenX Banners
Exec order: 4

// The MAX_PATH below should point to the base of your OpenX installation
define('MAX_PATH', '/home/quantnet/public_html/openx');
if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
if (!isset($phpAds_context)) {
$phpAds_context = array();
}
$phpAds_raw = view_local('', 4, 0, 0, '', '', '0', $phpAds_context);

}

Any idea why it conflicts with the quick search mod and how to fix it ?

mad@Max
08-30-2008, 12:05 AM
2 quotions:
How did when a search results = 0 window not opens? Or show message like "No results"?
How separate resultbit from X button (without del them)?

NAZIA
09-13-2008, 07:32 PM
thanks for sharing I will check it..

mad@Max
09-13-2008, 08:06 PM
Reincarnation this hack: https://vborg.vbsupport.ru/showthread.php?t=189970 :)

doa24uk
05-03-2009, 10:58 AM
How would I edit this to search in a different database field than the default? I'm trying to create a new field & I want this working there.....

Ghostt
11-20-2009, 08:42 PM
/edit
ok ive fixed it , was an prefix problem!
________________________
isnt it working with 3.8.4 ? i get an DB error


Database error in vBulletin 3.8.4:

Invalid SQL:
SELECT * FROM vbthread WHERE `title` LIKE '%pippi%' AND `thread`.`forumid` NOT IN (0 ,720,546);

MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Request Date : Saturday, November 21st 2009 @ 01:29:52 AM
Error Date : Saturday, November 21st 2009 @ 01:29:52 AM
Script : http://*ajax_search.php?query=pippi
Referrer : http://*/
IP Address : *
Username : *
Classname : vB_Database
MySQL Version : 5.0.77-log

Diablo-Sat
01-14-2011, 07:35 PM
thanks for this m8