Version Description
Download this release
Release Info
Developer | vaakash |
Plugin | Super RSS Reader |
Version | 3.2 |
Comparing to | |
See all releases |
Code changes from version 3.1 to 3.2
- admin/css/style.css +23 -1
- includes/feed.php +241 -0
- includes/options.php +118 -0
- includes/widget-admin.php +149 -128
- includes/widget.php +10 -240
- public/css/style.css +79 -70
- public/css/style.min.css +1 -7
- readme.txt +46 -42
- super-rss-reader.php +5 -3
admin/css/style.css
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
.srr_settings h4{
|
2 |
border-bottom: 1px solid #DFDFDF;
|
3 |
-
margin: 15px 0;
|
4 |
padding: 0 0 10px 0;
|
|
|
5 |
}
|
6 |
.srr_settings td {
|
7 |
padding: 5px 0;
|
@@ -10,6 +11,27 @@
|
|
10 |
font-size: 11px;
|
11 |
color: #666666;
|
12 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
.srr_coffee {
|
14 |
border: 1px solid #dfdfdf;
|
15 |
padding: 10px 240px 10px 60px;
|
1 |
.srr_settings h4{
|
2 |
border-bottom: 1px solid #DFDFDF;
|
3 |
+
margin: 15px 0 10px 0;
|
4 |
padding: 0 0 10px 0;
|
5 |
+
font-size: 14px;
|
6 |
}
|
7 |
.srr_settings td {
|
8 |
padding: 5px 0;
|
11 |
font-size: 11px;
|
12 |
color: #666666;
|
13 |
}
|
14 |
+
|
15 |
+
.srr_row{
|
16 |
+
display: flex;
|
17 |
+
flex-wrap: nowrap;
|
18 |
+
padding: 10px 0;
|
19 |
+
}
|
20 |
+
.srr_label{
|
21 |
+
width: 60%;
|
22 |
+
padding-right: 15px;
|
23 |
+
box-sizing: border-box;
|
24 |
+
}
|
25 |
+
.srr_label.srr_sm{
|
26 |
+
width: 30%
|
27 |
+
}
|
28 |
+
.srr_label.srr_xsm{
|
29 |
+
width: 20%
|
30 |
+
}
|
31 |
+
.srr_field{
|
32 |
+
flex: 1;
|
33 |
+
}
|
34 |
+
|
35 |
.srr_coffee {
|
36 |
border: 1px solid #dfdfdf;
|
37 |
padding: 10px 240px 10px 60px;
|
includes/feed.php
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Prepares the feed HTML
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
|
7 |
+
if( ! defined( 'ABSPATH' ) ) exit;
|
8 |
+
|
9 |
+
class SRR_Feed{
|
10 |
+
|
11 |
+
public $options = array();
|
12 |
+
|
13 |
+
public function __construct( $options ){
|
14 |
+
|
15 |
+
$this->options = wp_parse_args( $options, SRR_Options::default_options() );
|
16 |
+
|
17 |
+
}
|
18 |
+
|
19 |
+
public function html(){
|
20 |
+
|
21 |
+
$urls = stripslashes( trim( $this->options['urls'] ) );
|
22 |
+
$tab_titles = stripslashes( $this->options['tab_titles'] );
|
23 |
+
$count = intval( $this->options['count'] );
|
24 |
+
|
25 |
+
$show_date = intval( $this->options['show_date'] );
|
26 |
+
$show_desc = intval( $this->options['show_desc'] );
|
27 |
+
$show_author = intval( $this->options['show_author'] );
|
28 |
+
$show_thumb = stripslashes( $this->options['show_thumb'] );
|
29 |
+
$open_newtab = intval( $this->options['open_newtab'] );
|
30 |
+
$add_nofollow = intval( $this->options['add_nofollow'] );
|
31 |
+
$strip_desc = intval( $this->options['strip_desc'] );
|
32 |
+
$strip_title = intval( $this->options['strip_title'] );
|
33 |
+
$read_more = htmlspecialchars( $this->options['read_more'] );
|
34 |
+
$rich_desc = intval( $this->options['rich_desc'] );
|
35 |
+
|
36 |
+
$color_theme = stripslashes( $this->options['color_style'] );
|
37 |
+
$display_type = stripslashes( $this->options['display_type'] );
|
38 |
+
$visible_items = intval( $this->options['visible_items'] );
|
39 |
+
$ticker_speed = intval( $this->options['ticker_speed'] ) * 1000;
|
40 |
+
|
41 |
+
if( empty( $urls ) ){
|
42 |
+
return '';
|
43 |
+
}
|
44 |
+
|
45 |
+
$url_delim = strpos( $urls, ',' ) !== false ? ',' : "\n";
|
46 |
+
$tab_title_delim = strpos( $tab_titles, ',' ) !== false ? ',' : "\n";
|
47 |
+
|
48 |
+
$urls = explode( $url_delim, $urls );
|
49 |
+
$tab_titles = explode( $tab_title_delim, $tab_titles );
|
50 |
+
$url_count = count( $urls );
|
51 |
+
|
52 |
+
$feeds = array();
|
53 |
+
$html = '';
|
54 |
+
|
55 |
+
// Fetch the feed
|
56 |
+
for( $i=0; $i < $url_count; $i++ ){
|
57 |
+
$feed_url = trim( $urls[$i] );
|
58 |
+
$feed = fetch_feed( $feed_url );
|
59 |
+
|
60 |
+
if( is_wp_error( $feed ) ){
|
61 |
+
$feed_title = 'Error';
|
62 |
+
}else{
|
63 |
+
$feed_title = ( isset( $tab_titles[$i] ) && !empty( $tab_titles[$i] ) ) ? $tab_titles[$i] : esc_attr( strip_tags( $feed->get_title() ) );
|
64 |
+
}
|
65 |
+
|
66 |
+
$feeds[ $feed_url ] = array(
|
67 |
+
'id' => rand( 100, 999 ),
|
68 |
+
'feed' => $feed,
|
69 |
+
'title' => $feed_title
|
70 |
+
);
|
71 |
+
}
|
72 |
+
|
73 |
+
// Generate tabs
|
74 |
+
if( $url_count > 1 ){
|
75 |
+
$html .= '<ul class="srr-tab-wrap srr-tab-style-' . $color_theme . ' srr-clearfix">';
|
76 |
+
foreach( $feeds as $url => $data ){
|
77 |
+
$id = $data[ 'id' ];
|
78 |
+
$feed = $data[ 'feed' ];
|
79 |
+
if( is_wp_error( $feed ) ){
|
80 |
+
$html .= '<li data-tab="srr-tab-' . $id . '">Error</li>';
|
81 |
+
}else{
|
82 |
+
$html .= '<li data-tab="srr-tab-' . $id . '">' . $data[ 'title' ] . '</li>';
|
83 |
+
}
|
84 |
+
}
|
85 |
+
$html .= '</ul>';
|
86 |
+
}
|
87 |
+
|
88 |
+
// Generate feed items
|
89 |
+
foreach( $feeds as $url => $data ){
|
90 |
+
|
91 |
+
$id = $data[ 'id' ];
|
92 |
+
$feed = $data[ 'feed' ];
|
93 |
+
|
94 |
+
// Check for feed errors
|
95 |
+
if ( is_wp_error( $feed ) ){
|
96 |
+
$html .= '<div class="srr-wrap srr-style-' . $color_theme .'" data-id="srr-tab-' . $id . '"><p>RSS Error: ' . $feed->get_error_message() . '</p></div>';
|
97 |
+
continue;
|
98 |
+
}
|
99 |
+
|
100 |
+
if( method_exists( $feed, 'enable_order_by_date' ) ){
|
101 |
+
$feed->enable_order_by_date( false );
|
102 |
+
}
|
103 |
+
|
104 |
+
$max_items = $feed->get_item_quantity( $count );
|
105 |
+
$feed_items = $feed->get_items( 0, $max_items );
|
106 |
+
|
107 |
+
$classes = array( 'srr-wrap', 'srr-style-' . $color_theme );
|
108 |
+
if( $display_type == 'vertical_ticker' ) array_push( $classes, 'srr-vticker' );
|
109 |
+
$class = implode( ' ', $classes );
|
110 |
+
|
111 |
+
// Outer wrap start
|
112 |
+
$html .= '<div class="' . $class . '" data-visible="' . $visible_items . '" data-speed="' . $ticker_speed . '" data-id="srr-tab-' . $id . '">';
|
113 |
+
$html .= '<div>';
|
114 |
+
|
115 |
+
// Check feed items
|
116 |
+
if ( $max_items == 0 ){
|
117 |
+
$html .= '<div>No items.</div>';
|
118 |
+
}else{
|
119 |
+
$j=1;
|
120 |
+
// Loop through each feed item
|
121 |
+
foreach( $feed_items as $item ){
|
122 |
+
|
123 |
+
// Link
|
124 |
+
$link = $item->get_link();
|
125 |
+
while ( stristr( $link, 'http' ) != $link ){ $link = substr( $link, 1 ); }
|
126 |
+
$link = esc_url( strip_tags($link) );
|
127 |
+
|
128 |
+
// Title
|
129 |
+
$title = esc_attr( strip_tags( $item->get_title() ) );
|
130 |
+
$title_full = $title;
|
131 |
+
|
132 |
+
if ( empty( $title ) ){
|
133 |
+
$title = __( 'No Title', 'super-rss-reader' );
|
134 |
+
}
|
135 |
+
|
136 |
+
if( $strip_title > 0 && strlen( $title ) > $strip_title ){
|
137 |
+
$title = wp_trim_words( $title, $strip_title );
|
138 |
+
}
|
139 |
+
|
140 |
+
// Open links in new tab
|
141 |
+
$new_tab = $open_newtab ? ' target="_blank"' : '';
|
142 |
+
|
143 |
+
// Add no follow attribute
|
144 |
+
$no_follow = $add_nofollow ? ' rel="nofollow"' : '';
|
145 |
+
|
146 |
+
// Date
|
147 |
+
$date = $item->get_date( 'j F Y' );
|
148 |
+
$date_full = esc_attr( $item->get_date() );
|
149 |
+
|
150 |
+
// Thumbnail
|
151 |
+
$thumb = '';
|
152 |
+
if ( $show_thumb == 1 && $enclosure = $item->get_enclosure() ){
|
153 |
+
$thumb_url = $enclosure->get_thumbnail();
|
154 |
+
if( !empty( $thumb_url ) ){
|
155 |
+
$thumb = '<img src="' . $thumb_url . '" alt="' . $title_full . '" class="srr-thumb" align="left" />';
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
// Description
|
160 |
+
$desc = '';
|
161 |
+
if( $show_desc ){
|
162 |
+
if( $rich_desc ){
|
163 |
+
$desc = strip_tags( $item->get_description(), '<p><a><img><em><strong><font><strike><s><u><i>' );
|
164 |
+
}else{
|
165 |
+
|
166 |
+
$desc = str_replace( array( "\n", "\r" ), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
167 |
+
$read_more_link = '';
|
168 |
+
|
169 |
+
if( $strip_desc != 0 ){
|
170 |
+
$desc = wp_trim_words( $desc, $strip_desc );
|
171 |
+
$read_more_link = !empty( $read_more ) ? ' <a href="' . $link . '" title="Read more"' . $new_tab . $no_follow . '>' . $read_more . '</a>' : '';
|
172 |
+
|
173 |
+
if ( '[...]' == substr( $desc, -5 ) ){
|
174 |
+
$desc = substr( $desc, 0, -5 );
|
175 |
+
}elseif ( '[…]' != substr( $desc, -10 ) ){
|
176 |
+
$desc .= '';
|
177 |
+
}
|
178 |
+
|
179 |
+
$desc = esc_html( $desc );
|
180 |
+
}
|
181 |
+
|
182 |
+
$desc = $desc . $read_more_link;
|
183 |
+
|
184 |
+
}
|
185 |
+
}
|
186 |
+
|
187 |
+
// Author
|
188 |
+
$author = $item->get_author();
|
189 |
+
if ( is_object( $author ) ) {
|
190 |
+
$author = $author->get_name();
|
191 |
+
$author = esc_html( strip_tags( $author ) );
|
192 |
+
}
|
193 |
+
|
194 |
+
// Display the feed items
|
195 |
+
$html .= '<div class="srr-item ' . ( ( $j%2 == 0 ) ? 'even' : 'odd') . ' srr-clearfix">';
|
196 |
+
$html .= '<div class="srr-title"><a href="' . $link . '"' . $new_tab . $no_follow . ' title="' . $title_full . '">' . $title . '</a></div>';
|
197 |
+
|
198 |
+
$html .= '<div class="srr-meta">';
|
199 |
+
if( $show_date && !empty( $date ) ){
|
200 |
+
$html .= '<time class="srr-date" title="' . $date_full . '">' . $date . '</time>';
|
201 |
+
}
|
202 |
+
|
203 |
+
if( $show_author && !empty( $author ) ){
|
204 |
+
$html .= ' - <cite class="srr-author">' . $author . '</cite>';
|
205 |
+
}
|
206 |
+
$html .= '</div>';
|
207 |
+
|
208 |
+
if ( $show_thumb ){
|
209 |
+
$html .= $thumb;
|
210 |
+
}
|
211 |
+
|
212 |
+
if( $show_desc ){
|
213 |
+
$html .= '<div class="srr-summary srr-clearfix">';
|
214 |
+
$html .= $rich_desc ? $desc : ( '<p>' . $desc . '</p>' );
|
215 |
+
$html .= '</div>';
|
216 |
+
}
|
217 |
+
|
218 |
+
$html .= '</div>';
|
219 |
+
// End display
|
220 |
+
|
221 |
+
$j++;
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
// Outer wrap end
|
226 |
+
$html .= '</div></div>' ;
|
227 |
+
|
228 |
+
if ( !is_wp_error( $feed ) )
|
229 |
+
$feed->__destruct();
|
230 |
+
|
231 |
+
unset( $feed );
|
232 |
+
|
233 |
+
}
|
234 |
+
|
235 |
+
return $html;
|
236 |
+
|
237 |
+
}
|
238 |
+
|
239 |
+
}
|
240 |
+
|
241 |
+
?>
|
includes/options.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin options
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
|
7 |
+
if( ! defined( 'ABSPATH' ) ) exit;
|
8 |
+
|
9 |
+
class SRR_Options{
|
10 |
+
|
11 |
+
public static function options(){
|
12 |
+
|
13 |
+
return array(
|
14 |
+
'urls' => array(
|
15 |
+
'default' => '',
|
16 |
+
'description' => __( 'The URLs to display RSS feed for. Multiple RSS feed URLs can be separated by a new line or comma' )
|
17 |
+
),
|
18 |
+
'tab_titles' => array(
|
19 |
+
'default' => '',
|
20 |
+
'description' => __( 'The title of the tab for the respective RSS feed.' )
|
21 |
+
),
|
22 |
+
'count' => array(
|
23 |
+
'default' => 5,
|
24 |
+
'description' => __( 'The total number of feed items to fetch.' )
|
25 |
+
),
|
26 |
+
'show_date' => array(
|
27 |
+
'default' => 0,
|
28 |
+
'description' => __( 'Display the date of the feed item' )
|
29 |
+
),
|
30 |
+
'show_desc' => array(
|
31 |
+
'default' => 1,
|
32 |
+
'description' => __( 'Display the description/excerpt of the feed item' )
|
33 |
+
),
|
34 |
+
'show_author' => array(
|
35 |
+
'default' => 0,
|
36 |
+
'description' => __( 'Display the author of the feed item' )
|
37 |
+
),
|
38 |
+
'show_thumb' => array(
|
39 |
+
'default' => 1,
|
40 |
+
'description' => __( 'Display the thumbnail of the feed item' )
|
41 |
+
),
|
42 |
+
'strip_desc' => array(
|
43 |
+
'default' => 30,
|
44 |
+
'description' => __( 'Trim the description to certain number of words' )
|
45 |
+
),
|
46 |
+
'strip_title' => array(
|
47 |
+
'default' => 0,
|
48 |
+
'description' => __( 'Trim the title text to certain number of words.' )
|
49 |
+
),
|
50 |
+
'read_more' => array(
|
51 |
+
'default' => '[...]',
|
52 |
+
'description' => __( 'The read more text if the description is stripped.' )
|
53 |
+
),
|
54 |
+
'rich_desc' => array(
|
55 |
+
'default' => 0,
|
56 |
+
'description' => __( 'Display rich description with all the formatting present in the feed.' )
|
57 |
+
),
|
58 |
+
'add_nofollow' => array(
|
59 |
+
'default' => 1,
|
60 |
+
'description' => __( 'Add "nofollow" attribute to feed links' )
|
61 |
+
),
|
62 |
+
'open_newtab' => array(
|
63 |
+
'default' => 1,
|
64 |
+
'description' => __( 'Display the thumbnail of the feed item' )
|
65 |
+
),
|
66 |
+
'color_style' => array(
|
67 |
+
'default' => 'none',
|
68 |
+
'description' => __( 'The style of the feed display' )
|
69 |
+
),
|
70 |
+
'display_type' => array(
|
71 |
+
'default' => 'vertical_ticker',
|
72 |
+
'description' => __( 'The type of feed display mode.' )
|
73 |
+
),
|
74 |
+
'visible_items' => array(
|
75 |
+
'default' => 5,
|
76 |
+
'description' => __( 'The number of feed items to be visible when ticker is enabled.' )
|
77 |
+
),
|
78 |
+
'ticker_speed' => array(
|
79 |
+
'default' => 4,
|
80 |
+
'description' => __( 'The speed of the ticker animation in seconds' )
|
81 |
+
),
|
82 |
+
);
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
public static function color_themes(){
|
87 |
+
return array(
|
88 |
+
'No style' => 'none',
|
89 |
+
'Grey' => 'grey',
|
90 |
+
'Dark' => 'dark',
|
91 |
+
'Orange' => 'orange',
|
92 |
+
'Simple modern' => 'smodern'
|
93 |
+
);
|
94 |
+
}
|
95 |
+
|
96 |
+
public static function display_types(){
|
97 |
+
return array(
|
98 |
+
'normal' => 'Only feed list',
|
99 |
+
'vertical_ticker' => 'Feed list + Ticker',
|
100 |
+
);
|
101 |
+
}
|
102 |
+
|
103 |
+
public static function default_options(){
|
104 |
+
|
105 |
+
$defaults = array();
|
106 |
+
$all_options = self::options();
|
107 |
+
|
108 |
+
foreach( $all_options as $id => $props ){
|
109 |
+
$defaults[ $id ] = $props[ 'default' ];
|
110 |
+
}
|
111 |
+
|
112 |
+
return $defaults;
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
?>
|
includes/widget-admin.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
|
4 |
-
|
5 |
*/
|
6 |
|
7 |
class super_rss_reader_widget extends WP_Widget{
|
@@ -53,19 +53,19 @@ class super_rss_reader_widget extends WP_Widget{
|
|
53 |
$instance[ 'tab_titles' ] = stripslashes( $new_instance['tab_titles'] );
|
54 |
|
55 |
$instance[ 'count' ] = intval( $new_instance['count'] );
|
56 |
-
$instance[ 'show_date' ] = intval( $new_instance['show_date'] );
|
57 |
-
$instance[ 'show_desc' ] = intval( $new_instance['show_desc'] );
|
58 |
-
$instance[ 'show_author' ] = intval( $new_instance['show_author'] );
|
59 |
-
$instance[ 'show_thumb' ] =
|
60 |
-
$instance[ 'open_newtab' ] = intval( $new_instance['open_newtab'] );
|
61 |
-
$instance[ 'add_nofollow' ] = intval( $new_instance['add_nofollow'] );
|
62 |
$instance[ 'strip_desc' ] = intval( $new_instance['strip_desc'] );
|
63 |
$instance[ 'strip_title' ] = intval( $new_instance['strip_title'] );
|
64 |
$instance[ 'read_more' ] = stripslashes( $new_instance['read_more'] );
|
65 |
-
$instance[ '
|
|
|
|
|
66 |
|
67 |
$instance[ 'color_style' ] = stripslashes( $new_instance['color_style']);
|
68 |
-
$instance[ '
|
69 |
$instance[ 'visible_items' ] = intval( $new_instance['visible_items']);
|
70 |
$instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed']);
|
71 |
|
@@ -74,10 +74,10 @@ class super_rss_reader_widget extends WP_Widget{
|
|
74 |
|
75 |
// Widget form
|
76 |
public function form( $instance ){
|
77 |
-
|
78 |
-
$instance = wp_parse_args((array) $instance,
|
79 |
-
|
80 |
-
$title = htmlspecialchars($instance['title']);
|
81 |
$urls = htmlspecialchars($instance['urls']);
|
82 |
$tab_titles = htmlspecialchars($instance['tab_titles']);
|
83 |
|
@@ -91,10 +91,10 @@ class super_rss_reader_widget extends WP_Widget{
|
|
91 |
$strip_desc = intval($instance['strip_desc']);
|
92 |
$strip_title = intval($instance['strip_title']);
|
93 |
$read_more = htmlspecialchars($instance['read_more']);
|
94 |
-
$rich_desc =
|
95 |
|
96 |
$color_style = stripslashes($instance['color_style']);
|
97 |
-
$
|
98 |
$visible_items = intval($instance['visible_items']);
|
99 |
$ticker_speed = intval($instance['ticker_speed']);
|
100 |
|
@@ -103,119 +103,144 @@ class super_rss_reader_widget extends WP_Widget{
|
|
103 |
$tab_titles = str_replace( ',', "\n", $tab_titles );
|
104 |
|
105 |
?>
|
|
|
106 |
<div class="srr_settings">
|
107 |
-
|
108 |
-
<
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
<
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
<
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
</
|
128 |
-
|
129 |
-
<
|
130 |
-
|
131 |
-
<
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
<
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
<
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
<
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
<?php if( $rich_desc == 1 ): ?>
|
183 |
-
<span class="srr_note">Note: You have enabled "Full/Rich HTML" Please make sure that the feed(s) are from trusted sources and do not contain any harmful scripts. If there are some alignment issues in the description, please use custom CSS to fix that
|
184 |
<?php endif; ?>
|
185 |
-
|
186 |
-
<
|
187 |
-
<
|
188 |
-
|
189 |
-
|
190 |
-
<
|
191 |
-
<
|
192 |
<?php
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
?>
|
200 |
-
</
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
<
|
|
|
205 |
<small class="srr_small_text">Set value less than 20 to show visible feed items. Example: <b>5</b> items</small></br>
|
206 |
-
<small class="srr_small_text">Set value greater than 20 for fixed widget height. Example: <b>400</b> px</small></
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
<
|
211 |
-
<
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
</div>
|
220 |
|
221 |
<div class="srr_coffee">
|
@@ -238,12 +263,8 @@ class super_rss_reader_widget extends WP_Widget{
|
|
238 |
</div>
|
239 |
</div>
|
240 |
|
241 |
-
<div class="srr_survey">
|
242 |
-
<p><a href="https://forms.gle/cvzQ7k2Lex5xZLDf9" class="button button-primary" target="_blank">Share a feature</a><span>Request feature</span> Want any feature you would like to see in Super RSS Reader plugin ? Please share your requirements and features in a quick form.</p>
|
243 |
-
</div>
|
244 |
-
|
245 |
<div class="srr_info">
|
246 |
-
<p><a href="https://www.aakashweb.com/docs/super-rss-reader
|
247 |
</div>
|
248 |
|
249 |
<?php
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Contains WordPress widget class
|
4 |
+
*
|
5 |
*/
|
6 |
|
7 |
class super_rss_reader_widget extends WP_Widget{
|
53 |
$instance[ 'tab_titles' ] = stripslashes( $new_instance['tab_titles'] );
|
54 |
|
55 |
$instance[ 'count' ] = intval( $new_instance['count'] );
|
56 |
+
$instance[ 'show_date' ] = intval( isset( $new_instance['show_date'] ) ? $new_instance['show_date'] : 0 );
|
57 |
+
$instance[ 'show_desc' ] = intval( isset( $new_instance['show_desc'] ) ? $new_instance['show_desc'] : 0 );
|
58 |
+
$instance[ 'show_author' ] = intval( isset( $new_instance['show_author'] ) ? $new_instance['show_author'] : 0 );
|
59 |
+
$instance[ 'show_thumb' ] = intval( isset( $new_instance['show_thumb'] ) ? $new_instance['show_thumb'] : 0 );
|
|
|
|
|
60 |
$instance[ 'strip_desc' ] = intval( $new_instance['strip_desc'] );
|
61 |
$instance[ 'strip_title' ] = intval( $new_instance['strip_title'] );
|
62 |
$instance[ 'read_more' ] = stripslashes( $new_instance['read_more'] );
|
63 |
+
$instance[ 'add_nofollow' ] = intval( isset( $new_instance['add_nofollow'] ) ? $new_instance['add_nofollow'] : 0 );
|
64 |
+
$instance[ 'open_newtab' ] = intval( isset( $new_instance['open_newtab'] ) ? $new_instance['open_newtab'] : 0 );
|
65 |
+
$instance[ 'rich_desc' ] = intval( isset( $new_instance['rich_desc'] ) ? $new_instance['rich_desc'] : 0 );
|
66 |
|
67 |
$instance[ 'color_style' ] = stripslashes( $new_instance['color_style']);
|
68 |
+
$instance[ 'display_type' ] = stripslashes( $new_instance['display_type']);
|
69 |
$instance[ 'visible_items' ] = intval( $new_instance['visible_items']);
|
70 |
$instance[ 'ticker_speed' ] = intval( $new_instance['ticker_speed']);
|
71 |
|
74 |
|
75 |
// Widget form
|
76 |
public function form( $instance ){
|
77 |
+
|
78 |
+
$instance = wp_parse_args( (array) $instance, SRR_Options::default_options() );
|
79 |
+
|
80 |
+
$title = htmlspecialchars( isset( $instance['title'] ) ? $instance[ 'title' ] : '' );
|
81 |
$urls = htmlspecialchars($instance['urls']);
|
82 |
$tab_titles = htmlspecialchars($instance['tab_titles']);
|
83 |
|
91 |
$strip_desc = intval($instance['strip_desc']);
|
92 |
$strip_title = intval($instance['strip_title']);
|
93 |
$read_more = htmlspecialchars($instance['read_more']);
|
94 |
+
$rich_desc = intval($instance['rich_desc']);
|
95 |
|
96 |
$color_style = stripslashes($instance['color_style']);
|
97 |
+
$display_type = stripslashes($instance['display_type']);
|
98 |
$visible_items = intval($instance['visible_items']);
|
99 |
$ticker_speed = intval($instance['ticker_speed']);
|
100 |
|
103 |
$tab_titles = str_replace( ',', "\n", $tab_titles );
|
104 |
|
105 |
?>
|
106 |
+
|
107 |
<div class="srr_settings">
|
108 |
+
|
109 |
+
<section>
|
110 |
+
|
111 |
+
<div class="srr_row">
|
112 |
+
<div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('title'); ?>">Title</label></div>
|
113 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('title');?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" class="widefat"/></div>
|
114 |
+
</div>
|
115 |
+
|
116 |
+
<div class="srr_row">
|
117 |
+
<div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('urls'); ?>">URL(s)</label></div>
|
118 |
+
<div class="srr_field"><textarea id="<?php echo $this->get_field_id('urls');?>" name="<?php echo $this->get_field_name('urls'); ?>" class="widefat"><?php echo $urls; ?></textarea>
|
119 |
+
<small class="srr_small_text">Can enter multiple RSS/atom feed URLs in new line</small></div>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<div class="srr_row">
|
123 |
+
<div class="srr_label srr_xsm"><label for="<?php echo $this->get_field_id('tab_titles'); ?>">Tab titles</label></div>
|
124 |
+
<div class="srr_field"><textarea id="<?php echo $this->get_field_id('tab_titles');?>" name="<?php echo $this->get_field_name('tab_titles'); ?>" class="widefat"><?php echo $tab_titles; ?></textarea>
|
125 |
+
<small class="srr_small_text">Enter corresponding tab titles in new line.</small></div>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
</section>
|
129 |
+
|
130 |
+
<h4>Display</h4>
|
131 |
+
|
132 |
+
<section data-tab-id="display">
|
133 |
+
<div class="srr_row">
|
134 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_desc'); ?>">Show Description</label></div>
|
135 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_desc'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_desc'); ?>" value="1" <?php echo $show_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
|
136 |
+
</div>
|
137 |
+
|
138 |
+
<div class="srr_row">
|
139 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_date'); ?>">Show Date</label></div>
|
140 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_date'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_date'); ?>" value="1" <?php echo $show_date == "1" ? 'checked="checked"' : ""; ?> /></div>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div class="srr_row">
|
144 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_author'); ?>">Show Author</label></div>
|
145 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_author'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_author'); ?>" value="1" <?php echo $show_author == "1" ? 'checked="checked"' : ""; ?> /></div>
|
146 |
+
</div>
|
147 |
+
|
148 |
+
<div class="srr_row">
|
149 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('show_thumb'); ?>">Show thumbnail if present</label></div>
|
150 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('show_thumb'); ?>" type="checkbox" name="<?php echo $this->get_field_name('show_thumb'); ?>" value="1" <?php echo $show_thumb == "1" ? 'checked="checked"' : ""; ?> /></div>
|
151 |
+
</div>
|
152 |
+
</section>
|
153 |
+
|
154 |
+
<h4>Content</h4>
|
155 |
+
|
156 |
+
<section data-tab-id="content">
|
157 |
+
|
158 |
+
<div class="srr_row">
|
159 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('count');?>">Total items to show:</label></div>
|
160 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('count');?>" name="<?php echo $this->get_field_name('count'); ?>" type="number" value="<?php echo $count; ?>" class="widefat" title="No of feed items to parse"/></div>
|
161 |
+
</div>
|
162 |
+
|
163 |
+
<div class="srr_row">
|
164 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('strip_desc');?>">Trim description to words:</label></div>
|
165 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('strip_desc');?>" name="<?php echo $this->get_field_name('strip_desc'); ?>" type="number" value="<?php echo $strip_desc; ?>" class="widefat" title="The number of words to be displayed. Use 0 to disable stripping"/></div>
|
166 |
+
</div>
|
167 |
+
|
168 |
+
<div class="srr_row">
|
169 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('read_more'); ?>">Read more text:</label></div>
|
170 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('read_more'); ?>" name="<?php echo $this->get_field_name('read_more'); ?>" type="text" value="<?php echo $read_more; ?>" class="widefat" title="Leave blank to hide read more text"/></div>
|
171 |
+
</div>
|
172 |
+
|
173 |
+
<div class="srr_row">
|
174 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('add_nofollow'); ?>">Add "no follow" attribute to links</label></div>
|
175 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('add_nofollow'); ?>" type="checkbox" name="<?php echo $this->get_field_name('add_nofollow'); ?>" value="1" <?php echo $add_nofollow == "1" ? 'checked="checked"' : ""; ?> /></div>
|
176 |
+
</div>
|
177 |
+
|
178 |
+
<div class="srr_row">
|
179 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('open_newtab'); ?>">Open links in new tab</label></div>
|
180 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('open_newtab'); ?>" type="checkbox" name="<?php echo $this->get_field_name('open_newtab'); ?>" value="1" <?php echo $open_newtab == "1" ? 'checked="checked"' : ""; ?> /></div>
|
181 |
+
</div>
|
182 |
+
|
183 |
+
<div class="srr_row">
|
184 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('strip_title'); ?>">Trim title to words:</label></div>
|
185 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('strip_title');?>" name="<?php echo $this->get_field_name('strip_title'); ?>" type="number" value="<?php echo $strip_title; ?>" class="widefat" title="The number of words to be displayed. Use 0 to disable stripping"/></div>
|
186 |
+
</div>
|
187 |
+
|
188 |
+
<div class="srr_row">
|
189 |
+
<div class="srr_label"><label for="<?php echo $this->get_field_id('rich_desc'); ?>">Enable rich description</label></div>
|
190 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('rich_desc'); ?>" type="checkbox" name="<?php echo $this->get_field_name('rich_desc'); ?>" value="1" <?php echo $rich_desc == "1" ? 'checked="checked"' : ""; ?> /></div>
|
191 |
+
</div>
|
192 |
+
|
193 |
+
</section>
|
194 |
+
|
195 |
<?php if( $rich_desc == 1 ): ?>
|
196 |
+
<span class="srr_note">Note: You have enabled "Full/Rich HTML". If no description is present, then the full content will be displayed. Please make sure that the feed(s) are from trusted sources and do not contain any harmful scripts. If there are some alignment issues in the description, please use custom CSS to fix that.</span>
|
197 |
<?php endif; ?>
|
198 |
+
|
199 |
+
<h4>Style</h4>
|
200 |
+
<section>
|
201 |
+
|
202 |
+
<div class="srr_row">
|
203 |
+
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('color_style');?>">Color theme: </label></div>
|
204 |
+
<div class="srr_field">
|
205 |
<?php
|
206 |
+
$color_themes = SRR_Options::color_themes();
|
207 |
+
echo '<select name="' . $this->get_field_name('color_style') . '" id="' . $this->get_field_id('color_style') . '">';
|
208 |
+
foreach($color_themes as $k => $v){
|
209 |
+
echo '<option value="' . $v . '" ' . ($color_style == $v ? 'selected="selected"' : "") . '>' . $k . '</option>';
|
210 |
+
}
|
211 |
+
echo '</select>';
|
212 |
?>
|
213 |
+
</div>
|
214 |
+
</div>
|
215 |
+
|
216 |
+
<div class="srr_row">
|
217 |
+
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('visible_items');?>">Widget height:</label></div>
|
218 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('visible_items');?>" name="<?php echo $this->get_field_name('visible_items'); ?>" type="number" value="<?php echo $visible_items; ?>" title="Height of the RSS feed."/><br/>
|
219 |
<small class="srr_small_text">Set value less than 20 to show visible feed items. Example: <b>5</b> items</small></br>
|
220 |
+
<small class="srr_small_text">Set value greater than 20 for fixed widget height. Example: <b>400</b> px</small></div>
|
221 |
+
</div>
|
222 |
+
|
223 |
+
<div class="srr_row">
|
224 |
+
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('display_type');?>">Display type: </label></div>
|
225 |
+
<div class="srr_field">
|
226 |
+
<?php
|
227 |
+
$display_types = SRR_Options::display_types();
|
228 |
+
echo '<select name="' . $this->get_field_name('display_type') . '" id="' . $this->get_field_id('display_type') . '">';
|
229 |
+
foreach($display_types as $k => $v){
|
230 |
+
echo '<option value="' . $k . '" ' . ($display_type == $k ? 'selected="selected"' : "") . '>' . $v . '</option>';
|
231 |
+
}
|
232 |
+
echo '</select>';
|
233 |
+
?>
|
234 |
+
</div>
|
235 |
+
</div>
|
236 |
+
|
237 |
+
<div class="srr_row">
|
238 |
+
<div class="srr_label srr_sm"><label for="<?php echo $this->get_field_id('ticker_speed');?>">Ticker speed: </label></div>
|
239 |
+
<div class="srr_field"><input id="<?php echo $this->get_field_id('ticker_speed');?>" name="<?php echo $this->get_field_name('ticker_speed'); ?>" type="number" value="<?php echo $ticker_speed; ?>" title="Speed of the ticker in seconds"/> seconds</div>
|
240 |
+
</div>
|
241 |
+
|
242 |
+
</section>
|
243 |
+
|
244 |
</div>
|
245 |
|
246 |
<div class="srr_coffee">
|
263 |
</div>
|
264 |
</div>
|
265 |
|
|
|
|
|
|
|
|
|
266 |
<div class="srr_info">
|
267 |
+
<p><a href="https://www.aakashweb.com/docs/super-rss-reader/faq/" target="_blank">FAQ</a> | <a href="https://www.aakashweb.com/forum/discuss/wordpress-plugins/super-rss-reader/" target="_blank">Report issue</a> | <a href="https://wordpress.org/support/plugin/super-rss-reader/reviews/?rate=5#new-post" target="_blank">Rate 5 stars & review</a> | v<?php echo SRR_VERSION; ?></p>
|
268 |
</div>
|
269 |
|
270 |
<?php
|
includes/widget.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
|
4 |
-
|
5 |
*/
|
6 |
|
7 |
if( ! defined( 'ABSPATH' ) ) exit;
|
@@ -10,11 +10,11 @@ class SRR_Widget{
|
|
10 |
|
11 |
public static function init(){
|
12 |
|
13 |
-
add_action( 'widgets_init', array(
|
14 |
|
15 |
-
add_action( 'wp_enqueue_scripts', array(
|
16 |
|
17 |
-
add_action( 'admin_enqueue_scripts', array(
|
18 |
|
19 |
}
|
20 |
|
@@ -35,246 +35,16 @@ class SRR_Widget{
|
|
35 |
public static function admin_scripts( $hook ){
|
36 |
|
37 |
if( $hook == 'widgets.php' ){
|
38 |
-
wp_enqueue_style( 'srr_admin_css', SRR_URL . 'admin/css/style.css' );
|
39 |
-
wp_enqueue_script( 'srr_admin_js', SRR_URL . 'admin/js/script.js' );
|
40 |
}
|
41 |
|
42 |
}
|
43 |
|
44 |
-
public static function
|
45 |
-
return array(
|
46 |
-
'title' => '',
|
47 |
-
'urls' => '',
|
48 |
-
'tab_titles' => '',
|
49 |
-
'count' => 5,
|
50 |
-
'show_date' => 0,
|
51 |
-
'show_desc' => 1,
|
52 |
-
'show_author' => 0,
|
53 |
-
'show_thumb' => 1,
|
54 |
-
'open_newtab' => 1,
|
55 |
-
'strip_desc' => 100,
|
56 |
-
'add_nofollow' => 1,
|
57 |
-
'read_more' => '[...]',
|
58 |
-
'rich_desc' => 0 ,
|
59 |
-
'color_style' => 'none',
|
60 |
-
'enable_ticker' => 1,
|
61 |
-
'visible_items' => 5,
|
62 |
-
'strip_title' => 0,
|
63 |
-
'ticker_speed' => 4,
|
64 |
-
);
|
65 |
-
}
|
66 |
-
|
67 |
-
public static function color_themes(){
|
68 |
-
return array(
|
69 |
-
'No style' => 'none',
|
70 |
-
'Grey' => 'grey',
|
71 |
-
'Dark' => 'dark',
|
72 |
-
'Orange' => 'orange',
|
73 |
-
'Simple modern' => 'smodern'
|
74 |
-
);
|
75 |
-
}
|
76 |
-
|
77 |
-
public static function render_feed( $settings ){
|
78 |
-
|
79 |
-
$settings = wp_parse_args( $settings, self::default_settings() );
|
80 |
-
|
81 |
-
$urls = stripslashes( $settings['urls'] );
|
82 |
-
$tab_titles = stripslashes( $settings['tab_titles'] );
|
83 |
-
$count = intval( $settings['count'] );
|
84 |
-
|
85 |
-
$show_date = intval( $settings['show_date'] );
|
86 |
-
$show_desc = intval( $settings['show_desc'] );
|
87 |
-
$show_author = intval( $settings['show_author'] );
|
88 |
-
$show_thumb = stripslashes( $settings['show_thumb'] );
|
89 |
-
$open_newtab = intval( $settings['open_newtab'] );
|
90 |
-
$add_nofollow = intval( $settings['add_nofollow'] );
|
91 |
-
$strip_desc = intval( $settings['strip_desc'] );
|
92 |
-
$strip_title = intval( $settings['strip_title'] );
|
93 |
-
$read_more = htmlspecialchars( $settings['read_more'] );
|
94 |
-
$rich_desc = intval( $settings['rich_desc'] );
|
95 |
-
|
96 |
-
$color_theme = stripslashes( $settings['color_style'] );
|
97 |
-
$enable_ticker = intval( $settings['enable_ticker'] );
|
98 |
-
$visible_items = intval( $settings['visible_items'] );
|
99 |
-
$ticker_speed = intval( $settings['ticker_speed'] ) * 1000;
|
100 |
-
|
101 |
-
if( empty( $urls ) ){
|
102 |
-
return '';
|
103 |
-
}
|
104 |
-
|
105 |
-
$url_delim = strpos( $urls, ',' ) !== false ? ',' : "\n";
|
106 |
-
$tab_title_delim = strpos( $tab_titles, ',' ) !== false ? ',' : "\n";
|
107 |
-
|
108 |
-
$rand = array();
|
109 |
-
$url = explode( $url_delim, $urls );
|
110 |
-
$tab_title = explode( $tab_title_delim, $tab_titles );
|
111 |
-
$url_count = count( $url );
|
112 |
-
|
113 |
-
// Generating the tabs
|
114 |
-
if( $url_count > 1 ){
|
115 |
-
echo '<ul class="srr-tab-wrap srr-tab-style-' . $color_theme . ' srr-clearfix">';
|
116 |
-
for( $i=0; $i < $url_count; $i++ ){
|
117 |
-
|
118 |
-
// Get the Feed URL
|
119 |
-
$feed_url = trim( $url[$i] );
|
120 |
-
$rss = fetch_feed( $feed_url );
|
121 |
-
$rand[$i] = rand(100, 999);
|
122 |
-
|
123 |
-
if( !is_wp_error( $rss ) ){
|
124 |
-
|
125 |
-
if( isset( $tab_title[$i] ) && !empty( $tab_title[$i] ) ){
|
126 |
-
$rss_title = $tab_title[$i];
|
127 |
-
}else{
|
128 |
-
$rss_title = esc_attr( strip_tags( $rss->get_title() ) );
|
129 |
-
}
|
130 |
-
|
131 |
-
echo '<li data-tab="srr-tab-' . $rand[$i] . '">' . $rss_title . '</li>';
|
132 |
-
}else{
|
133 |
-
echo '<li data-tab="srr-tab-' . $rand[$i] . '">Error</li>';
|
134 |
-
}
|
135 |
-
|
136 |
-
}
|
137 |
-
echo '</ul>';
|
138 |
-
}
|
139 |
-
|
140 |
-
// Generating the feed items
|
141 |
-
for( $i=0; $i < $url_count; $i++ ){
|
142 |
-
|
143 |
-
// Get the Feed URL
|
144 |
-
$feed_url = trim( $url[$i] );
|
145 |
-
if( isset( $url[$i] ) ){
|
146 |
-
$rss = fetch_feed( $feed_url );
|
147 |
-
}else{
|
148 |
-
return '';
|
149 |
-
}
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
}
|
154 |
-
|
155 |
-
// Check for feed errors
|
156 |
-
if (!is_wp_error( $rss ) ){
|
157 |
-
$max_items = $rss->get_item_quantity( $count );
|
158 |
-
$rss_items = $rss->get_items( 0, $max_items );
|
159 |
-
$rss_title = esc_attr( strip_tags( $rss->get_title() ) );
|
160 |
-
$rss_desc = esc_attr( strip_tags( $rss->get_description() ) );
|
161 |
-
}else{
|
162 |
-
echo '<div class="srr-wrap srr-style-' . $color_theme .'" data-id="srr-tab-' . $rand[$i] . '"><p>RSS Error: ' . $rss->get_error_message() . '</p></div>';
|
163 |
-
continue;
|
164 |
-
}
|
165 |
-
|
166 |
-
$randAttr = isset($rand[$i]) ? ' data-id="srr-tab-' . $rand[$i] . '" ' : '';
|
167 |
-
|
168 |
-
// Outer Wrap start
|
169 |
-
echo '<div class="srr-wrap ' . (($enable_ticker == 1 ) ? 'srr-vticker' : '' ) . ' srr-style-' . $color_theme . '" data-visible="' . $visible_items . '" data-speed="' . $ticker_speed . '"' . $randAttr . '><div>';
|
170 |
-
|
171 |
-
// Check feed items
|
172 |
-
if ($max_items == 0){
|
173 |
-
echo '<div>No items.</div>';
|
174 |
-
}else{
|
175 |
-
$j=1;
|
176 |
-
// Loop through each feed item
|
177 |
-
foreach ($rss_items as $item){
|
178 |
-
|
179 |
-
// Getting link
|
180 |
-
$link = $item->get_link();
|
181 |
-
while ( stristr( $link, 'http' ) != $link ){ $link = substr( $link, 1 ); }
|
182 |
-
$link = esc_url(strip_tags($link));
|
183 |
-
|
184 |
-
// Getting title
|
185 |
-
$title = esc_attr(strip_tags($item->get_title()));
|
186 |
-
if ( empty($title) )
|
187 |
-
$title = __('No Title');
|
188 |
-
|
189 |
-
if( $strip_title != 0 ){
|
190 |
-
$titleLen = strlen($title);
|
191 |
-
$title = wp_html_excerpt( $title, $strip_title );
|
192 |
-
$title = ($titleLen > $strip_title) ? $title . ' ...' : $title;
|
193 |
-
}
|
194 |
-
|
195 |
-
// Open links in new tab
|
196 |
-
$new_tab = ($open_newtab) ? ' target="_blank"' : '';
|
197 |
-
|
198 |
-
// Add no follow attribute
|
199 |
-
$no_follow = ($add_nofollow) ? ' rel="nofollow"' : '';
|
200 |
-
|
201 |
-
// Getting date
|
202 |
-
$date = $item->get_date('j F Y');
|
203 |
-
|
204 |
-
// Getting thumbnail if present @since v2.2
|
205 |
-
$thumb = '';
|
206 |
-
if ($show_thumb == 1 && $enclosure = $item->get_enclosure()){
|
207 |
-
$thumb_url = $enclosure->get_thumbnail();
|
208 |
-
if(!empty($thumb_url))
|
209 |
-
$thumb = '<img src="' . $thumb_url . '" alt="' . $title . '" class="srr-thumb" align="left"/>';
|
210 |
-
}
|
211 |
-
|
212 |
-
// Getting description
|
213 |
-
$desc = '';
|
214 |
-
if( $rich_desc == 1 ){
|
215 |
-
$desc = strip_tags( str_replace( 'eval', '', $item->get_description() ) , '<p><a><img><em><strong><font><strike><s><u><i>');
|
216 |
-
|
217 |
-
}else{
|
218 |
-
$read_more = '';
|
219 |
-
$desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
220 |
-
if($strip_desc != 0){
|
221 |
-
$desc = wp_html_excerpt( $desc, $strip_desc );
|
222 |
-
$read_more = ( !empty( $read_more ) ) ? '<a href="' . $link . '" title="Read more"' . $new_tab . $no_follow . '>' . $read_more . '</a>' : '';
|
223 |
-
|
224 |
-
if ( '[...]' == substr( $desc, -5 ) )
|
225 |
-
$desc = substr( $desc, 0, -5 );
|
226 |
-
elseif ( '[…]' != substr( $desc, -10 ) )
|
227 |
-
$desc .= '';
|
228 |
-
|
229 |
-
$desc = esc_html( $desc );
|
230 |
-
}
|
231 |
-
|
232 |
-
$desc = $thumb . $desc . ' ' . $read_more;
|
233 |
-
|
234 |
-
}
|
235 |
-
|
236 |
-
// Getting the author
|
237 |
-
$author = $item->get_author();
|
238 |
-
if ( is_object($author) ) {
|
239 |
-
$author = $author->get_name();
|
240 |
-
$author = esc_html(strip_tags($author));
|
241 |
-
}
|
242 |
-
|
243 |
-
echo "\n\t";
|
244 |
-
|
245 |
-
// Display the feed items
|
246 |
-
echo '<div class="srr-item ' . (($j%2 == 0) ? 'even' : 'odd') . '">';
|
247 |
-
echo '<div class="srr-title"><a href="' . $link . '"' . $new_tab . $no_follow . ' title="Posted on ' . $date . '">' . $title . '</a></div>';
|
248 |
-
echo '<div class="srr-meta">';
|
249 |
-
|
250 |
-
if($show_date && !empty($date))
|
251 |
-
echo '<time class="srr-date">' . $date . '</time>';
|
252 |
-
|
253 |
-
if($show_author && !empty($author))
|
254 |
-
echo ' - <cite class="srr-author">' . $author . '</cite>';
|
255 |
-
|
256 |
-
echo '</div>';
|
257 |
-
|
258 |
-
if($show_desc)
|
259 |
-
echo '<p class="srr-summary srr-clearfix">' . $desc . '</p>';
|
260 |
-
|
261 |
-
echo '</div>';
|
262 |
-
// End display
|
263 |
-
|
264 |
-
$j++;
|
265 |
-
}
|
266 |
-
}
|
267 |
-
|
268 |
-
// Outer wrap end
|
269 |
-
echo "\n\n</div>
|
270 |
-
</div>\n\n" ;
|
271 |
-
|
272 |
-
if ( !is_wp_error($rss) )
|
273 |
-
$rss->__destruct();
|
274 |
-
|
275 |
-
unset($rss);
|
276 |
-
|
277 |
-
}
|
278 |
|
279 |
}
|
280 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Contains the widget admin and its registration
|
4 |
+
*
|
5 |
*/
|
6 |
|
7 |
if( ! defined( 'ABSPATH' ) ) exit;
|
10 |
|
11 |
public static function init(){
|
12 |
|
13 |
+
add_action( 'widgets_init', array( __CLASS__, 'init_widget' ) );
|
14 |
|
15 |
+
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'public_scripts' ) );
|
16 |
|
17 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_scripts' ) );
|
18 |
|
19 |
}
|
20 |
|
35 |
public static function admin_scripts( $hook ){
|
36 |
|
37 |
if( $hook == 'widgets.php' ){
|
38 |
+
wp_enqueue_style( 'srr_admin_css', SRR_URL . 'admin/css/style.css', array(), SRR_VERSION );
|
39 |
+
wp_enqueue_script( 'srr_admin_js', SRR_URL . 'admin/js/script.js', array( 'jquery' ), SRR_VERSION );
|
40 |
}
|
41 |
|
42 |
}
|
43 |
|
44 |
+
public static function render_feed( $options ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
$feed = new SRR_Feed( $options );
|
47 |
+
echo $feed->html();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
}
|
50 |
|
public/css/style.css
CHANGED
@@ -1,150 +1,159 @@
|
|
1 |
-
/**
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
**/
|
7 |
|
8 |
/** Tab settings **/
|
9 |
.srr-tab-wrap{
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
}
|
15 |
.srr-tab-wrap li{
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
}
|
26 |
.srr-active-tab{
|
27 |
-
|
28 |
-
|
29 |
}
|
30 |
|
31 |
/** General styling **/
|
32 |
.srr-wrap{
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
}
|
37 |
.srr-wrap div{
|
38 |
-
|
39 |
-
|
40 |
}
|
41 |
.srr-wrap .srr-item{
|
42 |
-
|
43 |
-
|
44 |
}
|
45 |
.srr-wrap .srr-item:last-child{
|
46 |
-
|
47 |
}
|
48 |
.srr-wrap .srr-item > *{
|
49 |
-
|
50 |
}
|
51 |
.srr-wrap .srr-title, .srr-wrap .srr-meta{
|
52 |
-
|
53 |
}
|
54 |
.srr-wrap .srr-thumb{
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
/** Styles **/
|
61 |
|
62 |
/** None **/
|
63 |
.srr-style-none .srr-item{
|
64 |
-
|
65 |
}
|
66 |
|
67 |
/** Grey **/
|
68 |
.srr-style-grey{
|
69 |
-
|
70 |
}
|
71 |
.srr-style-grey .srr-item{
|
72 |
-
|
73 |
}
|
74 |
.srr-style-grey .even{
|
75 |
-
|
76 |
}
|
77 |
|
78 |
/** Dark **/
|
79 |
.srr-style-dark{
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
}
|
84 |
.srr-style-dark a{
|
85 |
-
|
86 |
}
|
87 |
.srr-style-dark .srr-item{
|
88 |
-
|
89 |
}
|
90 |
.srr-style-dark .even{
|
91 |
-
|
92 |
}
|
93 |
.srr-tab-style-dark li{
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
}
|
98 |
.srr-tab-style-dark .srr-active-tab{
|
99 |
-
|
100 |
}
|
101 |
|
102 |
/** Orange **/
|
103 |
|
104 |
.srr-style-orange{
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
}
|
111 |
.srr-style-orange .srr-item{
|
112 |
-
|
113 |
}
|
114 |
.srr-tab-style-orange li{
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
}
|
119 |
.srr-tab-style-orange .srr-active-tab{
|
120 |
-
|
121 |
-
|
122 |
}
|
123 |
|
124 |
/** Simple modern **/
|
125 |
|
126 |
.srr-style-smodern{
|
127 |
-
|
128 |
}
|
129 |
.srr-style-smodern .srr-item{
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
}
|
135 |
.srr-style-smodern:hover .srr-item{
|
136 |
-
|
137 |
}
|
138 |
.srr-style-smodern .srr-item:hover{
|
139 |
-
|
140 |
}
|
141 |
.srr-tab-style-smodern .srr-active-tab{
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
}
|
146 |
.srr-style-smodern .even{
|
147 |
-
|
148 |
}
|
149 |
|
150 |
/** Clearfix hack **/
|
1 |
+
/**
|
2 |
+
* Super RSS Reader - Styles file
|
3 |
+
* Version: 1.6
|
4 |
+
*
|
5 |
+
**/
|
|
|
6 |
|
7 |
/** Tab settings **/
|
8 |
.srr-tab-wrap{
|
9 |
+
margin: 5px 0px 10px!important;
|
10 |
+
background: none !important;
|
11 |
+
border: none !important;
|
12 |
+
padding: 0px !important;
|
13 |
}
|
14 |
.srr-tab-wrap li{
|
15 |
+
list-style: none !important;
|
16 |
+
float: left;
|
17 |
+
background-image: none !important;
|
18 |
+
background-color: #fff;
|
19 |
+
margin: 5px 5px 0px 0px !important;
|
20 |
+
padding: 3px 10px!important;
|
21 |
+
border-radius: 3px;
|
22 |
+
border: 1px solid #ccc;
|
23 |
+
cursor: pointer;
|
24 |
}
|
25 |
.srr-active-tab{
|
26 |
+
background: #333 !important;
|
27 |
+
color: white !important;
|
28 |
}
|
29 |
|
30 |
/** General styling **/
|
31 |
.srr-wrap{
|
32 |
+
padding: 0px !important;
|
33 |
+
max-width: 100%;
|
34 |
+
min-width: 100% !important;
|
35 |
}
|
36 |
.srr-wrap div{
|
37 |
+
left: 0px;
|
38 |
+
right: 0px;
|
39 |
}
|
40 |
.srr-wrap .srr-item{
|
41 |
+
border-top: 0px;
|
42 |
+
padding: 10px;
|
43 |
}
|
44 |
.srr-wrap .srr-item:last-child{
|
45 |
+
margin: 0px;
|
46 |
}
|
47 |
.srr-wrap .srr-item > *{
|
48 |
+
margin-bottom: 10px !important;
|
49 |
}
|
50 |
.srr-wrap .srr-title, .srr-wrap .srr-meta{
|
51 |
+
line-height: 150%;
|
52 |
}
|
53 |
.srr-wrap .srr-thumb{
|
54 |
+
width: 64px !important;
|
55 |
+
margin: 10px 10px 0 0 !important;
|
56 |
+
float: left !important;
|
57 |
+
}
|
58 |
+
.srr-wrap .srr-summary p:last-child {
|
59 |
+
margin-bottom: 0;
|
60 |
+
}
|
61 |
+
.srr-wrap .srr-summary img {
|
62 |
+
width: 100%;
|
63 |
+
margin: 0 0 1em 0;
|
64 |
+
}
|
65 |
+
.srr-wrap .srr-summary a{
|
66 |
+
margin: 0 !important;
|
67 |
}
|
68 |
|
69 |
/** Styles **/
|
70 |
|
71 |
/** None **/
|
72 |
.srr-style-none .srr-item{
|
73 |
+
padding: 0 0 20px 0 !important;
|
74 |
}
|
75 |
|
76 |
/** Grey **/
|
77 |
.srr-style-grey{
|
78 |
+
border: 1px solid #dfdfdf;
|
79 |
}
|
80 |
.srr-style-grey .srr-item{
|
81 |
+
border-bottom: 1px solid #dfdfdf;
|
82 |
}
|
83 |
.srr-style-grey .even{
|
84 |
+
background-color: #F8F8F8;
|
85 |
}
|
86 |
|
87 |
/** Dark **/
|
88 |
.srr-style-dark{
|
89 |
+
background: #000;
|
90 |
+
border: 1px solid #ccc;
|
91 |
+
color: #DDDDDD!important;
|
92 |
}
|
93 |
.srr-style-dark a{
|
94 |
+
color: #FFFFFF !important;
|
95 |
}
|
96 |
.srr-style-dark .srr-item{
|
97 |
+
border-color: #333
|
98 |
}
|
99 |
.srr-style-dark .even{
|
100 |
+
background: #333333;
|
101 |
}
|
102 |
.srr-tab-style-dark li{
|
103 |
+
border-color: #666666;
|
104 |
+
background: #333;
|
105 |
+
color: #FFFFFF !important;
|
106 |
}
|
107 |
.srr-tab-style-dark .srr-active-tab{
|
108 |
+
background: #666666!important;
|
109 |
}
|
110 |
|
111 |
/** Orange **/
|
112 |
|
113 |
.srr-style-orange{
|
114 |
+
border: 2px solid #FF9900;
|
115 |
+
-webkit-border-radius: 5px;
|
116 |
+
border-radius: 5px;
|
117 |
+
-webkit-box-shadow: inset 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
|
118 |
+
box-shadow: inset 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
|
119 |
}
|
120 |
.srr-style-orange .srr-item{
|
121 |
+
border-bottom: 1px solid #FF9900;
|
122 |
}
|
123 |
.srr-tab-style-orange li{
|
124 |
+
border-color: #FF9900;
|
125 |
+
background: #FFF8EC;
|
126 |
+
color: #333333 !important;
|
127 |
}
|
128 |
.srr-tab-style-orange .srr-active-tab{
|
129 |
+
background: #FF9900!important;
|
130 |
+
color: #FFFFFF !important;
|
131 |
}
|
132 |
|
133 |
/** Simple modern **/
|
134 |
|
135 |
.srr-style-smodern{
|
136 |
+
border: 0;
|
137 |
}
|
138 |
.srr-style-smodern .srr-item{
|
139 |
+
border-radius: 10px;
|
140 |
+
border: 0;
|
141 |
+
-webkit-transition: opacity 1s;
|
142 |
+
-moz-transition: opacity 1s;
|
143 |
}
|
144 |
.srr-style-smodern:hover .srr-item{
|
145 |
+
opacity: 0.3;
|
146 |
}
|
147 |
.srr-style-smodern .srr-item:hover{
|
148 |
+
opacity: 1;
|
149 |
}
|
150 |
.srr-tab-style-smodern .srr-active-tab{
|
151 |
+
color: #000 !important;
|
152 |
+
background: #fff !important;
|
153 |
+
box-shadow: inset 0 0 5px #747474;
|
154 |
}
|
155 |
.srr-style-smodern .even{
|
156 |
+
background: #f8f8f8;
|
157 |
}
|
158 |
|
159 |
/** Clearfix hack **/
|
public/css/style.min.css
CHANGED
@@ -1,7 +1 @@
|
|
1 |
-
|
2 |
-
* Super RSS Reader - Styles file
|
3 |
-
* Author: Aakash Chakravarthy
|
4 |
-
* Version: 1.5
|
5 |
-
*
|
6 |
-
**/
|
7 |
-
.srr-tab-wrap{margin:5px 0 10px!important;background:none!important;border:none!important;padding:0!important}.srr-tab-wrap li{list-style:none!important;float:left;background-image:none!important;background-color:#fff;margin:5px 5px 0 0!important;padding:3px 10px!important;border-radius:3px;border:1px solid #ccc;cursor:pointer}.srr-active-tab{background:#333!important;color:white!important}.srr-wrap{padding:0!important;max-width:100%;min-width:100%!important}.srr-wrap div{left:0;right:0}.srr-wrap .srr-item{border-top:0;padding:10px}.srr-wrap .srr-item:last-child{margin:0}.srr-wrap .srr-item > *{margin-bottom:10px!important}.srr-wrap .srr-title,.srr-wrap .srr-meta{line-height:150%}.srr-wrap .srr-thumb{width:64px!important;margin:5px 10px 0 0!important;float:left!important}.srr-style-none .srr-item{padding:0 0 20px 0!important}.srr-style-grey{border:1px solid #dfdfdf}.srr-style-grey .srr-item{border-bottom:1px solid #dfdfdf}.srr-style-grey .even{background-color:#F8F8F8}.srr-style-dark{background:#000;border:1px solid #ccc;color:#DDD!important}.srr-style-dark a{color:#FFF!important}.srr-style-dark .srr-item{border-color:#333}.srr-style-dark .even{background:#333}.srr-tab-style-dark li{border-color:#666;background:#333;color:#FFF!important}.srr-tab-style-dark .srr-active-tab{background:#666!important}.srr-style-orange{border:2px solid #F90;-webkit-border-radius:5px;border-radius:5px;-webkit-box-shadow:inset 0 2px 6px 0 rgba(0,0,0,0.3);box-shadow:inset 0 2px 6px 0 rgba(0,0,0,0.3)}.srr-style-orange .srr-item{border-bottom:1px solid #F90}.srr-tab-style-orange li{border-color:#F90;background:#FFF8EC;color:#333!important}.srr-tab-style-orange .srr-active-tab{background:#F90!important;color:#FFF!important}.srr-style-smodern{border:0}.srr-style-smodern .srr-item{border-radius:10px;border:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s}.srr-style-smodern:hover .srr-item{opacity:0.3}.srr-style-smodern .srr-item:hover{opacity:1}.srr-tab-style-smodern .srr-active-tab{color:#000!important;background:#fff!important;box-shadow:inset 0 0 5px #747474}.srr-style-smodern .even{background:#f8f8f8}* html .srr-clearfix{height:1%;overflow:visible}*+html .srr-clearfix{min-height:1%}.srr-clearfix:after{clear:both;content:".";display:block;height:0;visibility:hidden;font-size:0}
|
1 |
+
.srr-tab-wrap{margin:5px 0 10px!important;background:0 0!important;border:none!important;padding:0!important}.srr-tab-wrap li{list-style:none!important;float:left;background-image:none!important;background-color:#fff;margin:5px 5px 0 0!important;padding:3px 10px!important;border-radius:3px;border:1px solid #ccc;cursor:pointer}.srr-active-tab{background:#333!important;color:#fff!important}.srr-wrap{padding:0!important;max-width:100%;min-width:100%!important}.srr-wrap div{left:0;right:0}.srr-wrap .srr-item{border-top:0;padding:10px}.srr-wrap .srr-item:last-child{margin:0}.srr-wrap .srr-item>*{margin-bottom:10px!important}.srr-wrap .srr-meta,.srr-wrap .srr-title{line-height:150%}.srr-wrap .srr-thumb{width:64px!important;margin:10px 10px 0 0!important;float:left!important}.srr-wrap .srr-summary p:last-child{margin-bottom:0}.srr-wrap .srr-summary img{width:100%;margin:0 0 1em 0}.srr-wrap .srr-summary a{margin:0!important}.srr-style-none .srr-item{padding:0 0 20px 0!important}.srr-style-grey{border:1px solid #dfdfdf}.srr-style-grey .srr-item{border-bottom:1px solid #dfdfdf}.srr-style-grey .even{background-color:#f8f8f8}.srr-style-dark{background:#000;border:1px solid #ccc;color:#ddd!important}.srr-style-dark a{color:#fff!important}.srr-style-dark .srr-item{border-color:#333}.srr-style-dark .even{background:#333}.srr-tab-style-dark li{border-color:#666;background:#333;color:#fff!important}.srr-tab-style-dark .srr-active-tab{background:#666!important}.srr-style-orange{border:2px solid #f90;-webkit-border-radius:5px;border-radius:5px;-webkit-box-shadow:inset 0 2px 6px 0 rgba(0,0,0,.3);box-shadow:inset 0 2px 6px 0 rgba(0,0,0,.3)}.srr-style-orange .srr-item{border-bottom:1px solid #f90}.srr-tab-style-orange li{border-color:#f90;background:#fff8ec;color:#333!important}.srr-tab-style-orange .srr-active-tab{background:#f90!important;color:#fff!important}.srr-style-smodern{border:0}.srr-style-smodern .srr-item{border-radius:10px;border:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s}.srr-style-smodern:hover .srr-item{opacity:.3}.srr-style-smodern .srr-item:hover{opacity:1}.srr-tab-style-smodern .srr-active-tab{color:#000!important;background:#fff!important;box-shadow:inset 0 0 5px #747474}.srr-style-smodern .even{background:#f8f8f8}* html .srr-clearfix{height:1%;overflow:visible}.srr-clearfix:after{clear:both;content:".";display:block;height:0;visibility:hidden;font-size:0}
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
|
2 |
Contributors: vaakash
|
3 |
Author URI: https://www.aakashweb.com/
|
4 |
Plugin URI: https://www.aakashweb.com/wordpress-plugins/super-rss-reader/
|
5 |
-
Tags: rss,
|
6 |
License: GPLv2 or later
|
7 |
Donate Link: https://www.paypal.me/vaakash
|
8 |
Requires at least: 2.8
|
9 |
Requires PHP: 5.3
|
10 |
-
Tested up to: 5.
|
11 |
-
Stable tag: 3.
|
12 |
|
13 |
A plugin to display RSS feed(s) in widget with news ticker effect in multiple tabbed feeds, thumbnails, customizable color themes and more.
|
14 |
|
15 |
-
|
16 |
|
17 |
Super RSS Reader is a RSS reader widget which displays the RSS feeds in an attractive way. It displays the multiple RSS feeds and adds a news ticker like effect to them. Multiple RSS feeds can be added to a single widget in separate tabs.
|
18 |
|
@@ -20,24 +20,24 @@ The plugin is fully customizable with external styles and with some inbuilt colo
|
|
20 |
|
21 |
[Check out the **LIVE DEMO** of the plugin](https://www.aakashweb.com/demos/super-rss-reader/)
|
22 |
|
23 |
-
|
24 |
|
25 |
* **News ticker** like effect to the RSS feeds (can turn off or on)
|
26 |
-
* Display feeds in **multiple tabs
|
27 |
* Display **thumbnail** to the feed items if available.
|
28 |
-
* Select **color
|
29 |
* Customizable ticker speed.
|
30 |
* Supports RSS or atom feed.
|
31 |
-
* Can
|
32 |
|
33 |
[youtube=https://www.youtube.com/watch?v=02aOG_-98Tg]
|
34 |
|
35 |
-
|
36 |
|
37 |
-
* [FAQs](https://www.aakashweb.com/docs/super-rss-reader
|
38 |
* [Support forum](https://www.aakashweb.com/forum/discuss/wordpress-plugins/super-rss-reader/)
|
39 |
|
40 |
-
|
41 |
|
42 |
Download and upload the latest version of Super RSS Reader,
|
43 |
|
@@ -47,21 +47,21 @@ Download and upload the latest version of Super RSS Reader,
|
|
47 |
1. Input a RSS feed URL to the widget, tweak some settings and you are,
|
48 |
1. Done !
|
49 |
|
50 |
-
|
51 |
|
52 |
-
|
53 |
|
54 |
Super RSS Reader uses WordPress's default feed reading module. By default WordPress caches the RSS feed for 12 hours.
|
55 |
|
56 |
You can change this default value by adding the below code to your theme's function.php file.
|
57 |
|
58 |
-
`add_filter( 'wp_feed_cache_transient_lifetime',
|
59 |
|
60 |
Here 600 indicates 10 minutes in seconds. Please note that setting lower value will increase the load on the server to refresh the RSS cache.
|
61 |
|
62 |
You can also refer this post https://wordpress.org/support/topic/rss-not-updating-no-matter-which-plugin-i-try/#post-10123881 to change the refresh time for particular feed URL.
|
63 |
|
64 |
-
|
65 |
|
66 |
You can use the `super-rss-reader-widget` class in your stylesheet to control the widget styling. Other classes are,
|
67 |
|
@@ -70,23 +70,23 @@ You can use the `super-rss-reader-widget` class in your stylesheet to control th
|
|
70 |
1. `srr-item.odd` - to control the odd feed items.
|
71 |
1. `srr-item.even` - to control the even feed items.
|
72 |
|
73 |
-
|
74 |
|
75 |
No, Super RSS Reader only supports vertical support feature for now.
|
76 |
|
77 |
-
|
78 |
|
79 |
Just enter the RSS feed URLs separated by comma in the widget, the plugin automatically renders the tab.
|
80 |
|
81 |
-
|
82 |
|
83 |
By default the plugin shows fields like title, author, description, thumbnail. Other fields are not supported for now.
|
84 |
|
85 |
-
|
86 |
|
87 |
The size of the ticker library is only 2.5 KB.
|
88 |
|
89 |
-
|
90 |
|
91 |
1. Example Super RSS Reader widgets shown in the sidebar, having a ticker effect and a tabbed mode.
|
92 |
1. Plugin working in different themes and RSS feeds.
|
@@ -95,49 +95,58 @@ The size of the ticker library is only 2.5 KB.
|
|
95 |
|
96 |
[Live Working demo](https://www.aakashweb.com/demos/super-rss-reader/)
|
97 |
|
98 |
-
|
99 |
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
* Fix: Settings not being saved.
|
102 |
* New: Updated the ticker library to the latest.
|
103 |
* Fix: Added cache buster to JS and CSS files.
|
104 |
* Fix: Upon tab change, sometimes ticker height gets to 0;
|
105 |
|
106 |
-
|
107 |
* New: Plugin code is refactored.
|
108 |
* New: Options are reorganized for easy configuration.
|
109 |
* Fix: Minor UI changes.
|
110 |
* Fix: Certain PHP notices on saving widget settings.
|
111 |
|
112 |
-
|
113 |
* New: jQuery ticker script is now loaded locally.
|
114 |
* Fix: Minor style adjustments to the admin widget.
|
115 |
|
116 |
-
|
117 |
* New: Support for "no follow" attribute in links.
|
118 |
* Fix: Readme with updated FAQ.
|
119 |
|
120 |
-
|
121 |
* New: Ability to set fixed height for the RSS widget.
|
122 |
* New: Using minified JavaScript on frontend.
|
123 |
* Fix: Cleaned widget UI, reordered options.
|
124 |
* Fix: Code refactoring.
|
125 |
|
126 |
-
|
127 |
* Added feature to change individual tab titles/names.
|
128 |
* Added feature to enable rich or full description.
|
129 |
* Fixed feed ordering issues.
|
130 |
* Updated jQuery easy ticker plugin to v2.0.
|
131 |
* Minor code revisions.
|
132 |
|
133 |
-
|
134 |
* Added feature to cut down/strip feed titles.
|
135 |
* Added a new 'Simple modern' color style.
|
136 |
|
137 |
-
|
138 |
* Fixed incompatibility of other jQuery plugins due to the usage of the latest version of jQuery.
|
139 |
|
140 |
-
|
141 |
* Displays "thumbnail" of the feed item if available.
|
142 |
* Added setting to change ticker speed.
|
143 |
* Added setting to edit the "Read more" text.
|
@@ -145,27 +154,22 @@ The size of the ticker library is only 2.5 KB.
|
|
145 |
* Switched to full size ticker code.
|
146 |
* Core code revised.
|
147 |
|
148 |
-
|
149 |
* Added option to open links in new window.
|
150 |
* Changed the method to include the scripts and styles.
|
151 |
* Added a new 'Orange' color style.
|
152 |
|
153 |
-
|
154 |
* Core code is completely rewritten.
|
155 |
* Flash RSS Reader is removed and instead jQuery is used.
|
156 |
* Administration panel used in the previous version is removed and settings are configured in the widget itself.
|
157 |
|
158 |
-
|
159 |
* Second version with included CSS and Proxy file (loadXML.php).
|
160 |
|
161 |
-
|
162 |
* Initial version with a flash RSS Reader
|
163 |
|
164 |
-
|
165 |
-
|
166 |
-
Version 2.0 is a major and recommended upgrade for previous version users.
|
167 |
-
|
168 |
-
== Credits ==
|
169 |
|
170 |
-
|
171 |
-
* The news ticker effect is powered by [jQuery Easy ticker plugin](https://www.aakashweb.com/jquery-plugins/easy-ticker/)
|
1 |
+
# Super RSS Reader - Add attractive RSS Feed Widget
|
2 |
Contributors: vaakash
|
3 |
Author URI: https://www.aakashweb.com/
|
4 |
Plugin URI: https://www.aakashweb.com/wordpress-plugins/super-rss-reader/
|
5 |
+
Tags: rss, widget, ticker, feed, news, twitter, admin, plugin, posts, page, thumbnail, atom
|
6 |
License: GPLv2 or later
|
7 |
Donate Link: https://www.paypal.me/vaakash
|
8 |
Requires at least: 2.8
|
9 |
Requires PHP: 5.3
|
10 |
+
Tested up to: 5.5.1
|
11 |
+
Stable tag: 3.2
|
12 |
|
13 |
A plugin to display RSS feed(s) in widget with news ticker effect in multiple tabbed feeds, thumbnails, customizable color themes and more.
|
14 |
|
15 |
+
## Description
|
16 |
|
17 |
Super RSS Reader is a RSS reader widget which displays the RSS feeds in an attractive way. It displays the multiple RSS feeds and adds a news ticker like effect to them. Multiple RSS feeds can be added to a single widget in separate tabs.
|
18 |
|
20 |
|
21 |
[Check out the **LIVE DEMO** of the plugin](https://www.aakashweb.com/demos/super-rss-reader/)
|
22 |
|
23 |
+
### Features
|
24 |
|
25 |
* **News ticker** like effect to the RSS feeds (can turn off or on)
|
26 |
+
* Display feeds in **multiple tabs**.
|
27 |
* Display **thumbnail** to the feed items if available.
|
28 |
+
* Select **color styles** for widget. Customizable via CSS.
|
29 |
* Customizable ticker speed.
|
30 |
* Supports RSS or atom feed.
|
31 |
+
* Can trim title and description text of the feed item.
|
32 |
|
33 |
[youtube=https://www.youtube.com/watch?v=02aOG_-98Tg]
|
34 |
|
35 |
+
### Resources
|
36 |
|
37 |
+
* [FAQs](https://www.aakashweb.com/docs/super-rss-reader/faq/)
|
38 |
* [Support forum](https://www.aakashweb.com/forum/discuss/wordpress-plugins/super-rss-reader/)
|
39 |
|
40 |
+
## Installation
|
41 |
|
42 |
Download and upload the latest version of Super RSS Reader,
|
43 |
|
47 |
1. Input a RSS feed URL to the widget, tweak some settings and you are,
|
48 |
1. Done !
|
49 |
|
50 |
+
## Frequently Asked Questions
|
51 |
|
52 |
+
### My RSS feed is not refreshing !
|
53 |
|
54 |
Super RSS Reader uses WordPress's default feed reading module. By default WordPress caches the RSS feed for 12 hours.
|
55 |
|
56 |
You can change this default value by adding the below code to your theme's function.php file.
|
57 |
|
58 |
+
`add_filter( 'wp_feed_cache_transient_lifetime', function($a) { return 600; } );`
|
59 |
|
60 |
Here 600 indicates 10 minutes in seconds. Please note that setting lower value will increase the load on the server to refresh the RSS cache.
|
61 |
|
62 |
You can also refer this post https://wordpress.org/support/topic/rss-not-updating-no-matter-which-plugin-i-try/#post-10123881 to change the refresh time for particular feed URL.
|
63 |
|
64 |
+
### How can I customize the RSS widget via CSS styles ?
|
65 |
|
66 |
You can use the `super-rss-reader-widget` class in your stylesheet to control the widget styling. Other classes are,
|
67 |
|
70 |
1. `srr-item.odd` - to control the odd feed items.
|
71 |
1. `srr-item.even` - to control the even feed items.
|
72 |
|
73 |
+
### Does this plugin support horizontal ticker ?
|
74 |
|
75 |
No, Super RSS Reader only supports vertical support feature for now.
|
76 |
|
77 |
+
### How to create a tabbed mode or multiple feeds ?
|
78 |
|
79 |
Just enter the RSS feed URLs separated by comma in the widget, the plugin automatically renders the tab.
|
80 |
|
81 |
+
### What fields are shown in the feed output by default ?
|
82 |
|
83 |
By default the plugin shows fields like title, author, description, thumbnail. Other fields are not supported for now.
|
84 |
|
85 |
+
### How big is the ticker library ?
|
86 |
|
87 |
The size of the ticker library is only 2.5 KB.
|
88 |
|
89 |
+
## Screenshots
|
90 |
|
91 |
1. Example Super RSS Reader widgets shown in the sidebar, having a ticker effect and a tabbed mode.
|
92 |
1. Plugin working in different themes and RSS feeds.
|
95 |
|
96 |
[Live Working demo](https://www.aakashweb.com/demos/super-rss-reader/)
|
97 |
|
98 |
+
## Changelog
|
99 |
|
100 |
+
### 3.2
|
101 |
+
* Fix: Read more link not present
|
102 |
+
* New: Widgets settings is now clean and easy to use.
|
103 |
+
* New: Thumbnail and description can now be displayed separately.
|
104 |
+
* New: Description and title text are now trimmed by "words" instead of "characters".
|
105 |
+
* New: `Enable ticker` option is now replaced with `Display type`.
|
106 |
+
* Fix: Refactor code.
|
107 |
+
* Fix: Undefined index notice upon saving the widget.
|
108 |
+
|
109 |
+
### 3.1
|
110 |
* Fix: Settings not being saved.
|
111 |
* New: Updated the ticker library to the latest.
|
112 |
* Fix: Added cache buster to JS and CSS files.
|
113 |
* Fix: Upon tab change, sometimes ticker height gets to 0;
|
114 |
|
115 |
+
### 3.0
|
116 |
* New: Plugin code is refactored.
|
117 |
* New: Options are reorganized for easy configuration.
|
118 |
* Fix: Minor UI changes.
|
119 |
* Fix: Certain PHP notices on saving widget settings.
|
120 |
|
121 |
+
### 2.8
|
122 |
* New: jQuery ticker script is now loaded locally.
|
123 |
* Fix: Minor style adjustments to the admin widget.
|
124 |
|
125 |
+
### 2.7
|
126 |
* New: Support for "no follow" attribute in links.
|
127 |
* Fix: Readme with updated FAQ.
|
128 |
|
129 |
+
### 2.6
|
130 |
* New: Ability to set fixed height for the RSS widget.
|
131 |
* New: Using minified JavaScript on frontend.
|
132 |
* Fix: Cleaned widget UI, reordered options.
|
133 |
* Fix: Code refactoring.
|
134 |
|
135 |
+
### 2.5
|
136 |
* Added feature to change individual tab titles/names.
|
137 |
* Added feature to enable rich or full description.
|
138 |
* Fixed feed ordering issues.
|
139 |
* Updated jQuery easy ticker plugin to v2.0.
|
140 |
* Minor code revisions.
|
141 |
|
142 |
+
### 2.4
|
143 |
* Added feature to cut down/strip feed titles.
|
144 |
* Added a new 'Simple modern' color style.
|
145 |
|
146 |
+
### 2.3
|
147 |
* Fixed incompatibility of other jQuery plugins due to the usage of the latest version of jQuery.
|
148 |
|
149 |
+
### 2.2
|
150 |
* Displays "thumbnail" of the feed item if available.
|
151 |
* Added setting to change ticker speed.
|
152 |
* Added setting to edit the "Read more" text.
|
154 |
* Switched to full size ticker code.
|
155 |
* Core code revised.
|
156 |
|
157 |
+
### 2.1
|
158 |
* Added option to open links in new window.
|
159 |
* Changed the method to include the scripts and styles.
|
160 |
* Added a new 'Orange' color style.
|
161 |
|
162 |
+
### 2.0
|
163 |
* Core code is completely rewritten.
|
164 |
* Flash RSS Reader is removed and instead jQuery is used.
|
165 |
* Administration panel used in the previous version is removed and settings are configured in the widget itself.
|
166 |
|
167 |
+
### 0.8
|
168 |
* Second version with included CSS and Proxy file (loadXML.php).
|
169 |
|
170 |
+
### 0.5
|
171 |
* Initial version with a flash RSS Reader
|
172 |
|
173 |
+
## Upgrade Notice
|
|
|
|
|
|
|
|
|
174 |
|
175 |
+
Version 2.0 is a major and recommended upgrade for previous version users.
|
|
super-rss-reader.php
CHANGED
@@ -6,12 +6,12 @@
|
|
6 |
* Description: Super RSS Reader is jQuery based RSS reader widget, which displays the RSS feeds in the widget in an attractive way. It uses the jQuery easy ticker plugin to add a news ticker like effect to the RSS feeds. Multiple RSS feeds can be added for a single widget and they get separated in tabs.
|
7 |
* Author: Aakash Chakravarthy
|
8 |
* Author URI: https://www.aakashweb.com/
|
9 |
-
* Version: 3.
|
10 |
* Text Domain: super-rss-reader
|
11 |
* Domain Path: /languages
|
12 |
*/
|
13 |
|
14 |
-
define( 'SRR_VERSION', '3.
|
15 |
define( 'SRR_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
|
16 |
define( 'SRR_URL', plugin_dir_url( __FILE__ ) );
|
17 |
|
@@ -21,12 +21,14 @@ final class Super_RSS_Reader{
|
|
21 |
|
22 |
self::includes();
|
23 |
|
24 |
-
add_action( 'plugins_loaded', array(
|
25 |
|
26 |
}
|
27 |
|
28 |
public static function includes(){
|
29 |
|
|
|
|
|
30 |
include_once( SRR_PATH . 'includes/widget.php' );
|
31 |
include_once( SRR_PATH . 'includes/widget-admin.php' );
|
32 |
|
6 |
* Description: Super RSS Reader is jQuery based RSS reader widget, which displays the RSS feeds in the widget in an attractive way. It uses the jQuery easy ticker plugin to add a news ticker like effect to the RSS feeds. Multiple RSS feeds can be added for a single widget and they get separated in tabs.
|
7 |
* Author: Aakash Chakravarthy
|
8 |
* Author URI: https://www.aakashweb.com/
|
9 |
+
* Version: 3.2
|
10 |
* Text Domain: super-rss-reader
|
11 |
* Domain Path: /languages
|
12 |
*/
|
13 |
|
14 |
+
define( 'SRR_VERSION', '3.2' );
|
15 |
define( 'SRR_PATH', plugin_dir_path( __FILE__ ) ); // All have trailing slash
|
16 |
define( 'SRR_URL', plugin_dir_url( __FILE__ ) );
|
17 |
|
21 |
|
22 |
self::includes();
|
23 |
|
24 |
+
add_action( 'plugins_loaded', array( __CLASS__, 'load_text_domain' ) );
|
25 |
|
26 |
}
|
27 |
|
28 |
public static function includes(){
|
29 |
|
30 |
+
include_once( SRR_PATH . 'includes/options.php' );
|
31 |
+
include_once( SRR_PATH . 'includes/feed.php' );
|
32 |
include_once( SRR_PATH . 'includes/widget.php' );
|
33 |
include_once( SRR_PATH . 'includes/widget-admin.php' );
|
34 |
|