Exemplo n.º 1
0
 /**
  * display widget
  */
 function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     $title = $instance['title'];
     $img_url = get_bloginfo('wpurl') . "/wp-includes/images/rss.png";
     $feed_url = sk_plugin_url('/feed.php');
     if (defined('SK_RSS')) {
         $feed_url = SK_RSS;
     }
     if ($instance['rss']) {
         $title = "<a class='rsswidget' href='{$feed_url}' title='" . __('Subscribe', 'sk') . "'><img src='{$img_url}' alt='RSS' border='0' /></a> {$title}";
     }
     echo $before_widget;
     if (strlen($instance['title']) > 0) {
         echo $before_title . $title . $after_title;
     }
     sk_shoutbox($instance['items']);
     echo $after_widget;
 }
Exemplo n.º 2
0
function skLegacy_content($content)
{
    //The chat box
    $search = "/(?:<p>)*\\s*\\[sk-shoutbox\\]\\s*(?:<\\/p>)*/i";
    if (preg_match($search, $content)) {
        $options = get_option('sk_options');
        $args = array();
        $args['items'] = $options['items'];
        $content = preg_replace($search, sk_codeShoutbox($args), $content);
    }
    //The feed icon
    $search = "/\\[sk-feed-icon\\]/i";
    $img_url = get_bloginfo('wpurl') . "/wp-includes/images/rss.png";
    $feed_url = sk_plugin_url('/ajax/feed.php');
    $replace = "<a class='rsswidget' href='{$feed_url}' title='" . __('Subscribe', 'sk') . "'><img src='{$img_url}' alt='RSS' border='0' /></a>";
    $content = preg_replace($search, $replace, $content);
    //Thed feed link
    $search = "/\\[sk-feed\\]([^\\[]+)\\[\\/sk-feed\\]/i";
    $replace = "<a href='{$feed_url}'>\$1</a>";
    $content = preg_replace($search, $replace, $content);
    return $content;
}