'com_widget_recent_entries', 'description'=>__("The most recent posts on your blog") ); $this->WP_Widget('com-recent-posts', __('Black Eve Recent Posts'), $widget_ops); $this->alt_option_name = 'com_widget_recent_entries'; } function widget($args, $instance) { ob_start(); extract($args); $title = apply_filters('widget_title', empty($instance['title'])?__('Recent Posts'):$instance['title']); if(!$number = (int)$instance['number']) { $number = 10; } elseif($number < 1) { $number = 1; } elseif($number > 15) { $number = 15; } if(!$excl = $instance['excl']) { $excl = 10; } elseif($excl < 1) { $excl = 1; } elseif($excl > 15) { $excl = 15; } $r = new WP_Query(array( 'category__not_in'=>array_map('trim', explode(',', $excl)), 'showposts'=>$number, 'nopaging'=>0, 'post_status'=>'publish', 'caller_get_posts'=>1 )); if($r->have_posts()) { ?>
'com_widget_testimonials', 'description'=>__('Black Eve Testimonials Widgets')); $this->WP_Widget('com-bigad', __('Black Eve Testimonials widget'), $widget_ops); } function widget($args, $instance) { extract( $args ); $title = apply_filters('widget_title', empty($instance['title'] ) ? __('') : $instance['title']); $name = $instance['name']; $test_content = $instance['test_content']; $test_name = $instance['test_name']; $test_url = $instance['test_url']; echo $before_widget; if($title) { echo $before_title . $title . $after_title; } ?> '', 'test_content' => '', 'test_name' => '', 'test_url' => '') ); $title = esc_attr( $instance['title'] ); $test_content = esc_attr( $instance['test_content'] ); $test_name = esc_attr( $instance['test_name'] ); $test_url = esc_attr( $instance['test_url'] ); ?>
$widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract($widget_args, EXTR_SKIP); $options = get_option('widget_twitter'); if ( !isset($options[$number]) ) return; if ( isset($options[$number]['error']) && $options[$number]['error'] ) return; $account = $options[$number]['account']; $url = 'http://twitter.com/statuses/user_timeline/'.$account.'.rss'; if ( empty($account) ) return; require_once(ABSPATH . WPINC . '/rss.php'); $rss = fetch_rss($url); $link = clean_url(strip_tags($rss->channel['link'])); while ( strstr($link, 'http') != $link ) $link = substr($link, 1); $desc = attribute_escape(strip_tags(html_entity_decode($rss->channel['description'], ENT_QUOTES))); $title = $options[$number]['title']; if ( empty($title) ) $title = htmlentities(strip_tags($rss->channel['title'])); if ( empty($title) ) $title = $desc; if ( empty($title) ) $title = __('Unknown Feed'); $title = apply_filters('widget_title', $title ); $account = apply_filters('widget_account', $account ); $title = "$title"; echo $before_widget; echo $before_title . $title . $after_title; wp_widget_twitter_output( $rss, $options[$number] ); echo $after_widget; } function wp_widget_twitter_output( $rss, $args = array() ) { if ( is_string( $rss ) ) { require_once(ABSPATH . WPINC . '/rss.php'); if ( !$rss = fetch_rss($rss) ) return; } elseif ( is_array($rss) && isset($rss['url']) ) { require_once(ABSPATH . WPINC . '/rss.php'); $args = $rss; if ( !$rss = fetch_rss($rss['url']) ) return; } elseif ( !is_object($rss) ) { return; } $args = wp_parse_args( $args ); extract( $args, EXTR_SKIP ); $items = (int) $items; if ( $items < 1 || 10 < $items ) $items = 10; $show_date = true; if ( is_array( $rss->items ) && !empty( $rss->items ) ) { $rss->items = array_slice($rss->items, 0, $items); echo '
channel['link'])); while ( strstr($link, 'http') != $link ) $link = substr($link, 1); } } return compact( 'title', 'account', 'link', 'items', 'error' ); } function wp_widget_twitter_register() { if ( !$options = get_option('widget_twitter') ) $options = array(); $widget_ops = array('classname' => 'widget_twitter', 'description' => __( 'Display your Twitter updates' )); $control_ops = array('width' => 250, 'height' => 200, 'id_base' => 'twitter'); $name = __('Black Eve Twitter widget'); $id = false; foreach ( (array) array_keys($options) as $o ) { if ( !isset($options[$o]['account']) || !isset($options[$o]['title']) || !isset($options[$o]['items']) ) continue; $id = "twitter-$o"; // Never never never translate an id wp_register_sidebar_widget($id, $name, 'wp_widget_twitter', $widget_ops, array( 'number' => $o )); wp_register_widget_control($id, $name, 'wp_widget_twitter_control', $control_ops, array( 'number' => $o )); } if ( !$id ) { wp_register_sidebar_widget( 'twitter-1', $name, 'wp_widget_twitter', $widget_ops, array( 'number' => -1 ) ); wp_register_widget_control( 'twitter-1', $name, 'wp_widget_twitter_control', $control_ops, array( 'number' => -1 ) ); } } function wp_twitter_init() { if ( !is_blog_installed() ) return; wp_widget_twitter_register(); } add_action('init', 'wp_twitter_init', 1); function widget_flickr($args) { if(file_exists(ABSPATH.WPINC.'/rss.php')) { require_once(ABSPATH.WPINC . '/rss.php'); } else { require_once(ABSPATH . WPINC . '/rss-functions.php'); } extract($args); $options = get_option('widget_flickr'); if( $options == false ) { $options[ 'title' ] = 'Flickr Photos'; $options[ 'items' ] = 3; } $title = empty($options['title']) ? __('Flickr Photos') : $options['title']; $items = $options[ 'items' ]; $flickr_rss_url = empty($options['flickr_rss_url']) ? '' : $options['flickr_rss_url']; if ( empty($items) || $items < 1 || $items > 10 ) $items = 3; $rss = fetch_rss( $flickr_rss_url ); if( is_array( $rss->items ) ) { $out_u = '
* Your RSS feed can be found on your Flickr homepage. Scroll down to the bottom of the page until you see the Feed link and copy that into the box above.