Esempio n. 1
0
function nitwpress_sidebar_widget($args)
{
    extract($args);
    echo $before_widget;
    $options = nitwpress_get_options();
    if ($options['username']) {
        if ($options['widgettitle']) {
            $title = htmlspecialchars($options['widgettitle']);
            echo "<h2 class=\"widgettitle\">{$title}</h2>\n";
        }
        echo "<div class=\"nitwpress_widget_content\"";
        if ($options['widgetstyles']) {
            $style = htmlspecialchars($options['widgetstyles']);
            echo " style=\"{$style}\"";
        }
        echo ">\n";
        $twitter = new NiTwPressTwitterBasicAuthentication($options);
        echo $twitter->toHtml(WP_PLUGIN_URL . '/nitwpress/nitwpress.swf', WP_PLUGIN_URL . NITWPRESS_CACHES . '/');
        $username = htmlspecialchars($options['username']);
        echo "<div>\n";
        echo "<a href=\"http://twitter.com/{$username}\">follow {$username} at http://twitter.com</a>\n";
        echo "</div>\n";
        echo "</div>\n";
    }
    echo $after_widget;
}