Exemple #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;
}
Version: 3.14159265
Author: Christine Davis
Author URI: http://www.neato.co.nz
*/
/* Maybe you'll need this.. maybe you won't...
$path = ini_get('include_path');
if (!(substr($path, strlen( $path ) - strlen(PATH_SEPARATOR)) === PATH_SEPARATOR)) {
	$path .= PATH_SEPARATOR;
}
$path .= $_SERVER['DOCUMENT_ROOT'] . "/wp-content/plugins/UltimateTagWarrior";
ini_set("include_path", $path);
*/
require_once 'ultimate-tag-warrior-core.php';
require_once 'ultimate-tag-warrior-actions.php';
load_plugin_textdomain('ultimate-tag-warrior', 'wp-content/plugins/UltimateTagWarrior/languages');
$utw = new UltimateTagWarriorCore();
$utw->CheckForInstall();
function UTW_ShowTagsForCurrentPost($formattype, $format = "", $limit = 0)
{
    global $utw, $post;
    $format = $utw->GetFormat($formattype, $format);
    $utw->ShowTagsForPost($post->ID, $format, $limit);
}
function UTW_ShowRelatedTagsForCurrentPost($formattype, $format = "", $limit = 0)
{
    global $utw, $post;
    $format = $utw->GetFormat($formattype, $format);
    $utw->ShowRelatedTags($utw->GetTagsForPost($post->ID), $format, $limit);
}
function UTW_ShowRelatedPostsForCurrentPost($formattype, $format = "", $limit = 0)
{