Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Live Search 1.0 (AJAX) Details »»
Live Search 1.0 (AJAX)
Version: 1.00, by coderphp coderphp is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.6.8 Rating:
Released: 08-07-2007 Last Update: 08-08-2007 Installs: 93
Template Edits
Additional Files  
No support by the author.

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>
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:
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>
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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #112  
Old 08-12-2007, 01:50 AM
Quantnet Quantnet is offline
 
Join Date: Nov 2006
Location: NYC
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #113  
Old 08-12-2007, 02:16 AM
Quantnet Quantnet is offline
 
Join Date: Nov 2006
Location: NYC
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #114  
Old 08-12-2007, 02:40 AM
coderphp's Avatar
coderphp coderphp is offline
 
Join Date: Nov 2006
Location: Egypt
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Quantnet.org View Post
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

Quote:
Originally Posted by Quantnet.org View Post
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
Reply With Quote
  #115  
Old 08-12-2007, 03:35 AM
Quantnet Quantnet is offline
 
Join Date: Nov 2006
Location: NYC
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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">&nbsp;<a href="search.php$session[sessionurl_q]">Options</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
			</tr>
			
			</table>
			</form>
	<!-- / search -->
Reply With Quote
  #116  
Old 08-12-2007, 05:43 AM
Magnumutz's Avatar
Magnumutz Magnumutz is offline
 
Join Date: Feb 2006
Location: Romania
Posts: 731
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #117  
Old 08-12-2007, 08:17 PM
coderphp's Avatar
coderphp coderphp is offline
 
Join Date: Nov 2006
Location: Egypt
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Quantnet.org View Post
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">&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
Reply With Quote
  #118  
Old 08-13-2007, 05:17 AM
rainyleaves rainyleaves is offline
 
Join Date: Mar 2004
Posts: 227
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Quantnet.org View Post
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">&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.

Quote:
<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>
Reply With Quote
  #119  
Old 08-13-2007, 05:47 AM
Quantnet Quantnet is offline
 
Join Date: Nov 2006
Location: NYC
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for helping but it does not make any difference
Reply With Quote
  #120  
Old 08-13-2007, 05:56 AM
rainyleaves rainyleaves is offline
 
Join Date: Mar 2004
Posts: 227
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Quantnet.org View Post
Thanks for helping but it does not make any difference
Oops!!
Sorry my mistaken.

This code...
Red <br />.
Quote:
<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>
Reply With Quote
  #121  
Old 08-13-2007, 07:30 AM
Quantnet Quantnet is offline
 
Join Date: Nov 2006
Location: NYC
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Again, I appreciate your help a great deal.

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04704 seconds
  • Memory Usage 2,345KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete