vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - [YUI] Live Search (https://vborg.vbsupport.ru/showthread.php?t=204517)

mad@Max 02-06-2009 10:00 PM

[YUI] Live Search
 
1 Attachment(s)
Features:
  • search only, if typed >= 3 symbols;
  • header to window with button close;
  • message about no result;
  • limit number of threads;
  • highlight words in result
  • trim title of thread, if it large (optional)
  • edit position of pop-up window
  • work with vBadvanced
  • limit the number of displayed results
  • group permission
  • search by your own forums
  • sort results of search
  • mod makes only one query to db
  • full compatibility with styles and browsers
  • search by individual words
  • integrate option into standard search
  • search only the specified length of each word
  • users search
  • interval requests
  • wrote 2 js class
Rewritten many things since version 1.6

Known Issues
Double click in search field - still not fixed.

Installation:
Upload all files from folder upload to forum folder.
Import product.

Upgrade
Uninstall the old version, delete files (if you has use it) and install new version.

If you already have opened search field, do following.
Search field look like this:

HTML 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]" />
                    <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                    <input type="text" class="bginput" name="query" size="25" tabindex="1001" />
                    <input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" />

                </form>

So, after the opening tag <form ХХХ> add bottom:

HTML Code:

                    <div id="lsa_window">
Before the closing tag </form> add:

HTML Code:

                    </div>
We have prepared the search form to pop-up window. Now we need to bind to the field of javascript.
For this in tag <input type="text" /> add id="lsa_input"
As a result, you should get some of this code:

HTML Code:

                                <form action="search.php?do=process" method="post">
                                        <div id="lsa_window">
                                        <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]" />
                                        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                                        <input type="text" id="lsa_input" class="bginput" name="query" size="25" tabindex="1001" />
                                        <input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" />
                                        </div>
                                </form>

P.S. If you already have id in your search field and its change may be possible to reset the anchor CSS, do the following.
Open the template lsa_script and edit the line

var lsa = new AJAX_LiveSearch_Prepare("lsa", "lsa_input", "lsa_window");

where the arguments of the class:
lsa - variable name initialize class js
lsa_input - search field id
lsa_window - pop-up window id

Thus, changing the arguments of the class AJAX_LiveSearch_Prepare, you can not edit the search field.

Live DEMO: http://mixplay.ru/ (user: test, pass: 123456)
Live video: http://www.youtube.com/watch?v=t_16fk5VGYw

PS Some function writed by ChangUonDyU

If you like this mod - Click Install it:)

Daniel_HBK 02-07-2009 01:47 AM

Great Hack ,

thanks

NAZIA 02-07-2009 02:34 AM

thanks good work.. I will do it soon.. ASAP

vietfancy 02-07-2009 02:40 AM

can you do the same as: http://www.thienduongnhac.com/forum/index.php where the results appear below navbar instead of a popup?

lazydesis 02-07-2009 03:07 AM

awesome hack .. does this add any queries or slow down the server in any way ..

ajax :eek:

smirkley 02-07-2009 03:34 AM

Let me know when this works with the standard search in navbar, I would love that.

At the moment, I get some kinda browser error when I try to install it into navbar vb search.

It does work well though if I have a standalone live search below navbar.

Hornstar 02-07-2009 04:14 AM

hopefully vb4 will take something like this on and improve upon it.

rn-nr.com 02-07-2009 04:47 AM

thanks ,
very nice ,

groupak 02-07-2009 05:25 AM

thanks :)

mad@Max 02-07-2009 09:38 AM

vietfancy, this is not hard, but i think that disappearing window is better:)
lazyindian, i have installed this hack on 2 and more forums and no one went to work slowly and do not get down. In any case, you can disable it work for certain groups in settings
smirkley, i will try but not promise:)
hornstar1337, i too:)

relaxiha 02-07-2009 03:07 PM

hello
i think have problem with UTF-8 (arabic & persian)
because after type word in box show no result

mad@Max 02-07-2009 03:33 PM

Try comment string in plugin Live Search AJAX
PHP Code:

//    $query = iconv('UTF-8', $stylevar['charset'], $query); 


relaxiha 02-07-2009 04:04 PM

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$query = iconv('UTF-8', $stylevar['charset'], $query)' at line 1

relaxiha 02-07-2009 04:06 PM

hello i run query :
Quote:

// $query = iconv('UTF-8', $stylevar['charset'], $query);
plz little more info for this query !

ptwiggens 02-07-2009 04:23 PM

Yeah,

This is cool, but having 2 search fields is lame. Is there not a way to just replace the regular search field in the navbar with this?

relaxiha 02-07-2009 04:57 PM

yes i think again update previous was better

DjEddie 02-07-2009 04:59 PM

Thanks for this mod.... it installs fine..

Just no results show up when a search is entered... keeps on with the loading but nothing appears... any ideas?

mad@Max 02-07-2009 06:56 PM

relaxiha, open plugin Live Search AJAX and then find this string and comment it:
Code:

// $query = iconv('UTF-8', $stylevar['charset'], $query);
Who have problem, please, write your charset.

relaxiha 02-07-2009 07:26 PM

hello
my charset is UTF-8 !!!
unknow change this!
plz say better information to me!
Code:

// $query = iconv('????', $stylevar['charset'], $query);
you say i change ??? to XXX ?
or no!

mad@Max 02-07-2009 07:52 PM

// mean that string makes comment.
I not saying change utf-8. What collocation your db?

AcidX 02-07-2009 08:36 PM

Why doesn't the mod actually look like the one in the demo?
Do we need to customize the look ourselves?

mad@Max 02-07-2009 08:58 PM

What look do you mean?

AcidX 02-07-2009 09:04 PM

Quote:

Originally Posted by mad@Max (Post 1737322)
What look do you mean?

