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 |
#132
|
||||
|
||||
many thanx
Please tell me what is the error u had when installed?? |
#133
|
|||
|
|||
This hack work with vBSEO 3.x ?
|
#134
|
||||
|
||||
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 |
#135
|
|||
|
|||
suddenly the script is not working anymore. you can try it on my signature.
Vietfancy, you have PM. |
#136
|
|||
|
|||
Goog work mahmoud
|
#137
|
|||
|
|||
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 Code:
// 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); } |
#138
|
||||
|
||||
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)? |
#139
|
||||
|
||||
thanks for sharing I will check it..
|
#140
|
||||
|
||||
Reincarnation this hack: https://vborg.vbsupport.ru/showthread.php?t=189970
|
#141
|
|||
|
|||
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.....
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|