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

Reply
 
Thread Tools
[YUI] Live Search Details »»
[YUI] Live Search
Version: 3.0.2, by mad@Max mad@Max is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.8.x Rating:
Released: 02-06-2009 Last Update: 07-10-2009 Installs: 162
Uses Plugins Auto-Templates
Additional Files  
No support by the author.

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

Download Now

File Type: zip [AJAX] Live Search 2.2.3 Eng.zip (7.3 KB, 305 views)
File Type: zip [AJAX] Live Search 2.3.1 Eng.zip (7.6 KB, 366 views)
File Type: zip [YUI] Live Search v3.0.2 En.zip (9.6 KB, 896 views)

Screenshots

File Type: jpg lsa_set_eng.jpg (110.2 KB, 0 views)

Show Your Support

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

Comments
  #102  
Old 03-24-2009, 07:59 AM
star88 star88 is offline
 
Join Date: May 2008
Location: France
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Max for this update
unfortunatly, because non-english characters don't return any result I can't use this great mod on my site.
Reply With Quote
  #103  
Old 03-24-2009, 08:29 AM
rmxs rmxs is offline
 
Join Date: Apr 2006
Posts: 419
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes max must fix this error (old version was ok )
Reply With Quote
  #104  
Old 03-24-2009, 10:47 AM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With which the old version of hack it work?
Reply With Quote
  #105  
Old 03-24-2009, 11:04 AM
fukdawrld fukdawrld is offline
 
Join Date: Nov 2005
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mad@Max View Post
This is intended On my forums search work on all browsers.
You mean its intended to have to click outside the box to pull up results?
Reply With Quote
  #106  
Old 03-24-2009, 02:20 PM
rmxs rmxs is offline
 
Join Date: Apr 2006
Posts: 419
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works with version 1.3
with ajax_search.php

here is the content of this file

Code:
<?php
/*
Live Search v1.3
Writed by: coderphp (https://vborg.vbsupport.ru/member.php?u=174485)
Modify by: mad@Max (https://vborg.vbsupport.ru/member.php?u=209608)
*/
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'ajax_search');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('global');

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

function utf8_to_win($string){
for ($c=0;$c<strlen($string);$c++){
$i=ord($string[$c]);
if ($i <= 127) @$out .= $string[$c];
if (@$byte2){
$new_c2=($c1&3)*64+($i&63);
$new_c1=($c1>>2)&5;
$new_i=$new_c1*256+$new_c2;
if ($new_i==1025){
$out_i=168;
} else {
if ($new_i==1105){
$out_i=184;
} else {
$out_i=$new_i-848;
}
}
@$out .= chr($out_i);
$byte2 = false;
}
if (($i>>5)==6) {
$c1 = $i;
$byte2 = true;
}
}
return $out;
}

