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 |
#102
|
|||
|
|||
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 |
#103
|
||||
|
||||
Quote:
anyway ill think about using it in the future thanx again Milad Quote:
i dont think ur code has any interfere with Mod's code |
#104
|
|||
|
|||
I'm quite sure it's not the fault of any hack, I've tried disabling nearly everything.
|
#105
|
||||
|
||||
Quote:
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?? |
#106
|
|||
|
|||
Quote:
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/showthrea...ech%5D+inferno - When I refresh the page it just says "Loading...". |
#107
|
|||
|
|||
When search, the oldest threads appear on top. How can I make the latest thread appear on top ?
|
#108
|
|||
|
|||
Nvrm, I just fixed the problem
|
#109
|
||||
|
||||
Quote:
search for: Code:
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist)"); Code:
$results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `thread`.`forumid` NOT IN (0 $excludelist) ORDER BY `lastpost` DESC"); |
#110
|
|||
|
|||
thanks,
Now I'm thinking of enhancements that I like to see in next release |
#111
|
||||
|
||||
Quote:
let me know when u finish |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|