X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fexec%2Fstatistiques_repartition.php;fp=www%2Fecrire%2Fexec%2Fstatistiques_repartition.php;h=fc442935fbd99651a13b92febe7aab48599683d0;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c diff --git a/www/ecrire/exec/statistiques_repartition.php b/www/ecrire/exec/statistiques_repartition.php new file mode 100644 index 0000000..fc44293 --- /dev/null +++ b/www/ecrire/exec/statistiques_repartition.php @@ -0,0 +1,174 @@ +0 OR $nombre_abs[$id_rubrique]>0){ + $largeur_rouge = floor(($nombre_vis[$id_rubrique] - $nombre_abs[$id_rubrique]) * $taille / $abs_total); + $largeur_vert = floor($nombre_abs[$id_rubrique] * $taille / $abs_total); + + if ($largeur_rouge+$largeur_vert>0){ + + if ($niveau == 0) { + $couleur="#cccccc"; + } + + else if ($niveau == 1) { + $couleur="#eeeeee"; + } + else { + $couleur="white"; + } + echo ""; + echo "\n"; + echo "\n"; + + + if ($niveau==0 OR 1==1){ + $pourcent = round($nombre_vis[$id_rubrique]/$abs_total*1000)/10; + echo "\n"; + } + else { echo ""; } + + + echo "\n
"; + + + if ( $largeur_rouge > 2) + echo bouton_block_depliable("$titre","incertain", "stats$id_rubrique"); + else + echo "
", + "$titre", + "
"; + echo "
$pourcent%"; + + + echo "\n"; + echo "\n"; + if ($gauche > 0) echo ""; + echo "\n
"; + echo "
"; + if ($visites_abs > 0) echo " "; + if ($largeur_rouge>0) echo " "; + if ($largeur_vert>0) echo " "; + echo "
"; + echo "
\n"; + echo "
"; + } + } + + if (isset($largeur_rouge) && ($largeur_rouge > 0)) { + $niveau++; + echo debut_block_depliable(false,"stats$id_rubrique"); + enfants_aff($id_rubrique,$largeur_rouge, $critere, $visites_abs+$gauche); + echo fin_block(); + $niveau--; + } + $visites_abs = $visites_abs + round($nombre_vis[$id_rubrique]/$abs_total*$taille); + } +} + +// http://doc.spip.org/@exec_statistiques_repartition_dist +function exec_statistiques_repartition_dist() +{ + + global $abs_total, $nombre_vis, $taille, $spip_ecran; + + if (!autoriser('voirstats')) { + include_spip('inc/minipres'); + echo minipres(); + } else { + + $taille = _request('taille'); + $commencer_page = charger_fonction('commencer_page', 'inc'); + echo $commencer_page(_T('titre_page_statistiques'), "statistiques_visites", "repartition"); + + echo debut_grand_cadre(true); + echo gros_titre(_T('titre_page_statistiques'),'',false); + if ($spip_ecran == "large") { + $largeur_table = 974; + $taille = 550; + } else { + $largeur_table = 750; + $taille = 400; + } + + echo "\n

"; + $critere = _request('critere'); + if ($critere == "debut") { + $critere = "visites"; + echo barre_onglets("stat_depuis", "debut"); + } + else { + $critere = "popularite"; + echo barre_onglets("stat_depuis", "popularite"); + } + + $abs_total=enfants(0, $critere); + if ($abs_total<1) $abs_total=1; + $nombre_vis[0] = 0; + + echo debut_cadre_relief("statistiques-24.gif",true); + echo "
"; + enfants_aff(0,$taille, $critere); + echo "

", + "
", + _T('texte_signification'), + "
"; + echo fin_cadre_relief(true); + echo "
"; + echo fin_grand_cadre(true),fin_page(); + } +} +?>