
FaceBook Autosuggest Like is a powerful jQuery plugin to transform an input field into a real time autocompletion search engine, designed like facebook one.
This plugin require jQuery libs and the autocompletion plugin ‘Bsn Autosuggest ».
On custom side, make an ajax request and build search plugins to categorize your results.
Features :
- Autocomplete and ajax support
- Database search
- Support search plugins
- Support cache
- Cross Browser support ( IE > 5.5, FireFox, Safari, Opera )
I let u see the demo…
Have Fun !





Hello
I want to know if your script works normally with html and php?
thank you
cordially
Mahfoud
14 septembre 2012 16:08
very useful and very nice article thank you
26 août 2012 04:51
Great, thank you very much :) Pure awesome
17 août 2012 14:04
nice brow
1 avril 2012 15:28
Nice Coll
1 avril 2012 15:27
Normally, i test it on IE 5.5 in the past.
I think it's still working, but can't test at this time (no more windows around me)
17 janvier 2012 20:54
great work mate.. is this working in IE6?
thanks..
17 janvier 2012 14:10
hey,
good job man !
is it possible to search friends ?
9 décembre 2011 15:33
Thanks for this. I'm gonna do some awesome stuff with this code :)
15 novembre 2011 22:44
Hi,
Great work.
14 novembre 2011 07:21
Damn i lov it! good work :)
10 novembre 2011 14:20
I have been trying to get this to work. do i need to use it with wordpress? i removed all the wordpress php lines from index.php and nothing works.
18 octobre 2011 16:33
Thank you,nice tutorial....
11 septembre 2011 10:24
Great work man! Nice engine!
29 août 2011 05:12
Your sample code is quite unusable. Hope you explain how everything works better
27 août 2011 18:15
GOOD,Thanks
27 août 2011 05:59
$('#search_country_value').val(obj.id);
$('#form_search_country').submit();
But it still not work.
it´s very important also.
thanks for further help.
15 août 2011 09:23
that is greate. thx
15 août 2011 09:22
Good work, Thanks !
1 août 2011 02:51
your source code is very good and i really like it
27 juillet 2011 23:38
GOOD
22 juillet 2011 14:51
do yo have any suggestion for user with the alphabet like japanes etc. ?
13 juin 2011 13:38
Hei nice, but what--> if I want to sumit the from if no match found ?
I have tried to uncomment these lines:
$('#search_country_value').val(obj.id);
$('#form_search_country').submit();
But it still not work.
it´s very important also.
thanks for further help.
13 juin 2011 11:02
Muito legal mesmo !!! Obrigado.
22 mai 2011 03:09
useful
20 mai 2011 10:03
I really love your blog!
18 mai 2011 16:48
Fantastic idea.
6 mai 2011 01:29
awesome job!!
5 avril 2011 14:19
Really nice and great..
Thank you so much...
6 mars 2011 16:10
It's everything here exactly what I was looking for :) I'm so happy that I step in right here.lol
5 février 2011 12:33
Hey. Thanks. Great job. This is really insteresting effect
7 janvier 2011 00:04
Very useful.thx, it’s realy helpfull
30 novembre 2010 20:59
When I try to do it with a mysql query, it simply doesn't work
28 novembre 2010 23:53
Awesome site but you need to try and getrid of all your spam messages.
27 novembre 2010 20:02
hi, i have a problem. max results is not working. :)
19 août 2010 10:48
hi, your code is working good. but i have a problem. if i made another plugin using that code from a different table. it is not working here is my code.
_doAjaxSearch.action.php file
---
if ( $_GET['plugin'] ) {
include('plugin.'.$_GET['plugin'].'.php') ;
} else {
// Default
include('plugin.users.php') ;
include('plugin.articles.php') ;
}
---
plugin.articles.php file
---
if ( ! SEARCHENGINE_LOADED ) return false;
$articles = mysql_query("SELECT * FROM articles");
$num_rows = mysql_num_rows($articles);
$i=0;
$searchCat_name = 'Articles' ;
#@ Convert results into array
while ($i < $num_rows) {
$article_id = mysql_result($articles,$i,"article_id") ;
$article_name = mysql_result($articles,$i,"article_title") ;
$article_access = mysql_result($articles,$i,"article_access") ;
$article_date = mysql_result($articles,$i,"article_date") ;
// To display
$results['value'] = utf8_encode($article_name). ' ('.utf8_encode($article_date).')-'.utf8_encode($article_id);
$results['info'] = utf8_encode($article_access) ;
// Store result
$search_engine['results'][$searchCat_name][$article_id] = $results ;
$i++;
}
---
users plugin is the code you posted.
it's not working men. please help. thanks
19 août 2010 10:12
hi, your code is working good. but i have a problem. if i made another plugin using that code from a different table. it is not working here is my code.
_doAjaxSearch.action.php file
---
if ( $_GET['plugin'] ) {
include('plugin.'.$_GET['plugin'].'.php') ;
} else {
// Default
include('plugin.articles.php') ;
}
---
plugin.articles.php file
---
if ( ! SEARCHENGINE_LOADED ) return false;
$articles = mysql_query("SELECT * FROM articles");
$num_rows = mysql_num_rows($articles);
$i=0;
$searchCat_name = 'Articles' ;
#@ Convert results into array
while ($i < $num_rows) {
$article_id = mysql_result($articles,$i,"article_id") ;
$article_name = mysql_result($articles,$i,"article_title") ;
$article_access = mysql_result($articles,$i,"article_access") ;
$article_date = mysql_result($articles,$i,"article_date") ;
// To display
$results['value'] = utf8_encode($article_name). ' ('.utf8_encode($article_date).')-'.utf8_encode($article_id);
$results['info'] = utf8_encode($article_access) ;
// Store result
$search_engine['results'][$searchCat_name][$article_id] = $results ;
$i++;
}
---
users plugin is the code you posted.
it's not working men. please help. thanks
19 août 2010 10:09
Hi Vinmark,
In facts, you have to build a php array while fetching your mysql results.
So it gives something like that for you :
$users = mysql_query("SELECT * FROM users");
$num_rows = mysql_num_rows($users);
$i=0;
$searchCat_name = 'Users' ;
#@ Convert results into array
while ($i < $num_rows) {
$uid = mysql_result($users,$i,"user_id") ;
$firstname = mysql_result($users,$i,"firstname") ;
$middlename = mysql_result($users,$i,"middlename") ;
$lastname = mysql_result($users,$i,"lastname") ;
// To display
$results['value'] = utf8_encode($firstname). ' ('.utf8_encode($lastname).')';
$results['info'] = utf8_encode($middlename) ;
// Store result
$search_engine['results'][$searchCat_name][$uid] = $results ;
$i++;
}
Bye !
4 août 2010 10:40
Hi, i'm doing my php project and i saw this. can you please help me, how the $country_list variable may have the whole database of mine.
$users = mysql_query("SELECT * FROM users");
$num_rows = mysql_num_rows($users);
$i=0;
while ($i < $num_rows) {
$listofusers .=mysql_result($users,$i,"user_id"). "\"," . "\"". mysql_result($users,$i,"firstname"). "\"," . "\"" . mysql_result($users,$i,"middlename") . "\"," . "\"". mysql_result($users,$i,"lastname") . "\",\"\"" ."
\"";
$i++;
}
$newlistofusers = substr($listofusers,0,-1);
$user_list = '"user_id","firstname","middlename","lastname","extra"
"'.$user_list;
Please help. :)
3 août 2010 21:22
This is very interesting to me and I am going to try it out.
Thanks
20 juillet 2010 10:57
nice info
12 juillet 2010 10:17
nice post, i will try it
12 juillet 2010 10:16
[...] FaceBook Like – jQuery and autosuggest Search Engine [...]
25 juin 2010 19:29
It's very good.
I like this.
Thanks for share.
And I wrote something to introduce this project for my readers.
You can find the post about this in my website.
If something is wrong,pls figure it out.thanks.
17 juin 2010 03:29
Very nice :D
16 mai 2010 08:16
Hihi :)
10 mai 2010 18:27
Guillaume,
Je me suis fait chier pour rechercher l'identifiant de ce que je sélectionnais dans un formulaire jusqu'à ce que je vois que je pouvais le faire avec un callback...
Guillaume... tu es un génie, tu as pensé tout !
Merci ! ^^
10 mai 2010 13:05
@KiteFr : Bon bah c'est cool ça ! Pour répondre à ta question sur comment apprendre PHP orienté objet, je ne peux te donner qu'un seul conseil : essaye de faire en sorte que tes nouveaux dev comportent des classes et non des fonctions.
Tu ne vas pas forcément en saisir l'intérêt au début, car ça ajoute un peu de code, mais :
1/ Le code est vachement mieux organisé au final
2/ Apprendre dans les classes que tu as sous la main. C'est à dire que tu vas apprendre avec le code des autres. Et pour ça, je te conseille phpclasses.org qui contient des milliers de classes PHP, documentées.
3/ Le principe de la programmation objet, c'est que tu as par exemple X users. Tu vas pouvoir créer une classe (un objet) qui va être appellée pour chacun de ces X users, en fonction de ce que tu veux récupérer.
Je m'explique : tu peux avoir une classe 'users', une classe 'movies'...
A chaque fois que tu charges une classe, tu fais une sorte de catalogue : quand tu load la classe user, tu fais une requete pour avoir toutes les infos du user concerné et le résultat de celle-ci est conservée dans ta classe, disponible à tous moments.
De même pour ta classe 'movies'.
Ensuite, tu utilises tes classes comme ceci :
$usr = new ClassUser($uid) ; // Ca vient de te créer un objet ClassUser, et l'initie sur un user id
$movies = new ClassMovies() ;
$usr->movies = $movies->getFromUid($uid) ; // Requete qui va chercher tous les films postés par un uid
print_r( $usr->movies ) ; // ===> affiche tous les films que le user $uid a posté.
@evo_joe : Idea is good : great ^
6 mai 2010 15:28
never mind, i solved this problem, just modified the bsn js file by using _b.DOM.cE function.
btw the fourth parameter of the function should be 'true'.
6 mai 2010 11:41
hi Guiltouf
your source code is very good and i really like it.
And I wonder know if it is possible for adding a image for each suggestion list item?
Any tips for that? Thank you very much.
6 mai 2010 05:17
Salut Guillaume ! Juste pour te dire que ca marche maintenant!
J'ai fais un test avec une bdd simulé et ca marchais, je devais avoir un problème avec ma boucle sur ma bdd en fait...
Je sais pas trop, j'ai remis le fichier comme avant juste changé le nom des variable et hop ! ca marche ^^
Ne t'inquiète pas, je ne t'oublie pas, des que le site sera en ligne je t'enverrai un message !
5 mai 2010 00:21
hey Guillaume !
Comment tu va ? ^^
J'ai bien réussi a maitriser ton script pour le mettre dans mon site. J'en ai fais un que j'utilise pour retrouver les nom des utilisateurs (donc plugin.users.php)
Mais même si il marche bien, j'ai un problème... j'ai mit en limit 5 pour le maximum de résultat affiché, mais il ne m'en affiche que 1 !
Et peux importe ce que je fais, il ne m'en affiche toujours que 1, donc c'est embêtant :/
Aurai-tu une solution, dans quels fiché cela peut être, etc... ^^
Ammicalement,
Kitefr
4 mai 2010 23:26
Je vais tester la class JSON mais je ne te promet rien xD
Merci en tout cas !
On doit prévoir plus d'interactivité en json pour la prochaine version ? :p
J'ai réussi a prendre en compte ce que je veux avec caractère asiatique ! c'est en json mais j'ai rajouté dans _doAjaxSearch.action.php tout en bas dans la partie json (pour moi ligne 101), j'ai rajouter les deux parties que je voulais pour "cat_name" et "link"
Et grace à ton nouveau bsn.autoSuggest, ca les prend en compte parfaitement ^^ Bon il faut juste que je délimite ce que je veux ici ou alors je fais comme tu as fais juste en dessous pour la partie XML, et je tente un foreach. Bref ! merci ^^
Pour l'adresse, tu l'aura très bientôt ! C'est pour le moment en local sur mon ordinateur donc et j'ai encore plein de travail dessus !
Je réfléchi déjà même à une version entièrement en POO ! (histoire d'apprendre... et le meilleur moyen d'apprendre, c'est de se lancer ! lol)
Mais je pense à utiliser ton autoSuggest dans mon site professionnel ! ^^
21 avril 2010 07:35
Nickel Kitefr, tu me donneras une adresse pour voir ce que ça donne ?
ET bonne nuit tu as bien bossé ^^
20 avril 2010 23:46
Dernier message avant de dormir !
C'est bon tout marche ! sauf le problème avec les caractère asiatique !
Dès que j'en met, j'ai le bug de "xml.getElementsByTagName".
Mais des que je les enlève, tous marche parfaitement ^^
Merci en tout cas guillaume pour ton aide !
Et si tu as une astuce pour les caractères asiatique, n'hésite pas ^^
Bonne nuit !
20 avril 2010 22:58
Je t'avoue que j'ai laissé tombé XML pour justement les problèmes d'encodage.
Si tu as l'occasion utilises une classe JSON qui te transforme n'importe quelle variable en JSON en deux coups de cuillère à pot : http://mike.teczno.com/JSON/
Ensuite : $json->encode($var) & $var = $json->decode($json)
A savoir si ça va mieux marcher avec les caractères asiatiques, je n'en ai pas encore fait l'expérience, mais pour moi plus de problèmes : JSON + UTF8
Allé, bon courage ^^
20 avril 2010 22:58
Bon Guillaume !
Je pense avoir trouver le pourquoi de cette erreur !
Elle vient de mes plugins ! Et plus précisément je pense que le "xml.getElementsByTagName" n'apprécie pas trop mes caractères asiatique ! (que j'envoie pas avec utf8_encode car déja en utf8 étant donné que c'est des signe asiatique !).
A part ca tout semble fonctionné a part une chose... La liste des suggestion ne s'affiche plus... du tout ! Même si les données passent bien en XML.
Je te tiens au courant ! bonne nuit à demain ^^
20 avril 2010 22:42
J'ai trouvé ou était le bug... j'avais laissé : json = true, dans les options... néanmoins ca me met un nouveau message d'erreur :
var results = xml.getElementsByTagName('results')[0].childNodes;
ligne 319...
je crois que je vais aller dormir et tout reprendre de 0 des demain, ca ira mieux comme ca lol
20 avril 2010 22:18
Ca a l'air de marché ! J'avais fais quelque erreur !
Néanmoins, dans mon cas ca ne marche pas car si dans les options je met le nouveau :
script:"AjaxSearch/_doAjaxSearch.action.php?limit=9&",
alors ca me sort que j'ai un bug dans le bsn.AutoSuggest en me disant qu'il manque une parenthèse a la ligne 305.
et si je rajoute le "json=true" avant le limit, ca marche sauf que ca ne pe pas prendre les infos supplémentaire lol
Je vais tenter de voir pourquoi ca ne marche pas ^^
En attendant si tu as une idée ! lol
20 avril 2010 22:06
Salut Kite,
En fait, il faut que tu reprennes le nouveau bsn.autoSuggest.js par défaut qui est dans le nouveau '.zip' et celui-là, tu ne le bidouilles plus ( ça va être dur, je sais... )
Ensuite, tu ajoutes les paramètres que tu veux retrouver dans les plugins de recherche.
Look at the code dans la démo, le premier exemple est normalement fait pour toi !
Voilou. Ciao et j'espère que ça va marcher pour toi !
20 avril 2010 21:29
Il semble que dans _doAjaxSearch.action.php,
il y a la partie ligne 101 que tu n'a pas changé.
J'ai rajouter pour prendre en compte "link" et "cat_name", ca passe bien dans le json mais quand j'utilise obj.cat_name et obj.link, ca m'affiche undefined... :/
Je pense que tu as peut etre oublié de faire en sorte que ca prenne en compte les "obj" créer soi meme dans le bsn.AutoSuggest !
Enfin, je ne sais pas trop, tiens moi au courant ^^
20 avril 2010 18:55
Salut Guillaume !!
Je suis enfin de retour et j'ai testé ca ! Mais j'ai toujours undifined... peux-tu me dire ce que tu as changé dans les fichiers ? ^^
Merci
Kitefr
20 avril 2010 18:49
Thanks Guillaume,
But i can't test it now, I'm not in my house for the next 10 days ! :/
So i will test it as soon as i come back and I'll tell you my opinion :)
The code seams simpler than the one before ^
12 avril 2010 18:26
Ok, so Kite : I've done modifications in plugin.
Check at new zip file (link is on demo page).
Know, you've just to add new fields in the plugin and you can access them in callback trigger.
@Rob E : you can get the movie_id like this $_GET['movie_id'] in the plugin file.
Look in the file '_doAjaxSearch.action.php', line 15 : $_GET[input'] catch the input text send in url
Is that ok for you ?
12 avril 2010 17:32
Hey Guillaume:
Thanks for the response. And I understand your example. HOWEVER. You said use: AjaxSearch/_doAjaxSearch.action.php?json=true&plugin=actor&limit=8&movie_id=12
How do I get the movie_id from the input selection?
Rob
8 avril 2010 19:10
Edit : ligne 63 et 112
et pour les guillemets, ne t'inquiète pas elle n'ont pas cette allure normalement lol
8 avril 2010 12:39
Salut Guillaume !
Ca ne marche toujours pas ! :/
j'ai modifié de _doAjaxSearch.action.php
j'ai rajouté apres la ligne 75 :
"cat_name" => addslashes(html_entity_decode($val[$key]['cat_name'], ENT_QUOTES, 'UTF-8')),
"link" => addslashes(html_entity_decode($val[$key]['link'], ENT_QUOTES, 'UTF-8'))
J'ai modifier la ligne 100 (le $arr[]) pour les resultat en json comme suit :
$arr[] = "{\"id\": \"".$aResults[$i]['id']."\", \"value\": \"".$aResults[$i]['value']."\", \"info\": \"".$aResults[$i]['info']."\", \"cat_name\": \"".$aResults[$i]['cat_name']."\", \"link\": \"".$aResults[$i]['link']."\"}";
mais je pense que je dois modifier la ligne 112 pour la sortie XML mais je ne vois pas comment.
en fait il y a certaines zone du fichier tel que la ligne 63 et 122 que je ne vois pas comment modifier pour prendre en compte mes paramètres.
Aurai-tu une solution ? ou vaut -il mieux que j'attende la nouvelle version ?! ^^
8 avril 2010 12:35
Eh eh ! Et pas qu'un peu :)
Tiens moi au jus.
8 avril 2010 02:46
Ok ! Hate de voir la prochaine version ! Surtout qu'avec Rob et moi, on a du te donner plein d'idée ! hehe
Bref, je test tout ca des demain et je te tiens au courant !
8 avril 2010 02:09
Plus je remets le nez dedans et plus j'ai honte de la manière dont c'est codé :)
Bon allez Kite, un dernier patch maison pour te dépanner :
Tu as raison, pour le moment, ajoute simplement tes paramètres supplémentaires en ligne 73.
Et moi je vais mettre ça à jour vite fait.
Pas le temps dans la semaine arrive, mais une nouvelle version à prévoir dans la fin du mois je pense.
Voilou pour la ptite réponse en fr :) On attend RobE pour reswitcher in english :)
8 avril 2010 02:02
haa terrible !!
Merci Guillaume ^^
Ce plugin c'est le meilleur ^^
Je test ca tout de suite !
Hummm j'ai toujours undefined... je vais voir en déclarant les variable dans le fichier _doAjaxSearch.action.php
car d'apres ce que je vois, il ne reconnait dans ce fichier que les element id, value et info (environ ligne 73).
PS : J'adore, on se parle en anglais ou francais, on ne sait plus quelle langue choisir haha
7 avril 2010 19:46
Euh, je suis bête...
Encore mieux et largement plus simple : this.aSug.push(jsondata.results[i]);
Comme ça tu auras accès à tout ce que tu déclares dans ton plugin.
7 avril 2010 19:35
Tu as raison Kite.
En fait, et en attendant une mise à jour 'officiel' du plugin, voici de quoi te dépanner.
Dans le fichier 'bsn.AutoSuggest_2.1.3.js', à la ligne 314, tu as :
this.aSug.push( { 'id':jsondata.results[i].id, 'value':jsondata.results[i].value, 'info':jsondata.results[i].info } );
Rajoute ici et fait de même pour la sortie en XML ligne 329.
Ca va te donner :
this.aSug.push( { 'id':jsondata.results[i].id, 'value':jsondata.results[i].value, 'info':jsondata.results[i].info, 'link':jsondata.results[i].link } );
ET moi, je pense que je vais vous pondre une petite nouvelle version un de ces jours, avec beaucoup plus de callbacks et de dynamisme.
Voilou.
7 avril 2010 19:32
Hi Guillaume, thanks ! it exactly like i wanted but it doesn't work :/
I did just like you said.
But all variable others than 'id', 'value' and 'infos' are mark as "undefined".
I added $results['cat_name'] and $results['link']
and i used obj.cat_name and obj.link but i tested it the "build html" code you said and the result was Cat : undefined and link undefined...
Perhaps i need to change something in another file :/
like in _doAjaxSearch.action.php.
Do i need to declare those variables in this file too ?
- Kitefr
7 avril 2010 19:03
Hi Rob E & Kitefr,
The first thing you have to apply is that you can access any informations sended by plugins.
If you take the 'plugin.capitals.php' in the donwloadable archive, you can add some variables.
Example :
--> Add the cat of the plugin :
...
$results['info'] = utf8_encode($common_name) ;
$results['cat_name'] = utf8_encode($searchCat_name) ;
--> Add a link to each results
...
$results['info'] = utf8_encode($common_name) ;
$results['link'] = utf8_encode('http://..../article.php') ;
After in the callback handle of the autosuggest, you can access to any info for the selected item :
var options = {
script:"AjaxSearch/_doAjaxSearch.action.php?json=true&limit=8&",
...
callback: function (obj) { // Callback after click or selection
// Build HTML
var html = "Cat : "+ obj.cat_name +"ID : " + obj.id + "<br>Main Text : " + obj.value + "<br>Info : " + obj.info+"<br>Link : "+obj.link;
$('#input_search_all_response').html(html).show() ;
}
};
And for your special needs RobE, you have to create a special plugin to manage actors list.
1. User choose a film in the first autosuggest
2. In the callback, you build the second autosuggest list by specifing plugin to use and send to this plugin the movie_id
==> In case of using default "AjaxSearch/_doAjaxSearch.action.php?json=true&plugin=movie&limit=8&", replace it with "AjaxSearch/_doAjaxSearch.action.php?json=true&plugin=actor&limit=8&movie_id=12"
3. Then in you new plugin called plugin.actor.php, take the movie_id and make a sql request to obtain only actors list from movie_id 12
Now in the second autosuggest input box, you have only choice between actors from the movie id
Little tip, remove the second input box at each first input box changes.
7 avril 2010 18:33
Salut Guillaume, j'ai laissé un commentaire un peu plus haut, je ne sais pas si tu l'a vu.
@Rob : i tried to modify the JS to go on page suggested by the autosuggest list.
But can't make it work :/
otherwise it's all good ! ^^
7 avril 2010 14:09
Hi Guillaume
It would be an autosuggest as well.
So if the first one was a list of (for example) movies and the second would be a list of actors. You'd select a movie in the first one, and then in the second you'd see a list of all the actors in that movie.
7 avril 2010 13:45
Hi Rob E !
A question : the second input is an autosuggest input too or just used to display suggests if more than one displayed when user clicked on the first ?
6 avril 2010 21:33
Hi again.
Still loving this script and looking to use it more. I have one input box that uses the search. And I want to have a second one that displays suggestions based on how the first one was selected.
How would I do this? (I know next to nothing about javascript)
Rob
6 avril 2010 18:45
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
26 mars 2010 00:43
@Rob : Thanks it works now ^^ just one thing i try to do like i told you in my email !
@Guillaume : Merci ca marche bien ! J'essaye juste de modifier le plugin pour que lorsque je clic sur l'une des suggestion, ca me charge directement la fiche relié a cette suggestion.
par exemple j'ai 3 plugins :
- series
- teams
- acteurs
j'ai bien la liste de suggestion avec les catégories mais j'essaye (et ca ne marche que si il n'y a que une catégorie) de charger une URL suivant la suggestion ou l'on clic...
Mais cet URL change complètement si on change de catégorie... et c'est la que je n'arrive pas.
Il faut créer une variable (ou deux ca dépend).
Ça aurai été ben d'avoir les nom (value) des catégories que l'on puisse rappeler facilement quand on le désire.
C'est peut être possible actuellement mais en ce qui me concerne... je ne sais pas faire ça :/
Est-ce que tu pourrai m'aider ?!
Merci d'avance ^^
17 mars 2010 17:30
Hi Rob !
I didn't received your email :/
this is my adress just in case : kitefr at gmail.com
15 mars 2010 21:16
@Kirefr Sent you an email let me know if you got it or not.
15 mars 2010 20:20
Well, i tried but stil not working...
I hope you can help me Rob or Guillaume... :/
14 mars 2010 23:03
@Guillaume : Thanks !
i'll try to use a mysql class.
My web site is a total mess and i planned to do the version 3 in oriented-object to learn it.
Thanks again ^^
13 mars 2010 15:58
@Kitefr : I recommand you to use to a php mysql class you can find on phpclasses.org or another website and which turn it easier to use and request db datas.
I've not the time today, but I will create a post with the class I use and how I use it. You'll see as simple it is.
Bye
13 mars 2010 15:36
@Guillaume : Thanks!
I totally forgot the info I wanted was in the input field. So I added a submit button and was able to work with the data I needed.
12 mars 2010 21:53
@Guillaume : Still not ok. iI will send an email to Rob to know how he makes it works.
It works for me when i don't use database connection but when i try to use it, i got no result :/
12 mars 2010 20:55
@Kitefr : it's ok for the db connexion ?
@Rob E : the little tip I see is that you bind the input keyup() and at this moment, access to the list dom to know results.
It's not very beautiful but it works :)
12 mars 2010 19:39
I can try. email me at bokhannes at gmail.com
12 mars 2010 15:21
Hi ! Great script you have here.
But i can't figured out how to connect it to a database... I'm cgoing crazy...
Can someone help me ?
Thanks
12 mars 2010 14:58
This is a great script. I have it working perfectly with a database. It works seamless. Thanks for your work on this!
I have one question: How can I take the desired result and use it else where. IE: I want to take a result and add it to a list, then do another search and add that result to the list as well, and so on. then when I'm done add the whole list to another database.
12 mars 2010 14:47
[...] 2. Auto-Suggest with Jquery [...]
19 janvier 2010 14:24
[...] FaceBook Like – jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for design, use jQuery as ajax framework [...]
10 janvier 2010 20:29
[...] Descargue aquí esta característica de búsqueda por sugerencias automáticas inspirada en Facebook. [...]
21 décembre 2009 14:43
[...] Download this Facebook-inspired auto-suggest search feature here. [...]
19 décembre 2009 10:02
[...] Download this Facebook-inspired auto-suggest search feature here. [...]
15 décembre 2009 17:49
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
13 décembre 2009 09:48
Salut !
Merci pour ce magnifique plugin mais j'aurai besoin d'un peu d'aide pour le faire marcher avec mysql.
j'utilise :
--
#@ Detect if loaded by search_engine
if ( ! SEARCHENGINE_LOADED ) return false;
#@ Category Name
$searchCat_name = 'Teams' ;
#@ Do search
$sql = 'SELECT * FROM teams LIKE "%'.$search_engine['options']['input'].'%"
ORDER BY name
LIMIT 0, '.$search_engine['options']['search_limit'].'';
$db = mysql_query($sql);
#@ Transform txt in array
while ( $val = mysql_fetch_array($db) ) {
$results['value'] = utf8_encode($val['name']). ‘ (’.utf8_encode($val['initial']).’);
$results['info'] = utf8_encode($val['type']) ;
$search_engine['results'][$searchCat_name][$val['id']] = $results ;
}
--
Mais firebug me met :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in F:\wamp\www\AjaxSearch\plugin.teams.php on line 27
{"results": []}
Comment je pourrai le résoudre ? :/
Merci d'avance pour l'aide ^^
8 décembre 2009 22:30
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
26 novembre 2009 23:29
[...] 16.2 FaceBook Like – jQuery and autosuggest Search Engine [...]
17 novembre 2009 18:14
Hi,
The download works for me, can you retry from the article's link ?
Bye.
8 novembre 2009 17:44
Dear Friend,
I'm not getting to donwload of file.
I'm redirecting to another page without nothing.
Where is file to download?
Thanks,
Jackson A. Diniz (BH/MG/Brazil)
jacksonanalista@gmail.com
6 novembre 2009 18:46
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
28 octobre 2009 09:49
[...] jQuery And Autosuggest Search Engine FaceBook Like – jQuery and autosuggest Search Engine. Features autosuggest and ajax support, [...]
26 octobre 2009 17:13
[...] [...]
22 octobre 2009 08:40
[...] FaceBook Like – jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for design, [...]
21 octobre 2009 15:20
Hi Chitta,
First, I think you have to disable E_NOTICE errors in your php.ini configuration.
I use something like this in my configuration :
error_reporting = E_ALL & ~E_NOTICE
It's normal if you use all-in-one WAMP like EasyPhp.
Try this and if you have always the problem, can you log me the full error ( full path of file ).
Have fun !
18 octobre 2009 14:51
After downloading the code and running in local server i am getting this error <b>Notice</b>: Undefined index: plugin....action.php</b> on line <b>20</b>\n I got this error in firebug. Also i have noticed this the common error reported by few of the members. You have devloped a great plugin but it will be better if you will fix the common errors it would be a great help.
16 octobre 2009 22:46
[...] Facebook like Autocomplete [...]
3 octobre 2009 18:48
[...] web2ajaxFaceBook Like – jQuery and autosuggest Search Engine [...]
24 septembre 2009 19:28
[...] FaceBook Like – jQuery and autosuggest Search Engine (demonstração online) Plugin para criar um autosuggest com um design baseado no do Facebook. [...]
17 septembre 2009 23:55
Hi! I was surfing and found your blog post... nice! I love your blog. :) Cheers! Sandra. R.
11 septembre 2009 00:06
[...] web2ajaxFaceBook Like - jQuery and autosuggest Search Engine [...]
9 septembre 2009 18:11
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
6 septembre 2009 11:35
[...] web2ajaxFaceBook Like – jQuery and autosuggest Search Engine [...]
4 septembre 2009 10:47
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
29 août 2009 03:41
[...] web2ajaxFaceBook Like — jQuery and autosuggest Search Engine [...]
28 août 2009 17:09
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
28 août 2009 08:36
[...] FaceBook Like – jQuery and autosuggest Search Engine (demonstração online) Plugin para criar um autosuggest com um design baseado no do Facebook. [...]
27 août 2009 19:02
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
26 août 2009 22:09
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
26 août 2009 05:16
[...] web2ajax FaceBook Like – jQuery and autosuggest Search Engine [...]
25 août 2009 14:53
[...] web2ajaxFaceBook Like – jQuery and autosuggest Search Engine [...]
25 août 2009 00:06
[...] web2ajaxFaceBook Like – jQuery and autosuggest Search Engine [...]
24 août 2009 10:54
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
15 août 2009 18:23
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
14 août 2009 11:55
Hi Guiltouf,
I have tried downloading your: FaceBoox style autosuggest with jQuery on the webpage: http://www.web2ajax.fr/examples/facebook_searchengine/
I cant get the example to work on my local. It comes up with an error
Message: Syntax error
Line: 154
Char: 2726
Code: 0
URI: http://localhost/facebook_searchengine/
I have read all the comments in here, and tried with firefox without any solution of the bugged download you have published hm:/ Can you please help me?
Regards,
Allan
7 août 2009 12:23
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
22 juillet 2009 15:28
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
12 juillet 2009 00:56
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
7 juillet 2009 08:56
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
7 juillet 2009 01:54
[...] 13.) FaceBook Like – jQuery and autosuggest Search Engine [...]
6 juillet 2009 08:42
[...] 13.) FaceBook Like - jQuery and autosuggest Search Engine [...]
6 juillet 2009 07:47
hm.. funny ))
20 juin 2009 15:04
hi.
I have a problem with the facebook search engine, i adapted it to my mysql db and in my pc (with apache and all the stuff) works fine, but when i update it to the server it doesn't work more...
Do you know what can cause the problem?
The initial message on the text field appears but nothing happens when i wirte some text.
the strange it's that it works on my ocal server but not on the website server..
Can you help me?
Thanks
2 juin 2009 00:17
merci, je vais regarder de ce coté la
29 mai 2009 10:14
Bonjour Morgane,
Pour regarder un petit peu ce qui se passe dans la matrice, est-ce que tu as l'extension firebug pour mozilla ?
Cela va te servir à voir quelles requetes sont envoyées quand tu tapes un caractères dans le champ input et surtout de voir la réponse qui t'es renvoyée.
Normalement, la réponse doit être au format json. Si ce n'est pas le cas, tu devrais voir des erreurs.
N'hésite pas à reposter si tu as toujours des soucis.
Bon courage.
28 mai 2009 12:50
Bonjour,
j'ai telechargé "autosuggest Search Engine " et je n'arrive même pas à le faire marcher comme tel ( sans rien modifier ), je pensais que c'était la version de mon easyphp qui était en cause mais même avec easyphp 3 c'est pareil .
Y'a t-il quelque chose qui m'aurait échappé, j'ai regardé les chemin des pages, j'ai regardé Json sur php info et il est enabled . Si vous avez des pistes je vous en serez reconnaissant .
Morgane.
20 mai 2009 17:13
Very cool, it does realy helped me in my work!
14 avril 2009 19:30
Haa mince encore les "php" dsl !
--------------------------------------------------------------
Fichier "plugin.capital.php"
require_once('conf.php');
//Ou include?
require_once('class.db.php');
#@ Detect if loaded by search_engine
if ( ! SEARCHENGINE_LOADED ) return false;
#@ Category Name
$searchCat_name = 'Cities' ;
#@ Do search
$sql = 'SELECT * FROM toto LIKE "%'.$search_engine['options']['input'].’%”
ORDER BY TITRE LIMIT 0, ‘.$search_engine['options']['search_limit'] ;
$db->query($sql) ;
while ( $val = $db->next_record() ) {
$results['value'] = utf8_encode($val['TITRE']). ‘ (’.utf8_encode($val['ARTICLES']).’);
$results['info'] = utf8_encode($val['DESCRIPTION']) ;
$search_engine['results'][$searchCat_name][$val[ID]] = $results ;
}
--------------------------------------
Fichier conf.php
DEFINE ("SQL_HOST", "localhost");
DEFINE ("SQL_BDD", "toto");
DEFINE ("SQL_USER", "root");
DEFINE ("SQL_PASSWORD", "");
---------------------------------------------
Fichier db.class.php
Comme tu me l'a indiqué.
24 mars 2009 00:03
Slt, merçi encore une fois de prendre le temps de me répondre :)
Alors j'ai essayer d'appliquer cette classe, mais le problème c'est que j'ai déja des requêtes sql de faite avec un script de connexion php et divers éléments : il faudrait que je reprenne tout le code pour intégrer correctement cette classe!
D'autant plus que je suis vraiment débutant en php : c'est pas évident ^^ Mais c'est sur cela doit être beaucoup plus propre.
J'ai quand même essayer de cette manière qui n'est surement pas la bonne ^^
--------------------------------------------------------------
Fichier "plugin.capital.php"
//Ou include?
query($sql) ;
while ( $val = $db->next_record() ) {
$results['value'] = utf8_encode($val['TITRE']). ‘ (’.utf8_encode($val['ARTICLES']).’);
$results['info'] = utf8_encode($val['DESCRIPTION']) ;
$search_engine['results'][$searchCat_name][$val[ID]] = $results ;
}
? >
--------------------------------------
Fichier conf.php
---------------------------------------------
Fichier db.class.php
Comme tu me l'a indiqué.
Je ne sais plus trop ce que je dois faire et je voudrai pas abusé de ton temps, je vais ressayer quand même histoire de me faire la main. Merçi
24 mars 2009 00:01
Tiens, je te conseille d'utiliser une classe pour se connecter à mysql, c'est ce que j'utilise dans tous mes projets et c'est beaucoup moins lourd à utilise après.
Donc tu mets tout ça dans un fichier nommé 'class.db.php' :
<code><?php
class DB {
var $Host = SQL_HOST; // Hostname of our MySQL server
var $Database = SQL_BDD; // Logical database name on that server
var $User = SQL_USER; // Database user
var $Password = SQL_PASSWORD;// Database user's password
var $Link_ID = 0; // Result of mysql_connect()
var $Query_ID = 0; // Result of most recent mysql_query()
var $Record = array(); // Current mysql_fetch_array()-result
var $Row; // Current row number
var $Errno = 0; // Error state of query
var $Error = "";
#
# Create a link id to the MySQL database
# Allow to call $var = new DB($otherhost,$otherDB,$otheruser,$otherpass);
# where $other* are connections vars different from
# $this->Host, etc
#
function DB($altHost = "",$altDB = "",$altUser = "",$altPassword = "") {
if ($altHost == "")
$altHost = $this->Host;
if ($altDB == "")
$altDB = $this->Database;
if ($altUser == "")
$altUser = $this->User;
if ($altPassword == "")
$altPassword = $this->Password;
$this->Host = $altHost;
$this->Database = $altDB;
$this->User = $altUser;
$this->Password = $altPassword;
}
#@ Class destructor
function __destruct() {
$this->close() ;
foreach ($this as $index => $value) unset($this->$index);
}
#
# Stop the execution of the script
# in case of error
# $msg : the message that'll be printed
#
function halt($msg, $halt_after = false) {
echo("<BR><FONT COLOR=\"#FF0000\"><B>Database error:</B> $msg<BR>\n</FONT>");
if ( $halt_after ) {
die("<font color=red><B><BR> @=> Page loading aborted... </B></font>");
} else {
echo("<B>MySQL error</B>: ") ;
echo("<br>$this->Errno ($this->Error)<BR>") ;
}
}
#
# Connect to the MySQL server
#
function connect() {
global $DBType;
if($this->Link_ID == 0) {
$this->Link_ID = @mysqli_connect($this->Host,
$this->User,
$this->Password);
if (!$this->Link_ID) {
$this->halt("Connect to [$this->Host] failed. <BR> Please verify Host, Login and Password.", $halt_after = true);
}
$SelectResult = @mysqli_select_db($this->Link_ID, $this->Database);
// Set default to UTF8
$this->query('SET NAMES UTF8;') ;
if(!$SelectResult) {
$this->Errno = mysqli_errno($this->Link_ID);
$this->Error = mysqli_error($this->Link_ID);
$this->halt("cannot select database <I>".$this->Database."</I>", $halt_after = true);
return false ;
}
}
#@ Else return true
return true ;
}
#
# Send a query to the MySQL server
# $Query_String = the query
#
function query($Query_String) {
// DEBUG MODE
$this->debug = false ;
// DEBUG : Store microtime to log requests
( $this->debug ? $time_start = microtime(true) : false ) ;
$this->connect();
//_dumpLog($Query_String) ;
$this->Query_ID = @mysqli_query($this->Link_ID, $Query_String);
$this->Row = 0;
$this->Errno = mysqli_errno($this->Link_ID);
$this->Error = mysqli_error($this->Link_ID);
if ( $this->Errno == 2006 ) {
unset($this->Link_ID) ;
$this->connect();
$this->Query_ID = @mysqli_query($this->Link_ID, $Query_String);
$this->Row = 0;
$this->Errno = mysqli_errno($this->Link_ID);
$this->Error = mysqli_error($this->Link_ID);
if (!$this->Query_ID) {
$this->halt("Invalid SQL: ".$Query_String);
}
} else {
if (!$this->Query_ID) {
$this->halt("Invalid SQL: ".$Query_String);
}
}
// DEBUG : Store microtime to log requests
( $this->debug ? $time_stop = microtime(true) : false ) ;
// DEBUG WRITE A LOG
if ( $this->debug ) {
_dumpLog("sql : $Query_String | exec : " . ( $time_stop - $time_start) . "ms", $error_level=1) ;
}
return $this->Query_ID;
}
#
# return the next record of a MySQL query
# in an array
#
function next_record() {
$this->Record = @mysqli_fetch_array($this->Query_ID, MYSQLI_ASSOC);
$this->Row += 1;
$this->Errno = mysqli_errno($this->Link_ID);
$this->Error = mysqli_error($this->Link_ID);
$stat = is_array($this->Record);
if (!$stat) {
@mysqli_free_result($this->Query_ID);
$this->Query_ID = 0;
}
return $this->Record;
}
#
# return the next record of a MySQL query
# in an object
#
function fetch_assoc() {
$this->Record = @mysqli_fetch_assoc($this->Query_ID, MYSQLI_ASSOC);
$this->Row += 1;
$this->Errno = mysqli_errno($this->Link_ID);
$this->Error = mysqli_error($this->Link_ID);
$stat = is_object($this->Record);
if (!$stat) {
@mysqli_free_result($this->Query_ID);
$this->Query_ID = 0;
}
return $this->Record;
}
#
# Return the number of rows affected by a query
# (except insert and delete query)
#
function num_rows() {
return @mysqli_num_rows($this->Query_ID);
}
#
# Return the number of affected rows
# by a UPDATE, INSERT or DELETE query
#
function affected_rows() {
return @mysqli_affected_rows($this->Link_ID);
}
#
# Return the id of the last inserted element
#
function insert_id() {
return mysqli_insert_id($this->Link_ID);
}
#
# Seeking position
#
function data_seek($offset) {
return mysqli_data_seek($this->Link_ID, $offset);
}
#
# Retourne le resultat d'une requete qui ne veut avoir qu'un seul champ par ligne
#
function get_one_data($SQL, $field) {
$this->query($SQL) ;
$valSQL = $this->next_record() ;
return $valSQL[$field] ;
}
#
# Retourne la liste des tables d'une base
#
function list_tables($base) {
$result = $this->query(empty($base) ? 'SHOW TABLES' : "SHOW TABLES FROM `$base`");
$tables = array();
while (list($name) = $result->fetch_row()) {
$id = preg_replace("#^($prefix|$user_prefix)_#", '', $name);
$tables[$id] = $name;
}
$result->free();
return $tables ;
}
#
# Optimize a table
# $tbl_name : the name of the table
#
function optimize($tbl_name) {
$this->connect();
$this->Query_ID = mysqli_query("OPTIMIZE TABLE $tbl_name",$this->Link_ID);
}
#
# Free the memory used by a result
#
function clean_results() {
if($this->Query_ID != 0) {
mysqli_free_result($this->Query_ID);
}
}
#
# Close the link to the MySQL database
#
function close() {
if($this->Link_ID != 0) mysqli_close($this->Link_ID);
}
#
# Return list of table's fields
#
function get_field_list($tbl_name) {
$list_fields = mysqli_query("SHOW FIELDS FROM $tbl_name", $this->Link_ID);
while ($field_name = mysqli_fetch_array($list_fields)) {
$field_list[] = $field_name[0] ;
}
return $field_list ;
}
#
# Fetch all results and return an array with all results
#
function fetch_allResults($sql, $no_id = false, $field = false) {
$this->query($sql) ;
unset($return_array) ;
$i = 0 ;
if ( $this->num_rows() ) {
while ($val = $this->next_record() ) {
$return_array[$i++] = $val ;
}
@mysqli_free_result($this->Query_ID);
} else {
return false;
}
// If waiting for only one line in return, use this param
if ( $no_id ) {
if ( $field ) {
return $return_array[0][$field] ;
} else {
return $return_array[0] ;
}
} else {
return $return_array ;
}
}
}
?></code>
Et après, tu mets un fichier de conf que tu appelles avant la classe avec tes paramètres de connexion dedans :
<code>DEFINE ("SQL_HOST", "127.0.0.1");
DEFINE ("SQL_BDD", "le_nom_de_ta_base_dev");
DEFINE ("SQL_USER", "ton_user_mysql");
DEFINE ("SQL_PASSWORD", "ton_password");</code>
Tu vas voir, c'est du bonheur en boite après :)
23 mars 2009 21:26
Re! Merçi pour ses explications...
Re, oups dsl j'ai oublié d'enlever les "php" , tout ne s'est pas affiché!
-----------------------------------------------------------------------
Fichier"configuration.php" :
// Paramètres de connexion
$hostname_toto = "localhost"; // nom serveur
$database_toto = "toto"; // nom base de données
$username_toto = "root"; // nom utilisateur
$password_toto = ""; // mot de passe
$sql = mysql_connect($hostname_toto, $username_toto, $password_toto) or trigger_error(mysql_error(),E_USER_ERROR);
------------------------------------------
Ma base de donnée : toto
Table : table_toto
Champs:
ID
TITRE
DESCRIPTION
ARTICLES
----------------------------------------------------
Et voilà pour le plugin.capitals.php
require_once('connexion.php'); // Mon fichier de connexion.php relatif à ma base SQL
#@ Detect if loaded by search_engine
if ( ! SEARCHENGINE_LOADED ) return false;
#@ Category Name
$searchCat_name = 'Cities' ; //Je dois laisser Cities ?
#@ Do search
mysql_select_db($database_toto, $sql); // j'ai rajouté cette ligne pour établir la connexion est-ce que c'est ok ?
$sql = 'SELECT * FROM table_toto LIKE "%'.$search_engine['options']['input'].’%”
ORDER BY TITRE LIMIT 0, ‘.$search_engine['options']['search_limit'] ;
$db->query($sql) ;
while ( $val = $db->next_record() ) {
$results['value'] = utf8_encode($val['TITRE']). ‘ (’.utf8_encode($val['ARTICLES']).’);
$results['info'] = utf8_encode($val['DESCRIPTION']) ;
$search_engine['results'][$searchCat_name][$val[ID]] = $results ;
}
// J'ai remplacer les champs "Capital,code, et id par les champs de ma table
23 mars 2009 19:40
Re! Merçi pour ses explications...
Alors j'ai suivi tes indications mais je n'arrive toujours à faire fonctionner le moteur : et c'est normal puisque je n'arrive pas à établir ma connexion avec ma base de données Sql je pense.
Je m'y suis pris comme cela :
-----------------------------------------------------------------------
Fichier"configuration.php" :
------------------------------------------
Ma base de donnée : toto
Table : table_toto
Champs:
ID
TITRE
DESCRIPTION
ARTICLES
----------------------------------------------------
Et voilà pour le plugin.capitals.php
// Mon fichier de connexion.php relatif à ma base SQL
query($sql) ;
while ( $val = $db->next_record() ) {
$results['value'] = utf8_encode($val['TITRE']). ‘ (’.utf8_encode($val['ARTICLES']).’);
$results['info'] = utf8_encode($val['DESCRIPTION']) ;
$search_engine['results'][$searchCat_name][$val[ID]] = $results ;
}
// J'ai remplacer les champs "Capital,code, et id par les champs de ma table
?>
...Aucune connexion en vue : c'est sur il y a des erreurs au niveau de ma connexion SQL!
Désolé si je t'embête avec ce script. Je l'avoue je commence en php, j'y arrive quelque fois mais ça reste de la bidouille ^^
Merçi pour ton aide. @++
23 mars 2009 19:37
@Visual3D : pour simplifier un peu les choses, je vais prendre le fichier "plugin.capitals.php' :
Ce fichier comme il est dans le .zip se comporte en fait comme une base de donnée, je m'explique : la variable $country_list est en fait la base de donnée complète.
Si tu regardes Ligne 17, celle qui est commentée, c'est la requête sql que je fais en temps normal , requete que j'ai remplacé pour l'exemple par le tableau $country_list.
Donc en gros, tu fais ta requete sql qui cherche dans ta table mysql, tu fais une boucle sur les résultats et en gros, avec la classe mysql que j'utilise, ça donnerait ça :
<code>
#@ Detect if loaded by search_engine
if ( ! SEARCHENGINE_LOADED ) return false;
#@ Category Name
$searchCat_name = 'Cities' ;
#@ Do search
$sql = 'SELECT * FROM capitals LIKE "%'.$search_engine['options']['input'].'%"
ORDER BY capital
LIMIT 0, '.$search_engine['options']['search_limit'] ;
$db->query($sql) ;
while ( $val = $db->next_record() ) {
$results['value'] = utf8_encode($val['capital']). ' ('.utf8_encode($val['code']).')';
$results['info'] = utf8_encode($val['common_name']) ;
$search_engine['results'][$searchCat_name][$val[id]] = $results ;
}
</code>
Est-ce que tu comprends mieux comment utiliser un plugin maintenant ?
23 mars 2009 18:02
@Owen : to categorize the results, I use a special "info" field called 'plugin_header' which is interpreted in JS as a category.
23 mars 2009 17:46
Salut, je cherchais depuis un bout de temps un moteur de recherche en ajax et là! C'est parfait... Un grand merçi à toi.
J'ai pu l'intégrer à mon site (en cours de développement) et une question me turlupine : Le script cherche les données (cities & country) sur les deux fichiers php mais je voudrai qu'il cherche via une base de données mySql...
Débutant en php j'ai essayer d'établir une connexion SQL via les deux fichiers "plugin.capitals.php" et "country" mais rien n'y fait! Je m'y prend comme un pied ^^
Pourrai-tu m'éclairer ça serait sympa :) ?
En tous cas j'ai pu visiter ton site, il est super! Bravo et bonne continuation.
Bonne journée,
22 mars 2009 17:56
Good Work... Thanks!
13 mars 2009 04:41
Hi this looks like a really great plugin - just what I am after! Thanks for making this available.
I am new to jQuery and javascript in general, and there's something I don't understand...
Have you done anything special in the js code to make it categorize the results when using multiple plugins? Or is it just the server-side JSON/XML generation that is different to the standard BSN Autosuggest?
I cannot work it out from your code or your example download, sorry.
Thanks again,
Owen
12 mars 2009 15:58
@matt :
1/ I'm totatlly sorry to not offer the prestation you don't paid...
2/ I don't see how my sql development could be vague and unclear, because there is no sql in the example files...
3/ Please sleep before posting a message, or stop drinking...
Guiltouf
15 février 2009 17:49
Hi,
Your MySQL development is very vague and unclear.
It does not work as far as I can see. And you should be able to use a simple query with mysql_fetch_array.
Just simplify, update and be more in detail on your blog, very unclear to lots of people.
Thanks
Matt
13 février 2009 06:23
[...] to quickly search and select audio and video files in a database. You can download the code from web2ajax and read along to see how I implemented it into my project using a MySQL tables as the [...]
12 février 2009 21:36
Hi,
This is a great development !
Now I'm playing with the SQL query to query a Database I'm not able to parse anything when I have an array that should be usable.
Now you use the same, are you willing to share this information in some more detail with us ?
Thanks !
Matt
4 février 2009 00:42
[...] 24) FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for design, use jQuery as ajax framework and BSN Autosuggest libs. [...]
2 février 2009 20:44
[...] 16.2 FaceBook Like - jQuery and autosuggest Search Engine [...]
21 décembre 2008 07:21
Dear friend
i try u r answer but, i cant do it.
can u upload any code anywahere?
I dont want use array, i want filter from just mysql
Please help me.
Sory form my bad eng.
Thank u so much.
Adil Kara Said:
how do i use this example with mysql?
Cand u help me?
octobre 20th, 2008 at 10:53 Guiltouf Said:
Hi,
To use a mysql request to return results :
- do your request
- format the results in json like the page “http://web2ajax.fr/examples/facebook_searchengine/AjaxSearch/_doAjaxSearch.action.php?json=true&limit=8&input=je” I load in ajax
For example, I use this php class to encode an array in json : http://solarphp.com/class/Solar_Json
Hoping my answer will help you.
By
18 décembre 2008 09:01
[...] FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for design, use jQuery as ajax framework [...]
17 décembre 2008 06:12
i had the same problem. i used firebug and found the error to be "invalid flag after regular expression"
i've tried to solved it but in void, thinking that the problem must not lie in the codes itself. anyone help~
13 décembre 2008 09:02
great plugin! I have tried a few different ones but this one is the best I could find.
I just have one issue and was wondering if you were planning to have something like this in your code.
Basically I want to display all values and not limit the search. And then just display the values in a scrollable div. I have made the css changes to have a fixed height for the div and just have a overflow: auto. But the issue I am facing is that when you scroll through the list with up/down keys it does not scroll the list. So there needs to be something in javascript that tracks the selected item and scrolls the div relatively.
12 décembre 2008 02:54
@Interested Developer :
I'll just recommend you to use Firefox and his Firebug extension or the excellent Google Chrome to debug your dev.
IE does this so bad...
Once you installed Firebug, you'll see that the error message have more interests :)
Ciao.
5 décembre 2008 11:09
Hi,
I downloaded the code and uploaded it to my server. The page loads ok, but when I type into the input boxes I get the following javascript error:
-----------------------
Line: 154
Char: 2726
Error: Syntax error
Code: 0
URL:
-----------------------
Do you have any idea what might be causing the error?
Thanks
4 décembre 2008 21:28
[...] FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for [...]
30 novembre 2008 11:46
[...] 16.2 FaceBook Like - jQuery and autosuggest Search Engine [...]
23 novembre 2008 03:25
<strong>FaceBook Like - jQuery and autosuggest Search Engine...</strong>
FaceBook Like - jQuery and autosuggest Search Engine...
15 novembre 2008 07:59
[...] 16.2 FaceBook Like - jQuery and autosuggest Search Engine [...]
11 novembre 2008 02:21
[...] FaceBook Like - jQuery and autosuggest Search Engine (tags: jquery autosuggest search autocomplete plugin) [...]
7 novembre 2008 07:02
[...] FaceBook Like - jQuery and autosuggest Search Engine [...]
4 novembre 2008 11:03
[...] FaceBook Like - jQuery and autosuggest Search Engine [...]
4 novembre 2008 10:16
You rox man !!!
Superb plugin!
3 novembre 2008 22:39
[...] 16.2 FaceBook Like - jQuery and autosuggest Search Engine [...]
3 novembre 2008 22:03
[...] 16.2 FaceBook Like - jQuery and autosuggest Search Engine [...]
3 novembre 2008 07:51
Dear friend
i try u r answer but, i cant do it.
can u upload any code anywahere?
I dont want use array, i want filter from just mysql
Please help me.
Sory form my bad eng.
Thank u so much.
Adil Kara Said:
how do i use this example with mysql?
Cand u help me?
octobre 20th, 2008 at 10:53 Guiltouf Said:
Hi,
To use a mysql request to return results :
- do your request
- format the results in json like the page “http://web2ajax.fr/examples/facebook_searchengine/AjaxSearch/_doAjaxSearch.action.php?json=true&limit=8&input=je” I load in ajax
For example, I use this php class to encode an array in json : http://solarphp.com/class/Solar_Json
Hoping my answer will help you.
By
26 octobre 2008 17:39
@Mike :
I'm sorry but for moment I don't understand your needs :(
If you have no need for an input, did you really want an autocomplete plugin ?
Perhaps you need a combobox rather ?
But as i said, i'm not sure to imagine what you think about... So tell me more :)
23 octobre 2008 23:58
Merci Nicolas, même si je n'ai pas trop eu le temps de poster en ce moment...
Mais je vais bientôt me rattraper, ne vous inquietez pas :)
23 octobre 2008 23:49
c'est souvent très sympa dev visiter ton bllg ;)
23 octobre 2008 16:17
I'm not sure I follow. I'm trying to make the request to my php page only one time when the document loads. So I have no need for an "input" parameter either. I understand how to use the $.get and assign the resulting json to a variable, but how do I inject that into the list?
23 octobre 2008 05:25
@Mike : Yes you can and you have two ways :
1/ You generate a js file with php and load it in your headers
<script language="javascript1.4" type="text/javascript" src="/your_array.js"></script>
2/ The other solution is calling a js file after the autocomplete loading with $.get and in the success trigger, you assign the result of the js to a var
In those two cases, look in the example that is exactly what I do.
Ciao.
22 octobre 2008 09:09
Is there anyway to "preload" the data without the user having to type anything first. So right when he starts typing, the data is available instantly?
22 octobre 2008 03:16
Hi,
To use a mysql request to return results :
- do your request
- format the results in json like the page "http://web2ajax.fr/examples/facebook_searchengine/AjaxSearch/_doAjaxSearch.action.php?json=true&limit=8&input=je" I load in ajax
For example, I use this php class to encode an array in json : http://solarphp.com/class/Solar_Json
Hoping my answer will help you.
Bye
20 octobre 2008 13:54
how do i use this example with mysql?
Cand u help me?
20 octobre 2008 10:53
This a very Good Script for the webmasters thanks for this.
Deepak Oberoi
http;//www.expertzweb.com
12 octobre 2008 12:27
[...] Facebook like Autocomplete [...]
12 octobre 2008 09:01
[...] FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for [...]
11 octobre 2008 20:48
[...] FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for [...]
12 septembre 2008 04:19
Hi,
Thanks for this great plugin. However I'm having some troubles implementing it on my server.
I managed to get the results from my MySQL DB, however in the process I lost the division between the "country's and capitals".
The division is the grey box in the search results that nicely separates the different type of results.
Could you point me into the direction of which part of the code handles the seperation?
Thanx alot!
Geert
6 septembre 2008 10:19
Félicitations, très joli et efficace!!
J'aurais besoin d'une petite personnalisation de ce module...
Pouvez-vous me contacter pour en discuter?
Salut!
2 septembre 2008 17:23
[...] Autosuggest search engineSuggest form field values the Facebook way. [...]
19 août 2008 04:46
En fet je quoi avoir trouvé le probleme, je n'ai pas de json sur php4 :)
24 juillet 2008 12:56
I have download the example but it didnt work. Can you upload another examplo with sql?
1 juillet 2008 02:23
Great work!
11 juin 2008 17:35
[...] FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest see engine is inspired from facebook for design, ingest jQuery as ajax support [...]
6 mai 2008 10:03
[...] FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest see engine is inspired from facebook for design, ingest jQuery as ajax support [...]
6 mai 2008 10:03
Thanks for the comments. You've got a pretty useful site here so keep it up!
11 avril 2008 17:22
[...] FaceBook Like - jQuery and autosuggest Search Engine, Masked Input Plugin, jQuery Enchant, EasyDrag jQuery Plugin, Simple Effects Plugins y Slide out [...]
11 avril 2008 12:53
[...] FaceBook Like - jQuery and autosuggest Search Engine- 一个类似于Facebook的搜索引擎,主要的特点就是搜索时的自动提示 使用 [...]
10 avril 2008 08:54
[...] FaceBook Like - jQuery and autosuggest Search Engine- This autosuggest search engine is inspired from facebook for design, use jQuery as ajax framework [...]
9 avril 2008 18:00
Dynamically add rows with Autosuggest enabled for textboxes using http://ramanbasu.com/tricks/DynamicRow/
1 avril 2008 19:34
Thanks !
Greatful design for your website and good luck !
7 mars 2008 11:48
I love it, and will spend some time digest it :)
7 mars 2008 03:32
very good
1 mars 2008 14:21
[...] FaceBook Like - jQuery and autosuggest Search Engine [...]
27 février 2008 21:08
[...] Blackprof.com â
7 février 2008 07:20
good work!
6 février 2008 23:06
Good work man!
6 février 2008 08:22
You rock fuckin' hard baby
5 février 2008 17:51
Very nice! Good work.
5 février 2008 16:58