The Live Search field... It should look like: https://vborg.vbsupport.ru/external/2009/02/78.png

But when I add "$lsaform", a very simple search form shows up... Shouldn't it come with some style, background image or something? :)

DjEddie 02-07-2009 09:31 PM

Quote:

Originally Posted by DjEddie (Post 1737164)
Thanks for this mod.... it installs fine..

Just no results show up when a search is entered... keeps on with the loading but nothing appears... any ideas?

Hi, u have any ideas on my problem above?

Thanks :)

mad@Max 02-07-2009 10:17 PM

AcidX, this is css:) Hm, mb in next version i add this.
DjEddie, so, what your charset and collocation?:)

relaxiha 02-08-2009 01:08 AM

i have problem again with LANg Persian and no result search//
i put
Code:

//  $query = iconv('UTF-8', $stylevar['charset'], $query);

mad@Max 02-09-2009 01:01 PM

Version 2.0.1
Fixed work with non english language:)

relaxiha 02-09-2009 11:29 PM

Hello
i have problem yet!
in CP live chat :
Code:

Search in your own forums
Separate each option with a new-line. Separate title and forumids with |. Separate forum ids with commas
example:
Oder1 title|1,2,5
Oder2 title|21,15,7
Oder3 title|14

Code:

���������1|1,2,5
���������2|21,15,7
���������3|14

true LANG

mad@Max 02-10-2009 12:05 AM

I just forgot translate this setting. Reuploaded.

rapidphim 02-13-2009 05:21 AM

Can someone please show/guide how to put the search field on the navbar with this http://mixplay.ru/images/as4/global/..._searchbox.png? Thanks.

Also, how can we make it searching with UTF language?

Also, how can we make it search throughout the entire board?

Also, will this hack search or work for blog?

mad@Max 02-13-2009 06:19 AM

About search field:
CSS:
Code:

#tb-searchdiv{float:right;padding:8px 5px 0 0;text-align:center;line-height:13px;cursor:default}#tb-searchdiv a{color:#000;font-size:11px;text-decoration:none;cursor:pointer}#tb-searchbox{padding:4px 11px 11px 22px;width:119px;background:url(images/as4/global/toolbar_searchbox.png) no-repeat;text-align:left;height:14px}#tb-searchbox input{border:0;padding:0;width:119px;background:#fff;color:#000;font:12px/12px 'Lucida Grande',Verdana,sans-serif;height:14px;outline:none;cursor:text}
HTML Code:

                                        <div id="tb-searchdiv"><div id="lsa_window">
                                                <div id="tb-searchbox"><input type="text" id="lsa_input" name="query" tabindex="1001" maxlength="$vboptions[lsa_maxsym]" value="$vbphrase[live_search]" onfocus="if(this.value=='$vbphrase[live_search]' || document.getElementById('lsa_window_menu').style.display == 'none'){this.value=''};<if condition="!in_array($bbuserinfo[usergroupid], array($vboptions[lsa_group]))"> showHint();</if>" onblur="if (this.value==''){this.value='$vbphrase[live_search]'}"<if condition="!in_array($bbuserinfo[usergroupid], array($vboptions[lsa_group]))"> onkeyup="showHint();</if>"/></div>
        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<if condition="!in_array($bbuserinfo[usergroupid], array($vboptions[lsa_group]))"><script type="text/javascript"> vbmenu_register("lsa_window",1); </script></if></div>
                                                <a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a>
                                                <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]" />
                                        </div>
                                        </form>

You have a problem with UTF language?
Search work throughout board.
What do you mean about blog?

mad@Max 02-13-2009 03:46 PM

Updated video work of mod. http://www.youtube.com/watch?v=4w6AankLJkY :)

rapidphim 02-13-2009 04:45 PM

Thanks Max for the guiding. However, I am trying to understand:
1/ where to put the HTML code? The CSS part, I assume, I need to put to the bottom of the CSS section.

2/ When I tried the Search from the Search drop down function, with few words that I recently posted, it did not come up.

3/ About blog, does this hack also work for searching in Blog? When I tried to do a blog search from Search drop down function, it's not working... or did I do something not right?

Theater 02-13-2009 07:57 PM

Quote:

Originally Posted by mad@Max (Post 1742995)
Updated video work of mod. http://www.youtube.com/watch?v=4w6AankLJkY :)

Might want to double-check that video URL... :p

mad@Max 02-13-2009 08:00 PM

lol !!!!!! Sorry))))))))))))))))))))))))))))))))
Here that video http://www.youtube.com/watch?v=t_16fk5VGYw

rapidphim 02-13-2009 08:32 PM

I watched video but have no clue on how to add the Search field on the navbar... any hints? Thanks and sorry for stupidity!

mad@Max 02-13-2009 08:59 PM

Do following. In template navbar find:
HTML Code:

        <td class="alt2" nowrap="nowrap">
        <div class="smallfont">
                <strong><phrase 1="$bbuserinfo[username]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />

add above
HTML Code:

        <td class="alt1" align="center" nowrap="nowrap">
                $lsaform
        </td>


rapidphim 02-13-2009 10:16 PM

that did the job. however, I am finding difficulty to make it show this toolbar_searchbox.png. I did change the image path, uploaded the image, add CSS and nothing work.

Did I miss the HTML part? If so, where to I place those HTML codes? Thanks so much!

mad@Max 02-13-2009 11:14 PM

In next version i myself add this as feature.

rapidphim 02-14-2009 01:07 AM

Thanks Max... so, right now, I just have to wait for your next version? Can you manual guide me to put it on?

Can you also make it search result for Blog too? or at least make it an option for admin to decide?


All times are GMT. The time now is 05:25 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.01749 seconds
  • Memory Usage 1,855KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (7)bbcode_html_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete