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 |
#62
|
||||
|
||||
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! |
#63
|
||||
|
||||
Quote:
so i dont think it will be good to do that using Live Search Quote:
the alignment is adjusted automatically according to ur forums alignment Quote:
the Mod is supposed to work only on forum's pages not tested on VBAdvanced or any other Mod thanx |
#64
|
||||
|
||||
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"> |
#65
|
||||
|
||||
Quote:
I put ur version to my forum i also added: Code:
-moz-opacity:.85;opacity:.85; |
#66
|
||||
|
||||
Quote:
Didn't think I needed this, but now I do... Great work *********** coderphp TheBlackPoet |
#67
|
|||
|
|||
Quote:
Do you think it will be a next feature Lot of people use vbAdvanced so it would make sense to have the same search side-wide |
#68
|
|||
|
|||
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? |
#69
|
||||
|
||||
Quote:
* /forums/ or /forum/ , It's mean forum root name. You just change /forums/ to your site's forum root name. =========================================== 1. ajax_search.php------------- Quote:
2. "headinclude" template-------------- Quote:
3. "header" template----------------- Quote:
|
#70
|
||||
|
||||
Whats the benefits of using this over any other search? One query for each key stroke seems excessive no?
|
#71
|
||||
|
||||
Quote:
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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|