Bonjour,
je met le code le bloc sumatags visible sur mon site. Je l'ai amélioré pour un affichage multicolor.
<?php
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
global $prefix;
//muß nicht:
$mxblockcache = TRUE;
//maximale tags anzeigen
$max_tags = 50;
//soll der block als center block?
$centerblock_ = true;
$content = ' <br>';
$q = "SELECT * FROM ".$prefix."_sumatagged_keywords
ORDER BY RAND(), keyword, count_hits DESC, RAND() LIMIT ".$max_tags;
$result = sql_query($q);
$umbr_ = 0;
while ($row = sql_fetch_array($result) )
{
$umbr_++;
if($centerblock_ ===FALSE && $umbr_ >2)
{
$content .='<br>';
$umbr_ =0;
}
$f_size = intval($row['count_hits']);
$tab_colors=array("#ff9900","#99cc00","#3366cc","#9EA0AB");
$color=rand(0,count($tab_colors)-1);
if($f_size < 8)$f_size = 9;
if($f_size > 29)$f_size = 30;
if($centerblock_ ===FALSE && $f_size > 14)$f_size= 14;
if($centerblock_ ===FALSE){
$kwd_str = mxCutString(strip_tags($row['keyword']),9, $add = "...", $cutter = " ");
}else{
$kwd_str = strip_tags($row['keyword']);
}
$content .= '<a href="modules.php?name=Tags&op=tagged&as='.strip_tags(urlencode($row['keyword'])).'"
style="text-decoration:none;font-size:'.$f_size.'px;color:'.$tab_colors[$color].';" rel="tag" title="'.strip_tags($row['keyword']).'">'.$kwd_str.'...</a> ';
}
$content .= ' <b><a href="modules.php?name=Tags">plus...</a></b>';
?>
Pour changer les couleurs modifier les codes couleur dans cette ligne
$tab_colors=array("#ff9900","#99cc00","#3366cc","#9EA0AB");
Phil