Version Description
- Displays "thumbnail" of the feed item if available.
- Added setting to change ticker speed.
- Added setting to edit the "Read more" text.
- Default styles are revised.
- Switched to full size ticker code.
- Core code revised.
Download this release
Release Info
Developer | vaakash |
Plugin | Super RSS Reader |
Version | 2.2 |
Comparing to | |
See all releases |
Code changes from version 2.1 to 2.2
- public/srr-css.css +22 -7
- public/srr-js.dev.js +0 -213
- public/srr-js.js +211 -3
- readme.txt +20 -9
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- super-rss-reader.php +78 -36
public/srr-css.css
CHANGED
@@ -9,14 +9,16 @@
|
|
9 |
list-style: none !important;
|
10 |
float: left;
|
11 |
background-image: none !important;
|
12 |
-
background-color: #
|
13 |
margin: 5px 5px 0px 0px !important;
|
14 |
-
padding: 3px!important;
|
15 |
-
border:
|
|
|
16 |
cursor: pointer;
|
17 |
}
|
18 |
.srr-active-tab{
|
19 |
-
background: #
|
|
|
20 |
}
|
21 |
|
22 |
/** General styling **/
|
@@ -34,9 +36,25 @@
|
|
34 |
.srr-wrap .srr-item:last-child{
|
35 |
margin: 0px;
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
/** Styles **/
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
/** Grey **/
|
41 |
.srr-style-grey{
|
42 |
border: 1px solid #dfdfdf;
|
@@ -84,9 +102,6 @@
|
|
84 |
.srr-style-orange .srr-item{
|
85 |
border-bottom: 1px solid #FF9900;
|
86 |
}
|
87 |
-
.srr-tab-style-orange{
|
88 |
-
margin: 0px 0px -1px 5px !important;
|
89 |
-
}
|
90 |
.srr-tab-style-orange li{
|
91 |
border-color: #FF9900;
|
92 |
background: #FFF8EC;
|
9 |
list-style: none !important;
|
10 |
float: left;
|
11 |
background-image: none !important;
|
12 |
+
background-color: #fff;
|
13 |
margin: 5px 5px 0px 0px !important;
|
14 |
+
padding: 3px 10px!important;
|
15 |
+
border-radius: 3px;
|
16 |
+
border: 1px solid #ccc;
|
17 |
cursor: pointer;
|
18 |
}
|
19 |
.srr-active-tab{
|
20 |
+
background: #333 !important;
|
21 |
+
color: white !important;
|
22 |
}
|
23 |
|
24 |
/** General styling **/
|
36 |
.srr-wrap .srr-item:last-child{
|
37 |
margin: 0px;
|
38 |
}
|
39 |
+
.srr-wrap .srr-item > *{
|
40 |
+
margin-bottom: 10px !important;
|
41 |
+
}
|
42 |
+
.srr-wrap .srr-title, .srr-wrap .srr-meta{
|
43 |
+
line-height: 150%;
|
44 |
+
}
|
45 |
+
.srr-wrap .srr-thumb{
|
46 |
+
width: 64px !important;
|
47 |
+
margin: 5px 10px 0 0 !important;
|
48 |
+
float: left !important;
|
49 |
+
}
|
50 |
|
51 |
/** Styles **/
|
52 |
|
53 |
+
/** None **/
|
54 |
+
.srr-style-none .srr-item{
|
55 |
+
padding: 0 0 20px 0 !important;
|
56 |
+
}
|
57 |
+
|
58 |
/** Grey **/
|
59 |
.srr-style-grey{
|
60 |
border: 1px solid #dfdfdf;
|
102 |
.srr-style-orange .srr-item{
|
103 |
border-bottom: 1px solid #FF9900;
|
104 |
}
|
|
|
|
|
|
|
105 |
.srr-tab-style-orange li{
|
106 |
border-color: #FF9900;
|
107 |
background: #FFF8EC;
|
public/srr-js.dev.js
DELETED
@@ -1,213 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Super RSS Reader - jQuery feed reader - v1.0
|
3 |
-
* Included with "Super RSS Reader" Wordpress plugin @since v2.0
|
4 |
-
* Author: Aakash Chakravarthy, www.aakashweb.com
|
5 |
-
*/
|
6 |
-
|
7 |
-
jQuery(document).ready(function(){
|
8 |
-
|
9 |
-
var widget = jQuery('.super-rss-reader-widget')
|
10 |
-
widget.find('.srr-wrap').hide();
|
11 |
-
widget.find('.srr-wrap:first').show();
|
12 |
-
widget.find('.srr-tab-wrap li:first').addClass('srr-active-tab');
|
13 |
-
|
14 |
-
jQuery('.srr-tab-wrap li').click(function(){
|
15 |
-
var id = jQuery(this).attr('data-tab');
|
16 |
-
var parent = jQuery(this).parent().parent();
|
17 |
-
|
18 |
-
jQuery(this).parent().children('li').removeClass('srr-active-tab');
|
19 |
-
jQuery(this).addClass('srr-active-tab');
|
20 |
-
|
21 |
-
parent.find('.srr-wrap').hide();
|
22 |
-
parent.find('.srr-wrap[data-id=' + id + ']').show();
|
23 |
-
});
|
24 |
-
|
25 |
-
// Add the ticker to the required elements
|
26 |
-
jQuery('.srr-vticker').each(function(){
|
27 |
-
var visible = jQuery(this).attr('data-visible');
|
28 |
-
var obj = jQuery(this);
|
29 |
-
obj.easyTicker({
|
30 |
-
'visible': visible,
|
31 |
-
});
|
32 |
-
});
|
33 |
-
});
|
34 |
-
|
35 |
-
/*
|
36 |
-
* jQuery - Easy Ticker plugin - v1.0
|
37 |
-
* http://www.aakashweb.com/
|
38 |
-
* Copyright 2012, Aakash Chakravarthy
|
39 |
-
* Released under the MIT License.
|
40 |
-
*/
|
41 |
-
|
42 |
-
(function($){
|
43 |
-
$.fn.easyTicker = function(options) {
|
44 |
-
|
45 |
-
var defaults = {
|
46 |
-
direction: 'up',
|
47 |
-
easing: 'swing',
|
48 |
-
speed: 'slow',
|
49 |
-
interval: 2000,
|
50 |
-
height: 'auto',
|
51 |
-
visible: 0,
|
52 |
-
mousePause: 1,
|
53 |
-
controls:{
|
54 |
-
up: '',
|
55 |
-
down: '',
|
56 |
-
toggle: ''
|
57 |
-
}
|
58 |
-
};
|
59 |
-
|
60 |
-
// Initialize the variables
|
61 |
-
var options = $.extend(defaults, options),
|
62 |
-
timer = 0,
|
63 |
-
tClass = 'et-run',
|
64 |
-
winFocus = 0,
|
65 |
-
vBody = $('body'),
|
66 |
-
cUp = $(options.controls.up),
|
67 |
-
cDown = $(options.controls.down),
|
68 |
-
cToggle = $(options.controls.toggle);
|
69 |
-
|
70 |
-
// The initializing function
|
71 |
-
var init = function(obj, target){
|
72 |
-
|
73 |
-
target.children().css('margin', 0).children().css('margin', 0);
|
74 |
-
|
75 |
-
obj.css({
|
76 |
-
position : 'relative',
|
77 |
-
height : (options.height == 'auto') ? objHeight(obj, target) : options.height,
|
78 |
-
overflow : 'hidden'
|
79 |
-
});
|
80 |
-
|
81 |
-
target.css({
|
82 |
-
'position' : 'absolute',
|
83 |
-
'margin' : 0
|
84 |
-
}).children().css('margin', 0);
|
85 |
-
|
86 |
-
if(options.visible != 0 && options.height == 'auto'){
|
87 |
-
adjHeight(obj, target);
|
88 |
-
}
|
89 |
-
|
90 |
-
// Set the class to the "toggle" control and set the timer.
|
91 |
-
cToggle.addClass(tClass);
|
92 |
-
setTimer(obj, target);
|
93 |
-
}
|
94 |
-
|
95 |
-
// Core function to move the element up and down.
|
96 |
-
var move = function(obj, target, type){
|
97 |
-
|
98 |
-
if(!obj.is(':visible')) return;
|
99 |
-
|
100 |
-
if(type == 'up'){
|
101 |
-
var sel = ':first-child',
|
102 |
-
eq = '-=',
|
103 |
-
appType = 'appendTo';
|
104 |
-
}else{
|
105 |
-
var sel = ':last-child',
|
106 |
-
eq = '+=',
|
107 |
-
appType = 'prependTo';
|
108 |
-
}
|
109 |
-
|
110 |
-
var selChild = $(target).children(sel);
|
111 |
-
var height = selChild.outerHeight();
|
112 |
-
|
113 |
-
$(target).stop(true, true).animate({
|
114 |
-
'top': eq + height + "px"
|
115 |
-
}, options.speed, options.easing, function(){
|
116 |
-
selChild.hide()[appType](target).fadeIn();
|
117 |
-
$(target).css('top', 0);
|
118 |
-
if(options.visible != 0 && options.height == 'auto'){
|
119 |
-
adjHeight(obj, target);
|
120 |
-
}
|
121 |
-
});
|
122 |
-
}
|
123 |
-
|
124 |
-
// Activates the timer.
|
125 |
-
var setTimer = function(obj, target){
|
126 |
-
if(cToggle.length == 0 || cToggle.hasClass(tClass)){
|
127 |
-
timer = setInterval(function(){
|
128 |
-
if (vBody.attr('data-focus') != 1){ return; }
|
129 |
-
move(obj, target, options.direction);
|
130 |
-
}, options.interval);
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
// Stops the timer
|
135 |
-
var stopTimer = function(obj){
|
136 |
-
clearInterval(timer);
|
137 |
-
}
|
138 |
-
|
139 |
-
// Adjust the wrapper height and show the visible elements only.
|
140 |
-
var adjHeight = function(obj, target){
|
141 |
-
var wrapHeight = 0;
|
142 |
-
$(target).children(':lt(' + options.visible + ')').each(function(){
|
143 |
-
wrapHeight += $(this).outerHeight();
|
144 |
-
});
|
145 |
-
|
146 |
-
obj.stop(true, true).animate({height: wrapHeight}, options.speed);
|
147 |
-
}
|
148 |
-
|
149 |
-
// Get the maximum height of the children.
|
150 |
-
var objHeight = function(obj, target){
|
151 |
-
var height = 0;
|
152 |
-
|
153 |
-
var tempDisp = obj.css('display');
|
154 |
-
obj.css('display', 'block');
|
155 |
-
|
156 |
-
$(target).children().each(function(){
|
157 |
-
height += $(this).outerHeight();
|
158 |
-
});
|
159 |
-
|
160 |
-
obj.css('display', tempDisp);
|
161 |
-
return height;
|
162 |
-
}
|
163 |
-
|
164 |
-
// Hack to check window status
|
165 |
-
function onBlur(){ vBody.attr('data-focus', 0); };
|
166 |
-
function onFocus(){ vBody.attr('data-focus', 1); };
|
167 |
-
|
168 |
-
if (/*@cc_on!@*/false) { // check for Internet Explorer
|
169 |
-
document.onfocusin = onFocus;
|
170 |
-
document.onfocusout = onBlur;
|
171 |
-
}else{
|
172 |
-
$(window).bind('focus mouseover', onFocus);
|
173 |
-
$(window).bind('blur', onBlur);
|
174 |
-
}
|
175 |
-
|
176 |
-
return this.each(function(){
|
177 |
-
var obj = $(this);
|
178 |
-
var tar = obj.children(':first-child');
|
179 |
-
|
180 |
-
// Initialize the content
|
181 |
-
init(obj, tar);
|
182 |
-
|
183 |
-
// Bind the mousePause action
|
184 |
-
if(options.mousePause == 1){
|
185 |
-
obj.mouseover(function(){
|
186 |
-
stopTimer(obj);
|
187 |
-
}).mouseleave(function(){
|
188 |
-
setTimer(obj, tar);
|
189 |
-
});
|
190 |
-
}
|
191 |
-
|
192 |
-
// Controls action
|
193 |
-
cToggle.live('click', function(){
|
194 |
-
if($(this).hasClass(tClass)){
|
195 |
-
stopTimer(obj);
|
196 |
-
$(this).removeClass(tClass);
|
197 |
-
}else{
|
198 |
-
$(this).addClass(tClass);
|
199 |
-
setTimer(obj, tar);
|
200 |
-
}
|
201 |
-
});
|
202 |
-
|
203 |
-
cUp.live('click', function(){
|
204 |
-
move(obj, tar, 'up');
|
205 |
-
});
|
206 |
-
|
207 |
-
cDown.live('click', function(){
|
208 |
-
move(obj, tar, 'down');
|
209 |
-
});
|
210 |
-
|
211 |
-
});
|
212 |
-
};
|
213 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/srr-js.js
CHANGED
@@ -1,7 +1,215 @@
|
|
1 |
/*
|
2 |
-
* Super RSS Reader - jQuery
|
3 |
* Included with "Super RSS Reader" Wordpress plugin @since v2.0
|
4 |
* Author: Aakash Chakravarthy, www.aakashweb.com
|
5 |
-
* Uses the jQuery Easy ticker plugin v1.0
|
6 |
*/
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/*
|
2 |
+
* Super RSS Reader - jQuery feed reader - v1.1
|
3 |
* Included with "Super RSS Reader" Wordpress plugin @since v2.0
|
4 |
* Author: Aakash Chakravarthy, www.aakashweb.com
|
|
|
5 |
*/
|
6 |
+
|
7 |
+
jQuery(document).ready(function(){
|
8 |
+
|
9 |
+
var widget = jQuery('.super-rss-reader-widget');
|
10 |
+
widget.find('.srr-wrap').hide();
|
11 |
+
widget.find('.srr-wrap:first').show();
|
12 |
+
widget.find('.srr-tab-wrap li:first').addClass('srr-active-tab');
|
13 |
+
|
14 |
+
jQuery('.srr-tab-wrap li').click(function(){
|
15 |
+
var id = jQuery(this).attr('data-tab');
|
16 |
+
var parent = jQuery(this).parent().parent();
|
17 |
+
|
18 |
+
jQuery(this).parent().children('li').removeClass('srr-active-tab');
|
19 |
+
jQuery(this).addClass('srr-active-tab');
|
20 |
+
|
21 |
+
parent.find('.srr-wrap').hide();
|
22 |
+
parent.find('.srr-wrap[data-id=' + id + ']').show();
|
23 |
+
});
|
24 |
+
|
25 |
+
// Add the ticker to the required elements
|
26 |
+
jQuery('.srr-vticker').each(function(){
|
27 |
+
var visible = jQuery(this).attr('data-visible');
|
28 |
+
var interval = jQuery(this).attr('data-speed');
|
29 |
+
var obj = jQuery(this);
|
30 |
+
obj.easyTicker({
|
31 |
+
'visible': visible,
|
32 |
+
'interval': interval
|
33 |
+
});
|
34 |
+
});
|
35 |
+
});
|
36 |
+
|
37 |
+
/*
|
38 |
+
* jQuery - Easy Ticker plugin - v1.0
|
39 |
+
* http://www.aakashweb.com/
|
40 |
+
* Copyright 2012, Aakash Chakravarthy
|
41 |
+
* Released under the MIT License.
|
42 |
+
*/
|
43 |
+
|
44 |
+
(function($){
|
45 |
+
$.fn.easyTicker = function(options) {
|
46 |
+
|
47 |
+
var defaults = {
|
48 |
+
direction: 'up',
|
49 |
+
easing: 'swing',
|
50 |
+
speed: 'slow',
|
51 |
+
interval: 2000,
|
52 |
+
height: 'auto',
|
53 |
+
visible: 0,
|
54 |
+
mousePause: 1,
|
55 |
+
controls:{
|
56 |
+
up: '',
|
57 |
+
down: '',
|
58 |
+
toggle: ''
|
59 |
+
}
|
60 |
+
};
|
61 |
+
|
62 |
+
// Initialize the variables
|
63 |
+
var options = $.extend(defaults, options),
|
64 |
+
timer = 0,
|
65 |
+
tClass = 'et-run',
|
66 |
+
winFocus = 0,
|
67 |
+
vBody = $('body'),
|
68 |
+
cUp = $(options.controls.up),
|
69 |
+
cDown = $(options.controls.down),
|
70 |
+
cToggle = $(options.controls.toggle);
|
71 |
+
|
72 |
+
// The initializing function
|
73 |
+
var init = function(obj, target){
|
74 |
+
|
75 |
+
target.children().css('margin', 0).children().css('margin', 0);
|
76 |
+
|
77 |
+
obj.css({
|
78 |
+
position : 'relative',
|
79 |
+
height : (options.height == 'auto') ? objHeight(obj, target) : options.height,
|
80 |
+
overflow : 'hidden'
|
81 |
+
});
|
82 |
+
|
83 |
+
target.css({
|
84 |
+
'position' : 'absolute',
|
85 |
+
'margin' : 0
|
86 |
+
}).children().css('margin', 0);
|
87 |
+
|
88 |
+
if(options.visible != 0 && options.height == 'auto'){
|
89 |
+
adjHeight(obj, target);
|
90 |
+
}
|
91 |
+
|
92 |
+
// Set the class to the "toggle" control and set the timer.
|
93 |
+
cToggle.addClass(tClass);
|
94 |
+
setTimer(obj, target);
|
95 |
+
}
|
96 |
+
|
97 |
+
// Core function to move the element up and down.
|
98 |
+
var move = function(obj, target, type){
|
99 |
+
|
100 |
+
if(!obj.is(':visible')) return;
|
101 |
+
|
102 |
+
if(type == 'up'){
|
103 |
+
var sel = ':first-child',
|
104 |
+
eq = '-=',
|
105 |
+
appType = 'appendTo';
|
106 |
+
}else{
|
107 |
+
var sel = ':last-child',
|
108 |
+
eq = '+=',
|
109 |
+
appType = 'prependTo';
|
110 |
+
}
|
111 |
+
|
112 |
+
var selChild = $(target).children(sel);
|
113 |
+
var height = selChild.outerHeight();
|
114 |
+
|
115 |
+
$(target).stop(true, true).animate({
|
116 |
+
'top': eq + height + "px"
|
117 |
+
}, options.speed, options.easing, function(){
|
118 |
+
selChild.hide()[appType](target).fadeIn();
|
119 |
+
$(target).css('top', 0);
|
120 |
+
if(options.visible != 0 && options.height == 'auto'){
|
121 |
+
adjHeight(obj, target);
|
122 |
+
}
|
123 |
+
});
|
124 |
+
}
|
125 |
+
|
126 |
+
// Activates the timer.
|
127 |
+
var setTimer = function(obj, target){
|
128 |
+
if(cToggle.length == 0 || cToggle.hasClass(tClass)){
|
129 |
+
timer = setInterval(function(){
|
130 |
+
if (vBody.attr('data-focus') != 1){ return; }
|
131 |
+
move(obj, target, options.direction);
|
132 |
+
}, options.interval);
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
// Stops the timer
|
137 |
+
var stopTimer = function(obj){
|
138 |
+
clearInterval(timer);
|
139 |
+
}
|
140 |
+
|
141 |
+
// Adjust the wrapper height and show the visible elements only.
|
142 |
+
var adjHeight = function(obj, target){
|
143 |
+
var wrapHeight = 0;
|
144 |
+
$(target).children(':lt(' + options.visible + ')').each(function(){
|
145 |
+
wrapHeight += $(this).outerHeight();
|
146 |
+
});
|
147 |
+
|
148 |
+
obj.stop(true, true).animate({height: wrapHeight}, options.speed);
|
149 |
+
}
|
150 |
+
|
151 |
+
// Get the maximum height of the children.
|
152 |
+
var objHeight = function(obj, target){
|
153 |
+
var height = 0;
|
154 |
+
|
155 |
+
var tempDisp = obj.css('display');
|
156 |
+
obj.css('display', 'block');
|
157 |
+
|
158 |
+
$(target).children().each(function(){
|
159 |
+
height += $(this).outerHeight();
|
160 |
+
});
|
161 |
+
|
162 |
+
obj.css('display', tempDisp);
|
163 |
+
return height;
|
164 |
+
}
|
165 |
+
|
166 |
+
// Hack to check window status
|
167 |
+
function onBlur(){ vBody.attr('data-focus', 0); };
|
168 |
+
function onFocus(){ vBody.attr('data-focus', 1); };
|
169 |
+
|
170 |
+
if (/*@cc_on!@*/false) { // check for Internet Explorer
|
171 |
+
document.onfocusin = onFocus;
|
172 |
+
document.onfocusout = onBlur;
|
173 |
+
}else{
|
174 |
+
$(window).bind('focus mouseover', onFocus);
|
175 |
+
$(window).bind('blur', onBlur);
|
176 |
+
}
|
177 |
+
|
178 |
+
return this.each(function(){
|
179 |
+
var obj = $(this);
|
180 |
+
var tar = obj.children(':first-child');
|
181 |
+
|
182 |
+
// Initialize the content
|
183 |
+
init(obj, tar);
|
184 |
+
|
185 |
+
// Bind the mousePause action
|
186 |
+
if(options.mousePause == 1){
|
187 |
+
obj.mouseover(function(){
|
188 |
+
stopTimer(obj);
|
189 |
+
}).mouseleave(function(){
|
190 |
+
setTimer(obj, tar);
|
191 |
+
});
|
192 |
+
}
|
193 |
+
|
194 |
+
// Controls action
|
195 |
+
cToggle.live('click', function(){
|
196 |
+
if($(this).hasClass(tClass)){
|
197 |
+
stopTimer(obj);
|
198 |
+
$(this).removeClass(tClass);
|
199 |
+
}else{
|
200 |
+
$(this).addClass(tClass);
|
201 |
+
setTimer(obj, tar);
|
202 |
+
}
|
203 |
+
});
|
204 |
+
|
205 |
+
cUp.live('click', function(){
|
206 |
+
move(obj, tar, 'up');
|
207 |
+
});
|
208 |
+
|
209 |
+
cDown.live('click', function(){
|
210 |
+
move(obj, tar, 'down');
|
211 |
+
});
|
212 |
+
|
213 |
+
});
|
214 |
+
};
|
215 |
+
})(jQuery);
|
readme.txt
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
=== Super RSS Reader ===
|
2 |
Contributors: Aakash Chakravarthy
|
3 |
-
|
4 |
-
Tags: rss, feeds, widget, links, twitter, admin, plugin, feed, posts, page
|
5 |
-
Author URI: http://www.aakashweb.com
|
6 |
Plugin URI: http://www.aakashweb.com/wordpress-plugins/super-rss-reader/
|
|
|
7 |
License: GPLv2 or later
|
|
|
8 |
Requires at least: 2.8
|
9 |
-
Tested up to: 3.
|
10 |
-
Stable tag: 2.
|
11 |
|
12 |
-
|
13 |
|
14 |
== Description ==
|
15 |
|
@@ -17,18 +17,20 @@ Super RSS Reader is jQuery based RSS reader widget, which displays the RSS feeds
|
|
17 |
|
18 |
The plugin is fully customizable with external styles and with some inbuilt color styles. It acts as a perfect replacement for the default RSS widget in WordPress.
|
19 |
|
20 |
-
[
|
21 |
|
22 |
= Features =
|
23 |
|
24 |
* jQuery [news ticker like effect](http://www.aakashweb.com/jquery-plugins/easy-ticker/) to the RSS feeds (can turn off or on)
|
25 |
* Tabs support, if multiple RSS feeds are added in a single widget.
|
|
|
26 |
* Customizable with Inbuilt color styles and with external CSS styles.
|
|
|
27 |
* Add multiple RSS feeds in a page with a ticker effect.
|
28 |
* Supports RSS or atom feed.
|
29 |
* Can tweak the widget to change the no of visible feed itemas and more...
|
30 |
|
31 |
-
|
32 |
|
33 |
* If you like this plugin, then [just make a small donation](http://bit.ly/srrdonate) and it will be helpful for the plugin development.
|
34 |
* The jQuery ticker effect is by the [jQuery easy ticker plugin](http://www.aakashweb.com/jquery-plugins/easy-ticker/)
|
@@ -74,15 +76,24 @@ For more FAQs just check out the [official page](http://www.aakashweb.com/wordpr
|
|
74 |
== Screenshots ==
|
75 |
|
76 |
1. Example Super RSS Reader widgets shown in the sidebar, having a ticker effect and a tabbed mode.
|
|
|
77 |
1. Picture showing some possible ways of Customizing the widget.
|
78 |
1. The Super RSS Reader widget in the administration page.
|
79 |
|
80 |
-
[Live Working demo](http://www.aakashweb.com/
|
81 |
|
82 |
[More screenshots in Aakash Web](http://www.aakashweb.com/wordpress-plugins/super-rss-reader/)
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
= 2.1 =
|
87 |
* Added option to open links in new window.
|
88 |
* Changed the method to include the scripts and styles.
|
1 |
=== Super RSS Reader ===
|
2 |
Contributors: Aakash Chakravarthy
|
3 |
+
Author URI: http://www.aakashweb.com/
|
|
|
|
|
4 |
Plugin URI: http://www.aakashweb.com/wordpress-plugins/super-rss-reader/
|
5 |
+
Tags: rss, feeds, widget, links, twitter, admin, plugin, feed, posts, page, ticker, thumbnail, atom, jquery
|
6 |
License: GPLv2 or later
|
7 |
+
Donate Link: http://bit.ly/srrdonate
|
8 |
Requires at least: 2.8
|
9 |
+
Tested up to: 3.5.x
|
10 |
+
Stable tag: 2.2
|
11 |
|
12 |
+
An awesome RSS widget plugin, which displays feeds like news ticker effect with thumbnails, multiple tabbed feeds, customizable color styles and more
|
13 |
|
14 |
== Description ==
|
15 |
|
17 |
|
18 |
The plugin is fully customizable with external styles and with some inbuilt color styles. It acts as a perfect replacement for the default RSS widget in WordPress.
|
19 |
|
20 |
+
[Check out the **LIVE DEMO** of the plugin](http://www.aakashweb.com/demos/super-rss-reader/)
|
21 |
|
22 |
= Features =
|
23 |
|
24 |
* jQuery [news ticker like effect](http://www.aakashweb.com/jquery-plugins/easy-ticker/) to the RSS feeds (can turn off or on)
|
25 |
* Tabs support, if multiple RSS feeds are added in a single widget.
|
26 |
+
* **(NEW)** Displays thumbnail to the feed items if available.
|
27 |
* Customizable with Inbuilt color styles and with external CSS styles.
|
28 |
+
* **(NEW)** Customizable ticker speed.
|
29 |
* Add multiple RSS feeds in a page with a ticker effect.
|
30 |
* Supports RSS or atom feed.
|
31 |
* Can tweak the widget to change the no of visible feed itemas and more...
|
32 |
|
33 |
+
[youtube=http://www.youtube.com/watch?v=02aOG_-98Tg]
|
34 |
|
35 |
* If you like this plugin, then [just make a small donation](http://bit.ly/srrdonate) and it will be helpful for the plugin development.
|
36 |
* The jQuery ticker effect is by the [jQuery easy ticker plugin](http://www.aakashweb.com/jquery-plugins/easy-ticker/)
|
76 |
== Screenshots ==
|
77 |
|
78 |
1. Example Super RSS Reader widgets shown in the sidebar, having a ticker effect and a tabbed mode.
|
79 |
+
1. Plugin working in different themes and RSS feeds.
|
80 |
1. Picture showing some possible ways of Customizing the widget.
|
81 |
1. The Super RSS Reader widget in the administration page.
|
82 |
|
83 |
+
[Live Working demo](http://www.aakashweb.com/demos/super-rss-reader/)
|
84 |
|
85 |
[More screenshots in Aakash Web](http://www.aakashweb.com/wordpress-plugins/super-rss-reader/)
|
86 |
|
87 |
== Changelog ==
|
88 |
|
89 |
+
= 2.2 =
|
90 |
+
* Displays "thumbnail" of the feed item if available.
|
91 |
+
* Added setting to change ticker speed.
|
92 |
+
* Added setting to edit the "Read more" text.
|
93 |
+
* Default styles are revised.
|
94 |
+
* Switched to full size ticker code.
|
95 |
+
* Core code revised.
|
96 |
+
|
97 |
= 2.1 =
|
98 |
* Added option to open links in new window.
|
99 |
* Changed the method to include the scripts and styles.
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
ADDED
Binary file
|
super-rss-reader.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.aakashweb.com/wordpress-plugins/super-rss-reader/
|
|
5 |
Author URI: http://www.aakashweb.com/
|
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 seperated in tabs. <a href="http://www.youtube.com/watch?v=02aOG_-98Tg" target="_blank" title="Super RSS Reader demo video">Check out the demo video</a>.
|
7 |
Author: Aakash Chakravarthy
|
8 |
-
Version: 2.
|
9 |
*/
|
10 |
|
11 |
if(!defined('WP_CONTENT_URL')) {
|
@@ -14,7 +14,7 @@ if(!defined('WP_CONTENT_URL')) {
|
|
14 |
$srr_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/';
|
15 |
}
|
16 |
|
17 |
-
define('SRR_VERSION', '2.
|
18 |
define('SRR_AUTHOR', 'Aakash Chakravarthy');
|
19 |
define('SRR_URL', $srr_url);
|
20 |
|
@@ -54,11 +54,14 @@ function srr_rss_parser($instance){
|
|
54 |
$show_date = intval($instance['show_date']);
|
55 |
$show_desc = intval($instance['show_desc']);
|
56 |
$show_author = intval($instance['show_author']);
|
|
|
57 |
$open_newtab = intval($instance['open_newtab']);
|
58 |
$strip_desc = intval($instance['strip_desc']);
|
|
|
59 |
$color_style = stripslashes($instance['color_style']);
|
60 |
$enable_ticker = intval($instance['enable_ticker']);
|
61 |
$visible_items = intval($instance['visible_items']);
|
|
|
62 |
|
63 |
if(empty($urls)){
|
64 |
return '';
|
@@ -66,28 +69,29 @@ function srr_rss_parser($instance){
|
|
66 |
|
67 |
$rand = array();
|
68 |
$url = explode(',', $urls);
|
|
|
69 |
|
70 |
// Generate the Tabs
|
71 |
-
if(
|
72 |
echo '<ul class="srr-tab-wrap srr-tab-style-' . $color_style . ' srr-clearfix">';
|
73 |
-
for($i=0; $i
|
74 |
// Get the Feed URL
|
75 |
$feedUrl = trim($url[$i]);
|
76 |
$rss = fetch_feed($feedUrl);
|
77 |
-
if (is_wp_error($rss)){
|
78 |
-
if (is_admin() || current_user_can('manage_options')){
|
79 |
-
echo '<p><strong>RSS Error</strong>:' . $rss->get_error_message() . '</p>';
|
80 |
-
return;
|
81 |
-
}
|
82 |
-
}
|
83 |
-
$rss_title = esc_attr(strip_tags($rss->get_title()));
|
84 |
$rand[$i] = rand(0, 999);
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
echo '</ul>';
|
88 |
}
|
89 |
|
90 |
-
for($i=0; $i
|
91 |
// Get the Feed URL
|
92 |
$feedUrl = trim($url[$i]);
|
93 |
if(isset($url[$i])){
|
@@ -98,14 +102,19 @@ function srr_rss_parser($instance){
|
|
98 |
|
99 |
// Check for feed errors
|
100 |
if (!is_wp_error( $rss ) ){
|
101 |
-
$maxitems = $rss->get_item_quantity($count);
|
102 |
$rss_items = $rss->get_items(0, $maxitems);
|
103 |
$rss_title = esc_attr(strip_tags($rss->get_title()));
|
104 |
$rss_desc = esc_attr(strip_tags($rss->get_description()));
|
|
|
|
|
|
|
105 |
}
|
106 |
-
|
|
|
|
|
107 |
// Outer Wrap start
|
108 |
-
echo '<div class="srr-wrap ' . (($enable_ticker == 1 ) ? 'srr-vticker' : '' ) . ' srr-style-' . $color_style . '" data-visible="' . $visible_items . '" data-
|
109 |
|
110 |
// Check feed items
|
111 |
if ($maxitems == 0){
|
@@ -122,22 +131,33 @@ function srr_rss_parser($instance){
|
|
122 |
// Get the item title
|
123 |
$title = esc_attr(strip_tags($item->get_title()));
|
124 |
if ( empty($title) )
|
125 |
-
$title = __('
|
126 |
|
127 |
// Get the date
|
128 |
$date = $item->get_date('j F Y');
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
// Get the description
|
131 |
$desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
132 |
-
|
133 |
if($strip_desc != 0){
|
134 |
$desc = wp_html_excerpt( $desc, $strip_desc );
|
|
|
|
|
135 |
if ( '[...]' == substr( $desc, -5 ) )
|
136 |
-
$desc = substr( $desc, 0, -5 )
|
137 |
elseif ( '[…]' != substr( $desc, -10 ) )
|
138 |
-
$desc .= '
|
|
|
|
|
139 |
}
|
140 |
-
$desc =
|
141 |
|
142 |
// Get the author
|
143 |
$author = $item->get_author();
|
@@ -145,7 +165,7 @@ function srr_rss_parser($instance){
|
|
145 |
$author = $author->get_name();
|
146 |
$author = esc_html(strip_tags($author));
|
147 |
}
|
148 |
-
|
149 |
// Open links in new tab
|
150 |
$newtab = ($open_newtab) ? ' target="_blank"' : '';
|
151 |
|
@@ -153,10 +173,20 @@ function srr_rss_parser($instance){
|
|
153 |
|
154 |
// Display the feed items
|
155 |
echo '<div class="srr-item ' . (($j%2 == 0) ? 'even' : 'odd') . '">';
|
156 |
-
echo '<a href="' . $link . '"' . $newtab . ' title="Posted on ' . $date . '">' .$title . '</a>';
|
157 |
-
|
158 |
-
|
159 |
-
if($
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
echo '</div>';
|
161 |
// End display
|
162 |
|
@@ -194,10 +224,10 @@ class super_rss_reader_widget extends WP_Widget{
|
|
194 |
|
195 |
echo $before_widget . $title;
|
196 |
echo "\n" . '
|
197 |
-
<!-- Start - Super RSS Reader -->
|
198 |
<div class="super-rss-reader-widget">' . "\n";
|
199 |
|
200 |
-
srr_rss_parser($instance
|
201 |
|
202 |
echo "\n" . '</div>
|
203 |
<!-- End - Super RSS Reader -->
|
@@ -215,12 +245,15 @@ class super_rss_reader_widget extends WP_Widget{
|
|
215 |
$instance['show_date'] = intval($new_instance['show_date']);
|
216 |
$instance['show_desc'] = intval($new_instance['show_desc']);
|
217 |
$instance['show_author'] = intval($new_instance['show_author']);
|
|
|
218 |
$instance['open_newtab'] = intval($new_instance['open_newtab']);
|
219 |
$instance['strip_desc'] = intval($new_instance['strip_desc']);
|
|
|
220 |
|
221 |
$instance['color_style'] = stripslashes($new_instance['color_style']);
|
222 |
$instance['enable_ticker'] = intval($new_instance['enable_ticker']);
|
223 |
$instance['visible_items'] = intval($new_instance['visible_items']);
|
|
|
224 |
|
225 |
return $instance;
|
226 |
}
|
@@ -231,9 +264,9 @@ class super_rss_reader_widget extends WP_Widget{
|
|
231 |
|
232 |
$instance = wp_parse_args( (array) $instance, array(
|
233 |
'title' => '', 'urls' => '', 'count' => 5,
|
234 |
-
'show_date' => 0, 'show_desc' => 1, 'show_author' => 0,
|
235 |
-
'open_newtab' => 1, 'strip_desc' => 100, '
|
236 |
-
'enable_ticker' => 1, 'visible_items' => 5
|
237 |
));
|
238 |
|
239 |
$title = htmlspecialchars($instance['title']);
|
@@ -243,12 +276,15 @@ class super_rss_reader_widget extends WP_Widget{
|
|
243 |
$show_date = intval($instance['show_date']);
|
244 |
$show_desc = intval($instance['show_desc']);
|
245 |
$show_author = intval($instance['show_author']);
|
|
|
246 |
$open_newtab = intval($instance['open_newtab']);
|
247 |
$strip_desc = intval($instance['strip_desc']);
|
|
|
248 |
|
249 |
$color_style = stripslashes($instance['color_style']);
|
250 |
$enable_ticker = intval($instance['enable_ticker']);
|
251 |
$visible_items = intval($instance['visible_items']);
|
|
|
252 |
|
253 |
?>
|
254 |
<div class="srr_settings">
|
@@ -283,15 +319,15 @@ class super_rss_reader_widget extends WP_Widget{
|
|
283 |
</tr>
|
284 |
<tr>
|
285 |
<td height="29"><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"' : ""; ?> /></td>
|
286 |
-
<td
|
287 |
-
<td
|
288 |
-
<td
|
289 |
</tr>
|
290 |
<tr>
|
291 |
<td height="29"><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"' : ""; ?> /></td>
|
292 |
<td><label for="<?php echo $this->get_field_id('open_newtab'); ?>">Open links in new tab</label></td>
|
293 |
-
<td
|
294 |
-
<td
|
295 |
</tr>
|
296 |
</table>
|
297 |
</div>
|
@@ -320,10 +356,16 @@ class super_rss_reader_widget extends WP_Widget{
|
|
320 |
<td><input id="<?php echo $this->get_field_id('visible_items');?>" name="<?php echo $this->get_field_name('visible_items'); ?>" type="text" value="<?php echo $visible_items; ?>" class="widefat" title="The no of feed items to be visible."/>
|
321 |
</td>
|
322 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
323 |
</table>
|
324 |
</div>
|
325 |
|
326 |
<div class="srr_support"> <a href="http://facebook.com/aakashweb" class="srr_fblike" target="_blank">Like</a> | <a href="http://bit.ly/srrdonate" target="_blank" style="color: #FF6600" title="If you like this plugin, then just make a small donation and it will be helpful for the plugin's development.">Donate</a> | <a href="http://www.aakashweb.com/wordpress-plugins/super-rss-reader/" target="_blank">Support</a></div>
|
|
|
327 |
|
328 |
<?php
|
329 |
}
|
5 |
Author URI: http://www.aakashweb.com/
|
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 seperated in tabs. <a href="http://www.youtube.com/watch?v=02aOG_-98Tg" target="_blank" title="Super RSS Reader demo video">Check out the demo video</a>.
|
7 |
Author: Aakash Chakravarthy
|
8 |
+
Version: 2.2
|
9 |
*/
|
10 |
|
11 |
if(!defined('WP_CONTENT_URL')) {
|
14 |
$srr_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/';
|
15 |
}
|
16 |
|
17 |
+
define('SRR_VERSION', '2.2');
|
18 |
define('SRR_AUTHOR', 'Aakash Chakravarthy');
|
19 |
define('SRR_URL', $srr_url);
|
20 |
|
54 |
$show_date = intval($instance['show_date']);
|
55 |
$show_desc = intval($instance['show_desc']);
|
56 |
$show_author = intval($instance['show_author']);
|
57 |
+
$show_thumb = stripslashes($instance['show_thumb']);
|
58 |
$open_newtab = intval($instance['open_newtab']);
|
59 |
$strip_desc = intval($instance['strip_desc']);
|
60 |
+
$read_more = htmlspecialchars($instance['read_more']);
|
61 |
$color_style = stripslashes($instance['color_style']);
|
62 |
$enable_ticker = intval($instance['enable_ticker']);
|
63 |
$visible_items = intval($instance['visible_items']);
|
64 |
+
$ticker_speed = intval($instance['ticker_speed']) * 1000;
|
65 |
|
66 |
if(empty($urls)){
|
67 |
return '';
|
69 |
|
70 |
$rand = array();
|
71 |
$url = explode(',', $urls);
|
72 |
+
$ucount = count($url);
|
73 |
|
74 |
// Generate the Tabs
|
75 |
+
if($ucount > 1){
|
76 |
echo '<ul class="srr-tab-wrap srr-tab-style-' . $color_style . ' srr-clearfix">';
|
77 |
+
for($i=0; $i<$ucount; $i++){
|
78 |
// Get the Feed URL
|
79 |
$feedUrl = trim($url[$i]);
|
80 |
$rss = fetch_feed($feedUrl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
$rand[$i] = rand(0, 999);
|
82 |
+
|
83 |
+
if (!is_wp_error($rss)){
|
84 |
+
$rss_title = esc_attr(strip_tags($rss->get_title()));
|
85 |
+
echo '<li data-tab="srr-tab-' . $rand[$i] . '">' . $rss_title . '</li>';
|
86 |
+
}else{
|
87 |
+
echo '<li data-tab="srr-tab-' . $rand[$i] . '">Error</li>';
|
88 |
+
}
|
89 |
+
|
90 |
}
|
91 |
echo '</ul>';
|
92 |
}
|
93 |
|
94 |
+
for($i=0; $i<$ucount; $i++){
|
95 |
// Get the Feed URL
|
96 |
$feedUrl = trim($url[$i]);
|
97 |
if(isset($url[$i])){
|
102 |
|
103 |
// Check for feed errors
|
104 |
if (!is_wp_error( $rss ) ){
|
105 |
+
$maxitems = $rss->get_item_quantity($count);
|
106 |
$rss_items = $rss->get_items(0, $maxitems);
|
107 |
$rss_title = esc_attr(strip_tags($rss->get_title()));
|
108 |
$rss_desc = esc_attr(strip_tags($rss->get_description()));
|
109 |
+
}else{
|
110 |
+
echo '<div class="srr-wrap srr-style-' . $color_style .'" data-id="srr-tab-' . $rand[$i] . '"><p>RSS Error: ' . $rss->get_error_message() . '</p></div>';
|
111 |
+
continue;
|
112 |
}
|
113 |
+
|
114 |
+
$randAttr = isset($rand[$i]) ? ' data-id="srr-tab-' . $rand[$i] . '" ' : '';
|
115 |
+
|
116 |
// Outer Wrap start
|
117 |
+
echo '<div class="srr-wrap ' . (($enable_ticker == 1 ) ? 'srr-vticker' : '' ) . ' srr-style-' . $color_style . '" data-visible="' . $visible_items . '" data-speed="' . $ticker_speed . '"' . $randAttr . '><div>';
|
118 |
|
119 |
// Check feed items
|
120 |
if ($maxitems == 0){
|
131 |
// Get the item title
|
132 |
$title = esc_attr(strip_tags($item->get_title()));
|
133 |
if ( empty($title) )
|
134 |
+
$title = __('No Title');
|
135 |
|
136 |
// Get the date
|
137 |
$date = $item->get_date('j F Y');
|
138 |
|
139 |
+
// Get thumbnail if present @since v2.2
|
140 |
+
$thumb = '';
|
141 |
+
if ($show_thumb == 1 && $enclosure = $item->get_enclosure()){
|
142 |
+
$thumburl = $enclosure->get_thumbnail();
|
143 |
+
if(!empty($thumburl))
|
144 |
+
$thumb = '<img src="' . $thumburl . '" alt="' . $title . '" class="srr-thumb" align="left"/>';
|
145 |
+
}
|
146 |
+
|
147 |
// Get the description
|
148 |
$desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
|
|
149 |
if($strip_desc != 0){
|
150 |
$desc = wp_html_excerpt( $desc, $strip_desc );
|
151 |
+
$rmore = (!empty($read_more)) ? '<a href="' . $link . '" title="Read more">' . $read_more . '</a>' : '';
|
152 |
+
|
153 |
if ( '[...]' == substr( $desc, -5 ) )
|
154 |
+
$desc = substr( $desc, 0, -5 );
|
155 |
elseif ( '[…]' != substr( $desc, -10 ) )
|
156 |
+
$desc .= '';
|
157 |
+
|
158 |
+
$desc = esc_html( $desc );
|
159 |
}
|
160 |
+
$desc = $thumb . $desc . ' ' . $rmore;
|
161 |
|
162 |
// Get the author
|
163 |
$author = $item->get_author();
|
165 |
$author = $author->get_name();
|
166 |
$author = esc_html(strip_tags($author));
|
167 |
}
|
168 |
+
|
169 |
// Open links in new tab
|
170 |
$newtab = ($open_newtab) ? ' target="_blank"' : '';
|
171 |
|
173 |
|
174 |
// Display the feed items
|
175 |
echo '<div class="srr-item ' . (($j%2 == 0) ? 'even' : 'odd') . '">';
|
176 |
+
echo '<div class="srr-title"><a href="' . $link . '"' . $newtab . ' title="Posted on ' . $date . '">' .$title . '</a></div>';
|
177 |
+
echo '<div class="srr-meta">';
|
178 |
+
|
179 |
+
if($show_date && !empty($date))
|
180 |
+
echo '<time class="srr-date">' . $date . '</time>';
|
181 |
+
|
182 |
+
if($show_author && !empty($author))
|
183 |
+
echo ' - <cite class="srr-author">' . $author . '</cite>';
|
184 |
+
|
185 |
+
echo '</div>';
|
186 |
+
|
187 |
+
if($show_desc)
|
188 |
+
echo '<p class="srr-summary srr-clearfix">' . $desc . '</p>';
|
189 |
+
|
190 |
echo '</div>';
|
191 |
// End display
|
192 |
|
224 |
|
225 |
echo $before_widget . $title;
|
226 |
echo "\n" . '
|
227 |
+
<!-- Start - Super RSS Reader v' . SRR_VERSION . '-->
|
228 |
<div class="super-rss-reader-widget">' . "\n";
|
229 |
|
230 |
+
srr_rss_parser($instance);
|
231 |
|
232 |
echo "\n" . '</div>
|
233 |
<!-- End - Super RSS Reader -->
|
245 |
$instance['show_date'] = intval($new_instance['show_date']);
|
246 |
$instance['show_desc'] = intval($new_instance['show_desc']);
|
247 |
$instance['show_author'] = intval($new_instance['show_author']);
|
248 |
+
$instance['show_thumb'] = stripslashes($new_instance['show_thumb']);
|
249 |
$instance['open_newtab'] = intval($new_instance['open_newtab']);
|
250 |
$instance['strip_desc'] = intval($new_instance['strip_desc']);
|
251 |
+
$instance['read_more'] = stripslashes($new_instance['read_more']);
|
252 |
|
253 |
$instance['color_style'] = stripslashes($new_instance['color_style']);
|
254 |
$instance['enable_ticker'] = intval($new_instance['enable_ticker']);
|
255 |
$instance['visible_items'] = intval($new_instance['visible_items']);
|
256 |
+
$instance['ticker_speed'] = intval($new_instance['ticker_speed']);
|
257 |
|
258 |
return $instance;
|
259 |
}
|
264 |
|
265 |
$instance = wp_parse_args( (array) $instance, array(
|
266 |
'title' => '', 'urls' => '', 'count' => 5,
|
267 |
+
'show_date' => 0, 'show_desc' => 1, 'show_author' => 0, 'show_thumb' => 1,
|
268 |
+
'open_newtab' => 1, 'strip_desc' => 100, 'read_more' => '[...]',
|
269 |
+
'color_style' => 'none', 'enable_ticker' => 1, 'visible_items' => 5, 'ticker_speed' => 2,
|
270 |
));
|
271 |
|
272 |
$title = htmlspecialchars($instance['title']);
|
276 |
$show_date = intval($instance['show_date']);
|
277 |
$show_desc = intval($instance['show_desc']);
|
278 |
$show_author = intval($instance['show_author']);
|
279 |
+
$show_thumb = intval($instance['show_thumb']);
|
280 |
$open_newtab = intval($instance['open_newtab']);
|
281 |
$strip_desc = intval($instance['strip_desc']);
|
282 |
+
$read_more = htmlspecialchars($instance['read_more']);
|
283 |
|
284 |
$color_style = stripslashes($instance['color_style']);
|
285 |
$enable_ticker = intval($instance['enable_ticker']);
|
286 |
$visible_items = intval($instance['visible_items']);
|
287 |
+
$ticker_speed = intval($instance['ticker_speed']);
|
288 |
|
289 |
?>
|
290 |
<div class="srr_settings">
|
319 |
</tr>
|
320 |
<tr>
|
321 |
<td height="29"><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"' : ""; ?> /></td>
|
322 |
+
<td>Show Author</label></td>
|
323 |
+
<td><label for="<?php echo $this->get_field_id('read_more'); ?>">Read more text</label></td>
|
324 |
+
<td><input id="<?php echo $this->get_field_name('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"/></td>
|
325 |
</tr>
|
326 |
<tr>
|
327 |
<td height="29"><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"' : ""; ?> /></td>
|
328 |
<td><label for="<?php echo $this->get_field_id('open_newtab'); ?>">Open links in new tab</label></td>
|
329 |
+
<td><label for="<?php echo $this->get_field_id('show_thumb'); ?>">Show thumbnail if present</label></td>
|
330 |
+
<td><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"' : ""; ?> /></td>
|
331 |
</tr>
|
332 |
</table>
|
333 |
</div>
|
356 |
<td><input id="<?php echo $this->get_field_id('visible_items');?>" name="<?php echo $this->get_field_name('visible_items'); ?>" type="text" value="<?php echo $visible_items; ?>" class="widefat" title="The no of feed items to be visible."/>
|
357 |
</td>
|
358 |
</tr>
|
359 |
+
<tr>
|
360 |
+
<td height="36"><label for="<?php echo $this->get_field_id('ticker_speed');?>">Ticker speed: </label></td>
|
361 |
+
<td><input id="<?php echo $this->get_field_id('ticker_speed');?>" name="<?php echo $this->get_field_name('ticker_speed'); ?>" type="text" value="<?php echo $ticker_speed; ?>" title="Speed of the ticker in seconds"/> seconds
|
362 |
+
</td>
|
363 |
+
</tr>
|
364 |
</table>
|
365 |
</div>
|
366 |
|
367 |
<div class="srr_support"> <a href="http://facebook.com/aakashweb" class="srr_fblike" target="_blank">Like</a> | <a href="http://bit.ly/srrdonate" target="_blank" style="color: #FF6600" title="If you like this plugin, then just make a small donation and it will be helpful for the plugin's development.">Donate</a> | <a href="http://www.aakashweb.com/wordpress-plugins/super-rss-reader/" target="_blank">Support</a></div>
|
368 |
+
<small>Please donate and share this plugin to show your support. Thank you :)</small>
|
369 |
|
370 |
<?php
|
371 |
}
|