$query = addslashes(trim($_GET['query']));
// if you use cp1251 collation your tables, uncomment below strings
//if (is_browser('opera')){
//  $query = utf8_to_win ($query);
//}
if($query AND $_SERVER['HTTP_REFERER'])
{
    foreach ($vbulletin->userinfo['forumpermissions'] AS $forumid => $fperms)
    {
        if (!($fperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($fperms & $vbulletin->bf_ugp_forumpermissions['cansearch']) OR !verify_forum_password($forumid, $forum['password'], false) OR !($vbulletin->forumcache["$forumid"]['options'] & $vbulletin->bf_misc_forumoptions['indexposts']))
        {
            $excludelist .= ",$forumid";
        }
        else if ((!$vbulletin->GPC['titleonly'] OR $vbulletin->GPC['showposts']) AND !($fperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
        {    // exclude forums that have canview but no canviewthreads if this is a post search
            $excludelist .= ",$forumid";
        }
    }

    $results = $db->query_read("SELECT * FROM ". TABLE_PREFIX ."thread WHERE `title` LIKE '%$query%' AND `". TABLE_PREFIX ."thread`.`forumid` NOT IN (0 $excludelist) LIMIT 50");
    if ($db->num_rows($results)> 0)
    {
    while($result = $db->fetch_array($results))
    {
        $trimtitle = 45;
        $lsfid = $result['forumid'];
        $lsttitle = $result['title'];
        $lsalt = $lsttitle;
        if ($trimtitle > 0 && strlen($lsttitle) > $trimtitle)
        { $lsttitle = fetch_trimmed_title($lsttitle, $trimtitle); }
        $lsttitle = preg_replace('/\<[a-zA-Z0-9 \&lt;\<\>\&gt;\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $lsttitle); 
//        $lsttitle = preg_replace("#(".$query.")#si", "<span style=\"color: #ff0000; font-weight: bold;\">\\1</span>", $lsttitle);
        $lsttitle = preg_replace("#(".$query.")#si", "<span class=\"highlight\">\\1</span>", $lsttitle);
        $lstid = $result['threadid'];
        $lsftitle = $db->query_first("SELECT title FROM ". TABLE_PREFIX ."forum WHERE forumid = $lsfid LIMIT 1");
        $lsfname = $lsftitle['title'];
        echo "<div style=\"float:left;\"><a href=\"".$vboptions[bburl]."/Vb/showthread.php?t=".$lstid."\" title=\"".$lsalt."\">".$lsttitle."</a></div><div style=\"float:right;\"><a href=\"".$vboptions[bburl]."/Vb/forumdisplay.php?f=".$lsfid."\"><font color=\"#666666\">".$lsfname."</font></a></div><br />";
    }
    }else{
    echo "<div align=\"center\">" . $vbphrase[ls_no_results] . "</div>";
    }
}
?>
I dont have the product and i have unistall it from vb to install this one.

i think here is the tip...
function utf8_to_win($string){
for ($c=0;$c<strlen($string);$c++){
$i=ord($string[$c]);
.............................
Reply With Quote
  #107  
Old 03-24-2009, 02:26 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This function convert utf to windows-1251(cp1251)...
Reply With Quote
  #108  
Old 03-24-2009, 05:05 PM
rmxs rmxs is offline
 
Join Date: Apr 2006
Posts: 419
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mad@Max View Post
This function convert utf to windows-1251(cp1251)...
Yes i know byt with the old work with non english and with new no. :|
you have try to include this on new version?
Reply With Quote
  #109  
Old 03-24-2009, 08:11 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Version 2.0.4
Previously was a problem that, if after a certain time to begin a search, it will not bring any results. Now the problem is solved (i hope) by using $vbulletin->GPC.
Reply With Quote
  #110  
Old 03-24-2009, 08:19 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

rmxs, i can, but I do not know if this will work for all. But you can do this for yourself:
Replace this
PHP Code:
    if (function_exists('iconv'))
    {
        
$query = @iconv('UTF-8'$stylevar['charset'], $query);
    }else
    {
        
$query $query;
    } 
With
PHP Code:
        function utf8_to_win($string)
        {
            for (
$c 0$c strlen($string); $c++)
            {
                
$i ord($string[$c]);
                if (
$i <= 127)
                    @
$out .= $string[$c];
                if (@
$byte2)
                {
                    
$new_c2 = ($c1 3) * 64 + ($i 63);
                    
$new_c1 = ($c1 >> 2) & 5;
                    
$new_i $new_c1 256 $new_c2;
                    if (
$new_i == 1025)
                    {
                        
$out_i 168;
                    } else
                    {
                        if (
$new_i == 1105)
                        {
                            
$out_i 184;
                        } else
                        {
                            
$out_i $new_i 848;
                        }
                    }
                    @
$out .= chr($out_i);
                    
$byte2 false;
                }
                if ((
$i >> 5) == 6)
                {
                    
$c1 $i;
                    
$byte2 true;
                }
            }
            return 
$out;
        }
        
$query utf8_to_win($query); 
Reply With Quote
  #111  
Old 03-24-2009, 08:30 PM
rmxs rmxs is offline
 
Join Date: Apr 2006
Posts: 419
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now this version works without any change
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 07:42 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05143 seconds
  • Memory Usage 2,386KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_code
  • (4)bbcode_html
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)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
  • (4)postbit_attachment
  • (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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete