Changeset 93641 in spip-zone for _core_/plugins/grenier/inc/formater_auteur.php
- Timestamp:
- Dec 13, 2015, 2:41:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_core_/plugins/grenier/inc/formater_auteur.php
r89285 r93641 29 29 30 30 // http://code.spip.net/@inc_formater_auteur_dist 31 function inc_formater_auteur_dist($id_auteur, $row =NULL) {31 function inc_formater_auteur_dist($id_auteur, $row = null) { 32 32 33 33 global $connect_id_auteur, $connect_statut; … … 35 35 $id_auteur = intval($id_auteur); 36 36 37 if ($row ===NULL)37 if ($row === null) 38 38 $row = sql_fetsel("*, " . sql_date_proche('en_ligne', -15, 'DAY') . " AS ici", "spip_auteurs", "id_auteur=$id_auteur"); 39 39 40 40 $vals = array(); 41 41 $statut = $row['statut']; 42 $href = generer_url_ecrire("auteurs", "statut=$statut");42 $href = generer_url_ecrire("auteurs", "statut=$statut"); 43 43 $vals[] = "<a href='$href'>" . bonhomme_statut($row) . '</a>'; 44 44 45 if (($id_auteur == $connect_id_auteur) OR!$row['ici'])46 $vals[] = ' ';47 else $vals[] = formater_auteur_mail($row, $id_auteur);45 if (($id_auteur == $connect_id_auteur) or !$row['ici']) 46 $vals[] = ' '; 47 else $vals[] = formater_auteur_mail($row, $id_auteur); 48 48 49 49 if (!$nom = typo($row['nom'])) … … 52 52 53 53 $chercher_logo = ($spip_display != 1 54 AND$spip_display != 455 AND$GLOBALS['meta']['image_process'] != "non")54 and $spip_display != 4 55 and $GLOBALS['meta']['image_process'] != "non") 56 56 ? charger_fonction('chercher_logo', 'inc') 57 57 : false; 58 58 59 59 if ($chercher_logo 60 AND$logo = $chercher_logo($id_auteur, 'id_auteur', 'on')) {60 and $logo = $chercher_logo($id_auteur, 'id_auteur', 'on')) { 61 61 list($fid) = $logo; 62 62 include_spip('inc/filtres_images_mini'); 63 63 $logo = image_reduire("<img src='$fid' alt='' style='float:right;' />", 26, 20); 64 64 } 65 else $logo = '';65 else $logo = ''; 66 66 67 67 $vals[] = "<a href='" … … 74 74 75 75 $vals[] = !$url ? " " 76 : "<a href='$url'>".couper(sinon(typo($row['nom_site']), $row["url_site"]), 30)."</a>";76 : "<a href='$url'>".couper(sinon(typo($row['nom_site']), $row["url_site"]), 30)."</a>"; 77 77 78 78 $contributions = array(); 79 79 if (autoriser('modifier', 'auteur', $id_auteur, $row)) { 80 $in = sql_in('statut', 80 $in = sql_in('statut', 81 81 ($connect_statut == "0minirezo" 82 82 ? array('prepa', 'prop', 'publie', 'refuse') 83 83 : array('prop', 'publie'))); 84 84 if ($cpt = sql_countsel("spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (A.id_article=L.id_objet AND objet='article')", "L.id_auteur=$id_auteur AND $in")){ 85 $contributions[] = ($cpt >1?$cpt.' '._T('info_article_2'):_T('info_1_article'));85 $contributions[] = ($cpt > 1?$cpt.' '._T('info_article_2'):_T('info_1_article')); 86 86 } 87 87 } 88 88 89 $contributions = pipeline('compter_contributions_auteur', array('args'=>array('id_auteur'=>$id_auteur,'row'=>$row),'data'=>$contributions));89 $contributions = pipeline('compter_contributions_auteur', array('args' => array('id_auteur' => $id_auteur, 'row' => $row), 'data' => $contributions)); 90 90 91 $vals[] = (is_array($contributions) AND count($contributions))?implode('<br />',$contributions):" ";91 $vals[] = (is_array($contributions) and count($contributions))?implode('<br />', $contributions):" "; 92 92 93 93 return $vals; … … 101 101 102 102 if ($row['imessage'] != 'non' 103 AND$GLOBALS['meta']['messagerie_agenda'] != 'non')104 $href = generer_action_auteur("editer_message", "normal/$id_auteur");105 else 106 ANDautoriser('voir', 'auteur', $id_auteur))103 and $GLOBALS['meta']['messagerie_agenda'] != 'non') 104 $href = generer_action_auteur("editer_message", "normal/$id_auteur"); 105 elseif (strlen($row['email']) 106 and autoriser('voir', 'auteur', $id_auteur)) 107 107 $href = 'mailto:' . $row['email']; 108 108 else return ''; … … 112 112 . "\" class='message'> </a>"; 113 113 } 114 ?>
Note: See TracChangeset
for help on using the changeset viewer.