July. 26th, 2006 13:25 by
Stéphane de Luca —
Permalink | TrackBack: https://stephanedeluca.com/trackback/345 — updated on Apr. 25th, 2019 16:03 exists for 18 years & 4 months ago -
.$object = "
Here we discuss about the following topics, each indexed with a collection of tags. The bigger the tag size, the more popular. Just click on the appropriate tag to display all related articles.
";
/* ---- PARTIALS ------ */
$common = "
";
$query = "
SELECT tag, count AS size
FROM tags
WHERE site_id='".Webengine::$site['ID']."'
GROUP BY tag
ORDER BY tag DESC
";
$tags = $db->selectAllRows($query);
$maxSize = 0;
foreach ( $tags as $tag ) {
if ($tag[size]>$maxSize) $maxSize = $tag[size];
//$total += $tag[size];
}
reset($tags);
foreach ( $tags as $tag ) {
if ($tag[size] <= 0) continue;
$r = tagWeight($tag[size], $maxSize);
if (!$r) continue;
$weight = $r[weight];
$size = $r[size];
$easeOut = $r[easeOut];
$percent = $r[percent];
$selected = (strtolower($selectedTag)==strtolower($tag[tag])) ? " is-danger":"";
$common.= sprintf("
$tag[tag] ",$percent);
/*
if ($tag[size] == 0) continue;
$norm = $tag[size]/$maxsize;
$percent = 100*$norm;
//$size = (int)(200+200.0*exp(20*$norm));
$size = max(200,(int)(900*$norm));
$title = $percent < 0.1 ? "<0.1%" : sprintf("%.001f %%", $percent);
$common.= "
$tag[tag] ";
*/
}
$common .="
";
/* ------------*/
$object.= $common;