[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / exec / rechercher_auteur.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15 # gerer un charset minimaliste en convertissant tout en unicode &#xxx;
16
17 // http://doc.spip.org/@exec_rechercher_auteur_dist
18 function exec_rechercher_auteur_dist()
19 {
20 exec_rechercher_auteur_args(_request('idom'));
21 }
22
23 // http://doc.spip.org/@exec_rechercher_auteur_args
24 function exec_rechercher_auteur_args($idom)
25 {
26 if (!preg_match('/\w+/',$idom))
27 {
28 include_spip('inc/minipres');
29 echo minipres();
30 } else {
31 include_spip('inc/actions');
32 $where = preg_split(",\s+,", _request('nom'));
33 if ($where) {
34 foreach ($where as $k => $v)
35 $where[$k] = "'%" . substr(str_replace("%","\%", sql_quote($v)),1,-1) . "%'";
36 $where= ("(nom LIKE " . join(" AND nom LIKE ", $where) . ")");
37 }
38 include_spip('inc/selectionner_auteur');
39 ajax_retour(selectionner_auteur_boucle($where, $idom));
40 }
41 }
42 ?>