The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Live Search 1.0 (AJAX) Details »» | |||||||||||||||||||||||||
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: Code:
<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').innerHTML = '<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> Code:
<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> and u r done If u like the hack please dont forget to click INSTALL Show Your Support
|
Comments |
#112
|
|||
|
|||
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 |
#113
|
|||
|
|||
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) |
#114
|
||||
|
||||
Quote:
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 Quote:
of course ill add them in the future version |
#115
|
|||
|
|||
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) For Opera (looks fine but the search result is right aligned For FF (this looks perfect) 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 Code:
<!-- 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"> <a href="search.php$session[sessionurl_q]">Options</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td> </tr> </table> </form> <!-- / search --> |
#116
|
||||
|
||||
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...
|
#117
|
||||
|
||||
Quote:
ill check the code and let u know thanx |
#118
|
|||
|
|||
Quote:
This can help you... Just add <br /> abobe of the 'header' code. Quote:
|
#119
|
|||
|
|||
Thanks for helping but it does not make any difference
|
#120
|
|||
|
|||
Oops!!
Sorry my mistaken. This code... Red <br />. Quote:
|
#121
|
|||
|
|||
Again, I appreciate your help a great deal.
i added as suggested, edited other part of the template to no avail. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|