[ Index ]
 

Code source de SPIP 1.9.2c

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ecrire/inc/ -> informer_auteur.php (source)

   1  <?php
   2  
   3  /***************************************************************************\
   4   *  SPIP, Systeme de publication pour l'internet                           *
   5   *                                                                         *
   6   *  Copyright (c) 2001-2007                                                *
   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 $couleur_foncee,$spip_display,$spip_lang_right ;
  21  
  22      include_spip('inc/presentation');
  23      include_spip('inc/formater_auteur');
  24  
  25      $res = spip_query("SELECT * FROM spip_auteurs WHERE id_auteur = $id");
  26      if ($row = spip_fetch_array($res)) {
  27              $nom = typo(extraire_multi($row["nom"]));
  28              $bio = propre($row["bio"]);
  29              $mail = formater_auteur_mail($row, $id);
  30              $nb = spip_fetch_array(spip_query("SELECT COUNT(*) AS n FROM spip_auteurs_articles WHERE id_auteur=$id"));
  31              if ($nb['n'] > 1)
  32              $nb = $nb['n']."&nbsp;"._T('info_article_2');
  33              else if($nb['n'] == 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');
  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='arial2' style='padding: 5px; background-color: white; border: 1px solid $couleur_foncee; border-top: 0px;'>"
  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  ?>


Généré le : Wed Nov 21 10:20:27 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics