Esempio n. 1
0
function af_ela_generate_tags()
{
    global $tag, $tags, $settings, $paged_post, $fade;
    $tag_list = '';
    $tagged_posts = $tags[0][0];
    $posted_tags = $tags[0][1];
    foreach ($tags as $t => $p) {
        if ($p[2]) {
            if ($p[0] == $tag) {
                $paged_post = $p[2];
                $current = ' class="' . $settings['selected_class'] . '"';
                $current_text = $settings['selected_text'] == '' ? '' : ' ' . $settings['selected_text'];
            } else {
                $current = '';
                $current_text = '';
            }
            if ($settings['num_entries_tagged'] == 1) {
                $num = ' ' . str_replace('%', $p[2], $settings['number_text_tagged']);
            }
            $tag_weight = $p[2] / $posted_tags * 100;
            $utwClass = new UltimateTagWarriorCore();
            $tag_weightcolor = $utwClass->GetColorForWeight($tag_weight);
            $tag_weightfontsize = $utwClass->GetFontSizeForWeight($tag_weight);
            $tag_display = str_replace('_', ' ', $p[1]);
            $tag_display = str_replace('-', ' ', $tag_display);
            $tag_display = str_replace('+', ' ', $tag_display);
            $tag_display = strtolower($tag_display);
            $tag_list .= <<<END_TEXT
<li id="{$settings['id']}-tag-{$p['0']}"{$current}><font style="font-size: {$tag_weightfontsize} !important; color: {$tag_weightcolor} !important">{$tag_display}{$num}{$current_text}</font></li> 

END_TEXT;
        }
    }
    $tag_list = <<<END_LIST
<ul id="{$settings['id']}-tag"{$fade['tag']}>
{$tag_list}</ul>
END_LIST;
    return $tag_list;
}