Changeset 95879 in spip-zone
- Timestamp:
- Mar 9, 2016, 11:00:36 AM (5 years ago)
- Location:
- _plugins_/statistiques_objets/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/statistiques_objets/trunk/paquet.xml
r95878 r95879 2 2 prefix="statsobjets" 3 3 categorie="statistique" 4 version="1.0. 2"4 version="1.0.3" 5 5 etat="dev" 6 6 compatibilite="[3.0.0;3.1.*]" … … 21 21 <pipeline nom="formulaire_traiter" inclure="statsobjets_pipelines.php" /> 22 22 <pipeline nom="formulaire_admin" inclure="statsobjets_pipelines.php" /> 23 <pipeline nom="boite_infos" inclure="statsobjets_pipelines.php" /> 23 24 24 25 </paquet> -
_plugins_/statistiques_objets/trunk/statsobjets_pipelines.php
r95878 r95879 151 151 include_spip('inc/config'); 152 152 include_spip('base/objets'); // au cas où 153 $tables_objets = lire_config('activer_statistiques_objets', array());153 $tables_objets_configures = lire_config('activer_statistiques_objets', array()); 154 154 $table_objet_sql = table_objet_sql($objet); 155 155 $id_table_objet = id_table_objet($objet); 156 156 157 if ($GLOBALS['meta']["activer_statistiques"] != "non" 157 if ( 158 $GLOBALS['meta']["activer_statistiques"] == "oui" 158 159 and $objet != 'article' 159 and in_array($table_objet_sql, $tables_objets )160 and in_array($table_objet_sql, $tables_objets_configures) 160 161 and objet_test_si_publie($objet, $id_objet) === true 161 162 and !$var_preview … … 187 188 return parametre_url(generer_url_ecrire('stats_visites', "objet=$objet"), 'id_objet', $id_objet); 188 189 } 190 191 192 /** 193 * Afficher le lien vers la page de statistique sur la vue d'un objet dans l'espace privé (sauf les articles) 194 * 195 * @pipeline boite_infos 196 * @param array $flux Données du pipeline 197 * @return array Données du pipeline 198 */ 199 function statsobjets_boite_infos($flux) { 200 201 include_spip('inc/config'); 202 include_spip('base/objets'); // au cas où 203 $tables_objets_configures = lire_config('activer_statistiques_objets', array()); 204 205 if ( 206 $GLOBALS['meta']["activer_statistiques"] == "oui" 207 and isset($flux['args']['type']) 208 and $objet = $flux['args']['type'] 209 and isset($flux['args']['id']) 210 and $id_objet = intval($flux['args']['id']) 211 ) { 212 $table_objet_sql = table_objet_sql($objet); 213 $id_table_objet = id_table_objet($objet); 214 if ( 215 $objet != 'article' 216 and in_array($table_objet_sql, $tables_objets_configures) 217 and autoriser('voirstats', $objet, $id_objet) 218 ){ 219 $visites = sql_getfetsel('visites', $table_objet_sql, $id_table_objet.'='.intval($id_objet)); 220 if ($visites > 0) { 221 $icone_horizontale = chercher_filtre('icone_horizontale'); 222 $flux['data'] .= $icone_horizontale( 223 parametre_url(generer_url_ecrire('stats_visites', "objet=$objet"), 'id_objet', $id_objet), 224 _T('statistiques:icone_evolution_visites', array('visites' => $visites)), 225 "statistique-24.png" 226 ); 227 } 228 } 229 } 230 231 return $flux; 232 }
Note: See TracChangeset
for help on using the changeset viewer.