[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / exec / rechercher_auteur.php
diff --git a/www/ecrire/exec/rechercher_auteur.php b/www/ecrire/exec/rechercher_auteur.php
new file mode 100644 (file)
index 0000000..be0a3e6
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+/***************************************************************************\
+ *  SPIP, Systeme de publication pour l'internet                           *
+ *                                                                         *
+ *  Copyright (c) 2001-2011                                                *
+ *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
+ *                                                                         *
+ *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
+ *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
+\***************************************************************************/
+
+if (!defined('_ECRIRE_INC_VERSION')) return;
+
+# gerer un charset minimaliste en convertissant tout en unicode &#xxx;
+
+// http://doc.spip.org/@exec_rechercher_auteur_dist
+function exec_rechercher_auteur_dist()
+{
+       exec_rechercher_auteur_args(_request('idom'));
+}
+
+// http://doc.spip.org/@exec_rechercher_auteur_args
+function exec_rechercher_auteur_args($idom)
+{
+       if (!preg_match('/\w+/',$idom))
+             {
+               include_spip('inc/minipres');
+               echo minipres();
+             } else {
+               include_spip('inc/actions');
+               $where = preg_split(",\s+,", _request('nom'));
+               if ($where) {
+                 foreach ($where as $k => $v) 
+                       $where[$k] = "'%" . substr(str_replace("%","\%", sql_quote($v)),1,-1) . "%'";
+                 $where= ("(nom LIKE " . join(" AND nom LIKE ", $where) . ")");
+               }
+               include_spip('inc/selectionner_auteur');
+               ajax_retour(selectionner_auteur_boucle($where, $idom));
+       }
+}
+?>