/**
 * Print out the tag page for any given tag. Returns the output as HTML.
 *
 * @param string $tag
 * @return string
 */
function printTag($tag)
{
    global $PIVOTX;
    $tag = normalizeTag($tag);
    // If the hook for the thickbox includes in the header was not yet
    // installed, do so now..
    $PIVOTX['extensions']->addHook('after_parse', 'callback', 'jqueryIncludeCallback');
    if ($PIVOTX['config']->get('tag_fetcher_enabled') == 1) {
        //$para_weblog = "?w=".para_weblog($Current_weblog);
        $output = '            <script type="text/javascript">
            /*<![CDATA[ */
            function doList(type, tag)  {
                jQuery("#tgrrsslist").html(\'<img src="' . $PIVOTX['paths']['pivotx_url'] . 'pics/loadingAnimation.gif" alt=""/>\');
                var url = "' . $PIVOTX['paths']['pivotx_url'] . 'ajaxhelper.php?function=getTagFeed";
                jQuery.get( url, { type: type, tag: tag }, function(output) { jQuery("#tgrrsslist").html(output); } );
            }
            /* ]]> */
            </script>
        ';
    }
    $output .= "<div id='tagpage'>\n<h2>" . __('Tag overview for: ') . " '" . str_replace("+", " ", $tag) . "'</h2>\n\n";
    $output .= "<h3>" . __('Entries on this site with ') . " '" . str_replace("+", " ", $tag) . "'</h3>\n\n";
    $output .= getEntriesWithTag($tag);
    $output .= "<h3>" . __('Related tags') . "</h3>\n\n";
    $output .= getRelatedTags($tag);
    if ($PIVOTX['config']->get('tag_fetcher_enabled') == 1) {
        $output .= "\n<div id='feedfetcher'>\n";
        $output .= "<h3>" . __('External feeds for') . " '" . str_replace("+", " ", $tag) . "'</h3>\n\n";
        $output .= "<p>\n" . __('Click icon for a list of links on') . " '" . str_replace("+", " ", $tag) . "'</p>\n<p id='tagbuttons'>\n";
        $sites = array('delicious' => 'Delicious ', 'google' => 'Google', 'icerocket' => 'Icerocket', 'tagzania' => 'TagZania', '43things' => '43 Things');
        foreach ($sites as $key => $value) {
            $output .= sprintf("<a href=\"javascript:doList('%s','%s');\"><img src=\"%spics/taggerati/%s.png\" alt=\"%s\" /></a>\n", $key, str_replace('/', '', $tag), $PIVOTX['paths']['pivotx_url'], $key, $value);
        }
        $output .= "</p>";
        $output .= "<div id=\"tgrrsslist\"></div>";
        $output .= "</div>\n";
    }
    if ($PIVOTX['config']->get('tag_flickr_enabled')) {
        $output .= "<h3>" . __('Flickr images for') . " '" . str_replace("+", " ", $tag) . "'</h3>\n\n";
        $output .= '

    <!-- Start of Flickr Badge -->
    <div id="flickrpics">
    <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?show_name=1&amp;count=' . $PIVOTX['config']->get('tag_flickr_amount') . '&amp;display=latest&amp;size=s&amp;layout=h&amp;source=all_tag&amp;tag=' . $tag . '"></script>
    </div>

    ';
    }
    $output .= "</div>\n";
    return $output;
}
Exemple #2
0
                echo T_("Contact User");
                ?>
</a></p>
<?php 
            } else {
                echo "<p>&nbsp;</p>";
            }
        }
    }
}
if (in_array('related', $blocks)) {
    if ($current_page != "") {
        $strRelated = displayRelatedTagsList(getRelatedTags($tagNames, 10, $userName), $tagName, $current_page);
        $strRelatedMinus = displayRelatedTagsListMinus($tagName, $tagNames, $current_page);
    } else {
        $strRelated = displayRelatedTagsList(getRelatedTags($tagNames, 10, $userName), $tagName);
        $strRelatedMinus = displayRelatedTagsListMinus($tagName, $tagNames);
    }
    if ($strRelated || $strRelatedMinus) {
        if ($current_page == "") {
            $current_page = "recent_tags.php";
        }
        // If in the tags page, display the recent tags page
        echo "<div class=\"rm_heading\">" . T_("Related Tags") . "</div>";
        if ($strRelatedMinus) {
            if ($userName != "") {
                $forAllStr = " <a href=\"tags.php?tag=" . $tagName . "\" title=\"" . T_("Display tags for all users") . "\">[" . T_("all users") . "]</a>";
            }
            echo "<div class=\"rm_content\"><a href=\"" . $current_page . "\" title=\"" . T_("Remove all tags") . "\">[" . T_("remove all") . "]</a>\n" . $forAllStr . $strRelatedMinus . $strRelated . "</div><br>";
        } else {
            echo "<div class=\"rm_content\">" . $strRelated . "</div><br>";