[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / inc / informer_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 # Les informations sur un auteur selectionne dans le mini navigateur
16
17 // http://doc.spip.org/@inc_informer_auteur_dist
18 function inc_informer_auteur_dist($id)
19 {
20 global $spip_display,$spip_lang_right ;
21
22 include_spip('inc/presentation');
23 include_spip('inc/formater_auteur');
24
25 $row = sql_fetsel("*", "spip_auteurs", "id_auteur = $id");
26 if ($row) {
27 $nom = typo($row["nom"]);
28 $bio = propre($row["bio"]);
29 $mail = formater_auteur_mail($row, $id);
30 $nb = sql_countsel("spip_auteurs_articles", "id_auteur=$id");
31 if ($nb > 1)
32 $nb = $nb . "&nbsp;" . _T('info_article_2');
33 else if($nb == 1)
34 $nb = "1&nbsp;" . _T('info_article');
35 else $nb = "&nbsp;";
36 } else {
37 $nom = "<span style='color:red'>"
38 . _T('texte_vide')
39 . '</span>';
40 $bio = $mail = $nb = '';
41 }
42 $res = '';
43 if ($spip_display != 1 AND $spip_display!=4 AND $GLOBALS['meta']['image_process'] != "non") {
44 $chercher_logo = charger_fonction('chercher_logo', 'inc');
45 if ($res = $chercher_logo($id, 'id_auteur', 'on')) {
46 list($fid, $dir, $n, $format) = $res;
47 include_spip('inc/filtres_images_mini');
48 $res = image_reduire("<img src='$fid' alt='' />", 100, 48);
49 if ($res)
50 $res = "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>$res</div>";
51 }
52 }
53
54 return "<div class='informer-auteur'>"
55 . (!$res ? '' : $res)
56 . "<div><a href='"
57 . generer_url_ecrire('auteur_infos', "id_auteur=$id")
58 . "'>"
59 . bonhomme_statut($row)
60 . "</a> "
61 . $mail
62 . " <b>"
63 . $nom
64 . "</b><br />"
65 . $nb
66 . "</div><br />"
67 . "<div>$bio</div>"
68 . "</div>";
69 }
70 ?>