Changeset 51417 in spip-zone
- Timestamp:
- Sep 14, 2011, 7:06:07 PM (8 years ago)
- Location:
- _plugins_/cumulus
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/cumulus/cumulus_fonctions.php
r31328 r51417 3 3 //juste pour E dans l'O 4 4 function oeuf($str){ 5 $pattern = "( Î|Ï|Œ)";5 $pattern = "(Œ|œ|Œ)"; 6 6 7 7 if($str!="") { … … 17 17 } 18 18 19 20 /* 21 * +----------------------------------+ 22 * Nom des Filtres : noop, filtre_max, coef et repeat 23 * +----------------------------------+ 24 * Date : 23 Mars 2005 25 * Auteur : Pierre Andrews (mortimer.pa@free.fr) 26 * +-------------------------------------+ 27 * Fonctions de ces filtres : ces filtres permettent 28 * de faire un affichage variant en fonction de l'importance 29 * de l'objet. Vois la contrib pour plus d'informations. 30 * +-------------------------------------+ 31 * 32 * Pour toute suggestion, remarque, proposition d'ajout 33 * reportez-vous au forum de l'article : 34 * http://www.spip_contrib.net/article.php3?id_article=879 35 */ 36 37 function noop($texte) { 38 return ''; 39 } 40 41 function filtre_max($texte, $id='tout') { 42 static $max = array(); 43 if($max[$id] < $texte) { 44 $max[$id] = $texte; 45 } 46 return $max[$id]; 47 } 48 49 function coef($max,$nbr,$nbrMax=6) { 50 return 1+($nbr/$max*$nbrMax); 51 } 52 53 function repeat($nombre,$texte,$avant,$apres,$min = 0) { 54 if($nombre > $min) { 55 for($i=0;$i < $nombre;$i++) { 56 $texte = $avant.$texte.$apres; 57 } 58 return $texte; 59 } else 60 return ''; 61 } 19 62 ?> -
_plugins_/cumulus/nuage_popularite.xml.html
r51414 r51417 1 [(#HTTP_HEADER{Content-type: text/xml[; charset=(#CHARSET)]})] <tags>1 [(#HTTP_HEADER{Content-type: text/xml[; charset=(#CHARSET)]})][(#SET{notid,[(#CONFIG{cumulus/groupes_mots_exclus}|sinon{#ARRAY}|implode{|}|sinon{-1})]})]<tags> 2 2 #SET{max,0} 3 <BOUCLE_maxmot(MOTS){id_groupe!==^((# ENV{notid,-1}))$}>3 <BOUCLE_maxmot(MOTS){id_groupe!==^((#GET{notid,-1}))$}> 4 4 #SET{pop,0} 5 5 <BOUCLE_pop(ARTICLES) {id_mot}> … … 11 11 </BOUCLE_maxmot> 12 12 13 <BOUCLE_tags(MOTS){id_groupe!==^((# ENV{notid,-1}))$} {par num titre,titre}>13 <BOUCLE_tags(MOTS){id_groupe!==^((#GET{notid,-1}))$} {par num titre,titre}> 14 14 #SET{pop,0} 15 15 <BOUCLE_popularite(ARTICLES) {id_mot}> … … 17 17 </BOUCLE_popularite> 18 18 [(#GET{pop}|>{0}|oui) 19 <a href="#URL_MOT" rel="tag" title="[(#GET{pop})/#GET{max}]" style="font-size:[(#EVAL{#GET{max}/#GET{pop}+6}|round)]pt">[(#TITRE|texte_backend|oeuf)]</a> 19 [(#SET{poids,[(#EVAL{#GET{max}/#GET{pop}+80})]})] 20 <a href="#URL_MOT" rel="tag" title="[(#GET{pop})/#GET{max}]" style="font-size:[(#GET{poids}|unique|filtre_max{doc}|coef{[(#GET{poids})],350}|sqrt|ceil)]pt">[(#TITRE|texte_backend|oeuf)]</a> 20 21 ] 22 21 23 </BOUCLE_tags> 22 24 </B_tags>
Note: See TracChangeset
for help on using the changeset viewer.