'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_subscribe', 'description'=>__('A list of follow us options ')); $this->WP_Widget('com-subscribe', __('Black Eve Follow us'), $widget_ops); } function widget($args, $instance) { extract( $args ); $title = apply_filters('widget_title', empty($instance['title'] ) ? __('') : $instance['title']); echo $before_widget; if($title) { echo $before_title . $title . $after_title; } $cat_args = array('orderby' => 'name', 'hide_empty'=>0, 'parent'=>$cat->cat_ID); ?> '') ); $title = esc_attr( $instance['title'] ); ?>

'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 '
'; foreach ( (array) $rss->items as $item ) { while ( strstr($item['link'], 'http') != $item['link'] ) $item['link'] = substr($item['link'], 1); $link = clean_url(strip_tags($item['link'])); $title = attribute_escape(strip_tags($item['title'])); if ( empty($title) ) $title = $item['title']; $desc = ''; if ( isset( $item['description'] ) && is_string( $item['description'] ) ) $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['description'], ENT_QUOTES)))); elseif ( isset( $item['summary'] ) && is_string( $item['summary'] ) ) $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['summary'], ENT_QUOTES)))); if ( 360 < strlen( $desc ) ) $desc = wp_html_excerpt( $desc, 360 ) . ' […]'; $date = ''; if ( $show_date ) { if ( isset($item['pubdate']) ) $date = $item['pubdate']; elseif ( isset($item['published']) ) $date = $item['published']; if ( $date ) { if ( $date_stamp = strtotime( $date ) ) $date = ' ' . date_i18n( get_option( 'date_format' ), $date_stamp ) . ''; else $date = ''; } } $title = " ".substr(strstr($title,': '), 2, strlen($title))." "; $title = twitter_users($title); $title = twitter_hyperlinks($title); if ( $link == '' ) { echo "
$title{$summary}{$author}
"; } else { echo "
$title{$summary}{$author}
"; printf(__('%s ago'), human_time_diff(strtotime($item['pubdate'], time() ) ) ); echo "
"; } } echo '
'; } else { echo '
' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '
'; } } function twitter_users($text) { $text = preg_replace('/([\.|\,|\:|\¡|\¿|\>|\{|\(]?)@{1}(\w*)([\.|\,|\:|\!|\?|\>|\}|\)]?)\s/i', "$1@$2$3 ", $text); return $text; } function twitter_hyperlinks($text) { $text = preg_replace("/\s([a-zA-Z]+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)([\s|\.|\,])/i"," $1$2", $text); $text = preg_replace("/\s(www\.[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)([\s|\.|\,])/i"," $1$2", $text); $text = preg_replace("/\s([a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]*\@[a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]{2,6})([\s|\.|\,])/i"," $1$2", $text); return $text; } function wp_widget_twitter_control($widget_args) { global $wp_registered_widgets; static $updated = false; if ( is_numeric($widget_args) ) $widget_args = array( 'number' => $widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract($widget_args, EXTR_SKIP); $options = get_option('widget_twitter'); if ( !is_array($options) ) $options = array(); $accounts = array(); foreach ( (array) $options as $option ) if ( isset($option['account']) ) $urls[$option['account']] = true; if ( !$updated && 'POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['sidebar']) ) { $sidebar = (string) $_POST['sidebar']; $sidebars_widgets = wp_get_sidebars_widgets(); if ( isset($sidebars_widgets[$sidebar]) ) $this_sidebar =& $sidebars_widgets[$sidebar]; else $this_sidebar = array(); foreach ( (array) $this_sidebar as $_widget_id ) { if ( 'wp_widget_twitter' == $wp_registered_widgets[$_widget_id]['callback'] && isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) ) { $widget_number = $wp_registered_widgets[$_widget_id]['params'][0]['number']; if ( !in_array( "twitter-$widget_number", $_POST['widget-id'] ) ) // the widget has been removed. unset($options[$widget_number]); } } foreach( (array) $_POST['widget-twitter'] as $widget_number => $widget_twitter ) { if ( !isset($widget_twitter['account']) && isset($options[$widget_number]) ) // user clicked cancel continue; $widget_twitter = stripslashes_deep( $widget_twitter ); $account = attribute_escape($widget_twitter['account']); $options[$widget_number] = wp_widget_twitter_process( $widget_twitter, !isset($accounts[$account]) ); } update_option('widget_twitter', $options); $updated = true; } if ( -1 == $number ) { $title = ''; $account = ''; $items = 10; $error = false; $number = '%i%'; } else { extract( (array) $options[$number] ); } wp_widget_twitter_form( compact( 'number', 'title', 'account', 'items', 'error' ) ); } function wp_widget_twitter_form( $args, $inputs = null ) { $default_inputs = array( 'account' => true, 'title' => true, 'items' => true ); $inputs = wp_parse_args( $inputs, $default_inputs ); extract( $args ); extract( $inputs, EXTR_SKIP); $number = attribute_escape( $number ); $title = attribute_escape( $title ); $account = attribute_escape( $account ); $items = (int) $items; if ( $items < 1 || 10 < $items ) $items = 10; if ( $inputs['title'] ) : ?>

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 = ''; $items = array_slice( $rss->items, 0, $items ); while( list( $key, $photo ) = each( $items ) ) { preg_match_all("/ "; } $flickr_home = $rss->channel[ 'link' ]; $flickr_more_title = $rss->channel[ 'title' ]; } ?>

* 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.