Check out the demo video. Author: Aakash Chakravarthy Version: 2.0 */ if(!defined('WP_CONTENT_URL')) { $srr_url = get_option('siteurl') . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__)).'/'; }else{ $srr_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/'; } define('SRR_VERSION', '2.0'); define('SRR_AUTHOR', 'Aakash Chakravarthy'); define('SRR_URL', $srr_url); ## Include the required scripts and styles if( !is_admin()){ // jQuery wp_deregister_script('jquery'); wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '1.3.2'); wp_enqueue_script('jquery'); // Super RSS Reader JS and CSS wp_register_script('super-rss-reader-js', SRR_URL . 'public/srr-js.js'); wp_enqueue_script(array('jquery', 'super-rss-reader-js')); wp_register_style('super-rss-reader-css', SRR_URL . 'public/srr-css.css'); wp_enqueue_style('super-rss-reader-css'); } ## Default color styles $srr_color_styles = array( 'No style' => 'none', 'Grey' => 'grey', 'Dark' => 'dark' ); ## The main RSS Parser function srr_rss_parser($instance){ $urls = stripslashes($instance['urls']); $count = intval($instance['count']); $show_date = intval($instance['show_date']); $show_desc = intval($instance['show_desc']); $show_author = intval($instance['show_author']); $strip_desc = intval($instance['strip_desc']); $color_style = stripslashes($instance['color_style']); $enable_ticker = intval($instance['enable_ticker']); $visible_items = intval($instance['visible_items']); if(empty($urls)){ return ''; } $rand = array(); $url = explode(',', $urls); // Generate the Tabs if(count($url) > 1){ echo ''; } for($i=0; $iget_item_quantity($count); $rss_items = $rss->get_items(0, $maxitems); $rss_title = esc_attr(strip_tags($rss->get_title())); $rss_desc = esc_attr(strip_tags($rss->get_description())); } // Outer Wrap start echo '
'; // Check feed items if ($maxitems == 0){ echo '
No items.
'; }else{ $j=1; // Loop through each feed item foreach ($rss_items as $item){ // Get the link $link = $item->get_link(); while ( stristr($link, 'http') != $link ){ $link = substr($link, 1); } $link = esc_url(strip_tags($link)); // Get the item title $title = esc_attr(strip_tags($item->get_title())); if ( empty($title) ) $title = __('Untitled'); // Get the date $date = $item->get_date('j F Y'); // Get the description $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); if($strip_desc != 0){ $desc = wp_html_excerpt( $desc, $strip_desc ); if ( '[...]' == substr( $desc, -5 ) ) $desc = substr( $desc, 0, -5 ) . '[…]'; elseif ( '[…]' != substr( $desc, -10 ) ) $desc .= ' […]'; } $desc = esc_html( $desc ); // Get the author $author = $item->get_author(); if ( is_object($author) ) { $author = $author->get_name(); $author = esc_html(strip_tags($author)); } echo "\n\n\t"; // Display the feed items echo '
'; echo '' .$title . ''; if($show_date) echo '
' . $date . ''; if($show_author) echo ' - ' . $author . ''; if($show_desc) echo '

' . $desc . '

'; echo '
'; // End display $j++; } } // Outer wrap end echo "\n\n
\n\n" ; } } class super_rss_reader_widget extends WP_Widget{ ## Initialize function super_rss_reader_widget(){ $widget_ops = array( 'classname' => 'widget_super_rss_reader', 'description' => "Enhanced RSS feed reader widget with advanced features." ); $control_ops = array('width' => 430, 'height' => 500); parent::WP_Widget('super_rss_reader', 'Super RSS Reader', $widget_ops, $control_ops); } ## Display the Widget function widget($args, $instance){ extract($args); if(empty($instance['title'])){ $title = ''; }else{ $title = $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } echo $before_widget . $title; echo "\n" . '
' . "\n"; srr_rss_parser($instance, $instance['urls']); echo "\n" . '
' . "\n"; echo $after_widget; } ## Save settings function update($new_instance, $old_instance){ $instance = $old_instance; $instance['title'] = stripslashes($new_instance['title']); $instance['urls'] = stripslashes($new_instance['urls']); $instance['count'] = intval($new_instance['count']); $instance['show_date'] = intval($new_instance['show_date']); $instance['show_desc'] = intval($new_instance['show_desc']); $instance['show_author'] = intval($new_instance['show_author']); $instance['strip_desc'] = intval($new_instance['strip_desc']); $instance['color_style'] = stripslashes($new_instance['color_style']); $instance['enable_ticker'] = intval($new_instance['enable_ticker']); $instance['visible_items'] = intval($new_instance['visible_items']); return $instance; } ## HJA Widget form function form($instance){ global $srr_color_styles; $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'urls' => '', 'count' => 5, 'show_date' => 0, 'show_desc' => 1, 'show_author' => 0, 'strip_desc' => 100, 'color_style' => 'none', 'enable_ticker' => 1, 'visible_items' => 5 )); $title = htmlspecialchars($instance['title']); $urls = htmlspecialchars($instance['urls']); $count = intval($instance['count']); $show_date = intval($instance['show_date']); $show_desc = intval($instance['show_desc']); $show_author = intval($instance['show_author']); $strip_desc = intval($instance['strip_desc']); $color_style = stripslashes($instance['color_style']); $enable_ticker = intval($instance['enable_ticker']); $visible_items = intval($instance['visible_items']); ?>
Can enter multiple RSS/atom feed URLs seperated by a comma.

Settings

/>
/>
/>    

Other settings

get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">'; foreach($srr_color_styles as $k => $v){ echo ''; } echo ''; ?>
/>
Like | Donate | Support