WP RSS Aggregator - Version 1.0

Version Description

Download this release

Release Info

Developer jeangalea
Plugin Icon 128x128 WP RSS Aggregator
Version 1.0
Comparing to
See all releases

Version 1.0

css/colorbox.css ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
7
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
8
+ #cboxContent{position:relative;}
9
+ #cboxLoadedContent{overflow:auto;}
10
+ #cboxTitle{margin:0;}
11
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
12
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
13
+ .cboxPhoto{float:left; margin:auto; border:0; display:block;}
14
+ .cboxIframe{width:100%; height:100%; display:block; border:0;}
15
+
16
+ /*
17
+ User Style:
18
+ Change the following styles to modify the appearance of ColorBox. They are
19
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
20
+ */
21
+ #cboxOverlay{background:#000;}
22
+ #colorbox{}
23
+ #cboxTopLeft{width:14px; height:14px; background:url(images/controls.png) no-repeat 0 0;}
24
+ #cboxTopCenter{height:14px; background:url(images/border.png) repeat-x top left;}
25
+ #cboxTopRight{width:14px; height:14px; background:url(images/controls.png) no-repeat -36px 0;}
26
+ #cboxBottomLeft{width:14px; height:43px; background:url(images/controls.png) no-repeat 0 -32px;}
27
+ #cboxBottomCenter{height:43px; background:url(images/border.png) repeat-x bottom left;}
28
+ #cboxBottomRight{width:14px; height:43px; background:url(images/controls.png) no-repeat -36px -32px;}
29
+ #cboxMiddleLeft{width:14px; background:url(images/controls.png) repeat-y -175px 0;}
30
+ #cboxMiddleRight{width:14px; background:url(images/controls.png) repeat-y -211px 0;}
31
+ #cboxContent{background:#fff; overflow:visible;}
32
+ .cboxIframe{background:#fff;}
33
+ #cboxError{padding:50px; border:1px solid #ccc;}
34
+ #cboxLoadedContent{margin-bottom:5px;}
35
+ #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
36
+ #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
37
+ #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
38
+ #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
39
+
40
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(images/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
41
+ #cboxPrevious{left:0px; background-position: -51px -25px;}
42
+ #cboxPrevious:hover{background-position:-51px 0px;}
43
+ #cboxNext{left:27px; background-position:-75px -25px;}
44
+ #cboxNext:hover{background-position:-75px 0px;}
45
+ #cboxClose{right:0; background-position:-100px -25px;}
46
+ #cboxClose:hover{background-position:-100px 0px;}
47
+
48
+ .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
49
+ .cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;}
50
+ .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
51
+ .cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}
css/styles.css ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wprss-input {
2
+ background: none repeat scroll 0 0 #EAF2FA;
3
+ margin-bottom: 20px;
4
+ padding-bottom: 10px;
5
+ padding-left: 10px;
6
+ padding-top: 10px;
7
+ width: 600px;
8
+ }
9
+
10
+ .wprss-input p { line-height: 28px; }
11
+
12
+ .wprss-input label {
13
+ float: left;
14
+ width: 95px !important;
15
+ }
16
+
17
+ .wprss-input input {
18
+ height: 28px;
19
+ margin-bottom: 0;
20
+ padding: 0 0 0 5px;
21
+ width: 400px;
22
+ }
23
+
images/add.png ADDED
Binary file
images/remove.png ADDED
Binary file
readme.txt ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP RSS Aggregator ===
2
+ Contributors: jeangalea
3
+ Donate link: http://www.jeangalea.com
4
+ Tags: rss, feeds, aggregation, aggregator, import
5
+ Requires at least: 2.9
6
+ Tested up to: 3.3.1
7
+ Stable tag: 1.0
8
+ Imports and merges multiple RSS Feeds using SimplePie. Outputs feeds sorted by date (latest first).
9
+
10
+ == Description ==
11
+
12
+ WP RSS Aggregator helps you create a feed reader on your WordPress site. It works in a similar fashion to RSS readers like for example Netvibes.
13
+ You can add any number of feeds through an administration panel, the plugin will then pull all the feeds from these sites, merge them and sort them by date.
14
+
15
+ The output will be organised like this:
16
+
17
+ * Today
18
+ * Yesterday
19
+ * 2 Days ago
20
+ * More than 2 days ago
21
+
22
+ The plugin uses SimplePie for the feed operations. The actual news feeds are not stored in your databases but only cached for faster response times.
23
+ You can call the function from within the theme or even use a shortcode with parameters.
24
+
25
+ = Demo =
26
+ The plugin can be seen in use on the [WPMayor.com WordPress News page](http://www.wpmayor.com/wordpress-news/)
27
+
28
+ = Credit =
29
+ Created by Jean Galea. Need a [Web Developer](http://www.jeangalea.com/services/wordpress-consultancy-development/)?
30
+
31
+ == Installation ==
32
+
33
+ 1. Upload the `wp-rss-aggregator` folder to the `/wp-content/plugins/` directory
34
+ 2. Activate the WP RSS Aggregator plugin through the 'Plugins' menu in WordPress
35
+ 3. Configure the plugin by going to the `RSS Aggregator` submenu that appears in your `Settings` admin menu.
36
+ 3. Use the shortcode in your posts or pages: `[wp_rss_aggregator]`
37
+
38
+ The parameters accepted are:
39
+
40
+ * date_before
41
+ * date_after
42
+ * links_befor
43
+ * links_after
44
+ * link_before
45
+ * link_after
46
+
47
+ An example of a shortcode with parameters:
48
+ `[wp_rss_aggregator date_before='<h2>' date_after='</h2>']`
49
+ It is advisable to use the 'HTML' view of the editor when inserting the shortcode with paramters.
50
+
51
+
52
+ An example of a function call from within the template files:
53
+ `<?php
54
+ wp_rss_aggregator(
55
+ 'date_before' => '<h3>',
56
+ 'date_after' => '</h3>',
57
+ 'links_before' => '<ul>',
58
+ 'links_after' => '</ul>',
59
+ 'link_before' => '<li>',
60
+ 'link_after' => '</li>'
61
+ );
62
+ ?>`
63
+
64
+ == Frequently Asked Questions ==
65
+ = How can I output the feeds in my theme? =
66
+
67
+ You can either call the function directly within the theme:
68
+ `<?php wp_rss_aggregator(); ?>`
69
+
70
+ Or use the shortcode in your posts and pages:
71
+ [wp-rss-aggregator]
72
+
73
+ == Screenshots ==
74
+
75
+ 1. The output of this plugin on the frontend, as seen on www.wpmayor.com.
76
+
77
+ 2. Admin administration panel.
78
+
79
+ == Changelog ==
80
+
81
+ = Version 1.0 =
82
+ * Initial release.
83
+
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
scripts/add-remove.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ JQuery code to add or remove option fields
3
+ */
4
+
5
+
6
+ jQuery(function() { // when document has loaded
7
+
8
+ var i = jQuery('input.wprss-input').size(); // check how many input exists on the document and add 1 for the add command to work
9
+ i = (i / 2) + 1;
10
+
11
+ jQuery('a#add').click(function() { // when you click the add link
12
+ jQuery( "<div class='wprss-input'><p><label class='textinput' for='feed_name_" + i + "'>Feed name " + i + "</label>" +
13
+ "<input id='feed_name_" + i + "' class='wprss-input' size='100' name='wprss_options[feed_name_" + i + "]' type='text' value='' /></p>" +
14
+ "<p><label class='textinput' for='feed_url_" + i + "'>Feed URL " + i + "</label>" +
15
+ "<input id='feed_url_" + i + "' class='wprss-input' size='100' name='wprss_options[feed_url_" + i + "]' type='text' value='' /></p></div>")
16
+ .fadeIn('slow').insertBefore('div#buttons');
17
+ // append (add) a new input to the document.
18
+ // if you have the input inside a form, change body to form in the appendTo
19
+ i++; //after the click i will be i = 3 if you click again i will be i = 4
20
+ });
21
+
22
+ jQuery('a#remove').click(function() { // similar to the previous, when you click remove link
23
+ if(i > 1) { // if you have at least 1 input on the form
24
+ jQuery('div.wprss-input:last').remove(); //remove the last input
25
+ i--; //deduct 1 from i so if i = 3, after i--, i will be i = 2
26
+ }
27
+ });
28
+
29
+ jQuery('a.reset').click(function() {
30
+ while(i > 2) { // while you have more than 1 input on the page
31
+ //jQuery('input.wprss-input:last').remove(); // remove inputs
32
+ jQuery('div.wprss-input:last').remove(); // remove inputs
33
+ i--;
34
+ }
35
+ });
36
+
37
+ });
38
+
scripts/jquery.colorbox-min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ // ColorBox v1.3.19 - jQuery lightbox plugin
2
+ // (c) 2011 Jack Moore - jacklmoore.com
3
+ // License: http://www.opensource.org/licenses/mit-license.php
4
+ (function(a,b,c){function Z(c,d,e){var g=b.createElement(c);return d&&(g.id=f+d),e&&(g.style.cssText=e),a(g)}function $(a){var b=y.length,c=(Q+a)%b;return c<0?b+c:c}function _(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function ba(a){return K.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a)}function bb(){var b;K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.slice(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function bc(b,c){a.event.trigger(b),c&&c.call(P)}function bd(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(K.loop||y[Q+1])a=setTimeout(W.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,function(){W.next(),d()}),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function be(b){U||(P=b,bb(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1)),S||(S=T=!0,r.show(),K.returnFocus&&a(P).blur().one(l,function(){a(this).focus()}),q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=_(K.initialWidth,"x"),K.h=_(K.initialHeight,"y"),W.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),bc(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()),W.load(!0))}function bf(){!r&&b.body&&(Y=!1,z=a(c),r=Z(X).attr({id:e,"class":n?f+(o?"IE6":"IE"):""}).hide(),q=Z(X,"Overlay",o?"position:absolute":"").hide(),s=Z(X,"Wrapper"),t=Z(X,"Content").append(A=Z(X,"LoadedContent","width:0; height:0; overflow:hidden"),C=Z(X,"LoadingOverlay").add(Z(X,"LoadingGraphic")),D=Z(X,"Title"),E=Z(X,"Current"),G=Z(X,"Next"),H=Z(X,"Previous"),F=Z(X,"Slideshow").bind(h,bd),I=Z(X,"Close")),s.append(Z(X).append(Z(X,"TopLeft"),u=Z(X,"TopCenter"),Z(X,"TopRight")),Z(X,!1,"clear:left").append(v=Z(X,"MiddleLeft"),t,w=Z(X,"MiddleRight")),Z(X,!1,"clear:left").append(Z(X,"BottomLeft"),x=Z(X,"BottomCenter"),Z(X,"BottomRight"))).find("div div").css({"float":"left"}),B=Z(X,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),J=G.add(H).add(E).add(F),a(b.body).append(q,r.append(s,B)))}function bg(){return r?(Y||(Y=!0,L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}),G.click(function(){W.next()}),H.click(function(){W.prev()}),I.click(function(){W.close()}),q.click(function(){K.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),W.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))}),a("."+g,b).live("click",function(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),be(this))})),!0):!1}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=!a.support.opacity&&!a.support.style,o=n&&!c.XMLHttpRequest,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X="div",Y;if(a.colorbox)return;a(bf),W=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{},bf();if(bg()){if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b))}).addClass(g),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&be(f[0])}return f},W.position=function(a,b){function i(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var c=0,d=0,e=r.offset(),g=z.scrollTop(),h=z.scrollLeft();z.unbind("resize."+f),r.css({top:-9e4,left:-9e4}),K.fixed&&!o?(e.top-=g,e.left-=h,r.css({position:"fixed"})):(c=g,d=h,r.css({position:"absolute"})),K.right!==!1?d+=Math.max(z.width()-K.w-O-M-_(K.right,"x"),0):K.left!==!1?d+=_(K.left,"x"):d+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?c+=Math.max(z.height()-K.h-N-L-_(K.bottom,"y"),0):K.top!==!1?c+=_(K.top,"y"):c+=Math.round(Math.max(z.height()-K.h-N-L,0)/2),r.css({top:e.top,left:e.left}),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:c,left:d},{duration:a,complete:function(){i(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",K.reposition&&setTimeout(function(){z.bind("resize."+f,W.position)},1),b&&b()},step:function(){i(this)}})},W.resize=function(a){S&&(a=a||{},a.width&&(K.w=_(a.width,"x")-O-M),a.innerWidth&&(K.w=_(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=_(a.height,"y")-N-L),a.innerHeight&&(K.h=_(a.innerHeight,"y")),!a.innerHeight&&!a.height&&(A.css({height:"auto"}),K.h=A.height()),A.css({height:K.h}),W.position(K.transition==="none"?0:K.speed))},W.prep=function(b){function g(){return K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w,K.w}function h(){return K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h,K.h}if(!S)return;var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Z(X,"LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function q(){n&&r[0].style.removeAttribute("filter")}var b,c,g=y.length,h,i="frameBorder",k="allowTransparency",l,o,p;if(!S)return;l=function(){clearTimeout(V),C.hide(),bc(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show();if(g>1){typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",g)).show(),G[K.loop||Q<g-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),K.slideshow&&F.show();if(K.preloading){b=[$(-1),$(1)];while(c=y[b.pop()])o=a.data(c,e).href||c.href,a.isFunction(o)&&(o=o.call(c)),ba(o)&&(p=new Image,p.src=o)}}else J.hide();K.iframe?(h=Z("iframe")[0],i in h&&(h[i]=0),k in h&&(h[k]="true"),h.name=f+ +(new Date),K.fastIframe?l():a(h).one("load",l),h.src=K.href,K.scrolling||(h.scrolling="no"),a(h).addClass(f+"Iframe").appendTo(A).one(m,function(){h.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,q):q()},K.transition==="fade"?r.fadeTo(d,0,function(){W.position(0,c)}):W.position(d,c)},W.load=function(b){var c,d,e=W.prep;T=!0,R=!1,P=y[Q],b||bb(),bc(m),bc(i,K.onLoad),K.h=K.height?_(K.height,"y")-N-L:K.innerHeight&&_(K.innerHeight,"y"),K.w=K.width?_(K.width,"x")-O-M:K.innerWidth&&_(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=_(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=_(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,V=setTimeout(function(){C.show()},100),K.inline?(Z(X).hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):ba(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Z(X,"Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(K.loop||y[Q+1])&&(R.style.cursor="pointer",R.onclick=function(){W.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Z(X,"Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},W.next=function(){!T&&y[1]&&(K.loop||y[Q+1])&&(Q=$(1),W.load())},W.prev=function(){!T&&y[1]&&(K.loop||Q)&&(Q=$(-1),W.load())},W.close=function(){S&&!U&&(U=!0,S=!1,bc(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),bc(m),A.remove(),setTimeout(function(){U=!1,bc(l,K.onClosed)},1)}))},W.remove=function(){a([]).add(r).add(q).remove(),r=null,a("."+g).removeData(e).removeClass(g).die()},W.element=function(){return a(P)},W.settings=d})(jQuery,document,this);
uninstall.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If uninstall not called from WordPress exit
3
+ if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
+ exit ();
5
+ // Delete option from options table
6
+ delete_option( 'wprss_options' );
7
+ //
8
+ ?>
wp-rss-aggregator.php ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP RSS Aggregator
4
+ Plugin URI: http://www.jeangalea.com
5
+ Description: Imports and merges multiple RSS Feeds using SimplePie
6
+ Version: 1.0
7
+ Author: Jean Galea
8
+ Author URI: http://www.jeangalea.com
9
+ License: GPLv2
10
+ */
11
+
12
+ /* Copyright 2011 Jean Galea (email : jean@jpgalea.com)
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License as published by
15
+ the Free Software Foundation; either version 2 of the License, or
16
+ (at your option) any later version.
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+ You should have received a copy of the GNU General Public License
22
+ along with this program; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
+ */
25
+
26
+
27
+ /**
28
+ * Plugin activation procedure
29
+ */
30
+
31
+ register_activation_hook( __FILE__, 'wprss_install' );
32
+
33
+ function wprss_install() {
34
+ // Activates the plugin and checks for compatible version of WordPress
35
+ if ( version_compare( get_bloginfo( 'version' ), '2.9', '<' ) ) {
36
+ deactivate_plugins ( basename( __FILE__ )); // Deactivate plugin
37
+ wp_die( "This plugin requires WordPress version 2.9 or higher." );
38
+ }
39
+
40
+ if ( !wp_next_scheduled( 'wprss_generate_hook' ) ) {
41
+ // Schedule to run hourly
42
+ wp_schedule_event( time(), 'hourly', 'wprss_generate_hook' );
43
+ }
44
+
45
+ add_action( 'wprss_generate_hook', 'wp_rss_aggregator' );
46
+ }
47
+
48
+
49
+ /**
50
+ * Plugin deactivation procedure
51
+ */
52
+
53
+ register_deactivation_hook( __FILE__, 'wprss_deactivate' );
54
+
55
+ function wprss_deactivate() {
56
+ // on deactivation remove the cron job
57
+ if ( wp_next_scheduled( 'wprss_generate_hook' ) )
58
+ wp_clear_scheduled_hook( 'wprss_generate_hook' );
59
+ }
60
+
61
+
62
+ /**
63
+ * Actions for plugin's options page
64
+ */
65
+
66
+ // Only load scripts and CSS if we are on this plugin's options page (admin)
67
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'wprss_aggregator' ) {
68
+ add_action( 'admin_print_scripts', 'wprss_register_scripts' );
69
+ add_action( 'admin_print_styles', 'wprss_header' );
70
+ }
71
+
72
+
73
+ /**
74
+ * Include scripts in plugin page header (admin)
75
+ */
76
+
77
+ function wprss_register_scripts() {
78
+ wp_enqueue_script( 'jquery' );
79
+ wp_enqueue_script( 'add-remove', plugins_url( 'scripts/add-remove.js', __FILE__) );
80
+ }
81
+
82
+
83
+ /**
84
+ * Include Colorbox-related script and CSS in WordPress head on frontend
85
+ */
86
+
87
+ add_action( 'wp_enqueue_scripts', 'wprss_frontend_scripts' );
88
+
89
+ function wprss_frontend_scripts() {
90
+ wp_enqueue_style( 'styles', plugins_url( 'css/colorbox.css', __FILE__) );
91
+ wp_enqueue_script( 'jquery.colorbox-min', plugins_url( 'scripts/jquery.colorbox-min.js', __FILE__) );
92
+ }
93
+
94
+
95
+ /**
96
+ * Output JQuery command to trigger Colorbox for links in the <head>
97
+ */
98
+
99
+ add_action ( 'wp_head', 'wprss_head_output' );
100
+
101
+ function wprss_head_output() {
102
+ echo "<script type='text/javascript'>jQuery(document).ready(function(){ jQuery('a.colorbox').colorbox({iframe:true, width:'80%', height:'80%'});});</script>";
103
+ }
104
+
105
+
106
+ /**
107
+ * Include CSS in plugin page header
108
+ */
109
+
110
+ function wprss_header() {
111
+ wp_enqueue_style( 'styles', plugins_url( 'css/styles.css', __FILE__) );
112
+ }
113
+
114
+
115
+ /**
116
+ * Plugin administration page
117
+ */
118
+
119
+ // Add the admin options page
120
+ add_action( 'admin_menu', 'wprss_add_page' );
121
+
122
+ function wprss_add_page() {
123
+ add_options_page( 'RSS Aggregator', 'RSS Aggregator', 'manage_options', 'wprss_aggregator', 'wprss_options_page' );
124
+ }
125
+
126
+ /**
127
+ * Draw options page
128
+ */
129
+
130
+ function wprss_options_page() {
131
+ ?>
132
+ <div class="wrap">
133
+ <?php screen_icon(); ?>
134
+
135
+
136
+ <h2>WordPress RSS Aggregator</h2>
137
+ <div id="options">
138
+ <form action="options.php" method="post">
139
+ <?php
140
+
141
+ settings_fields( 'wprss_options' );
142
+ do_settings_sections( 'wprss' );
143
+ $options = get_option( 'wprss_options' );
144
+ if ( !empty($options) ) {
145
+ $size = count($options);
146
+ for ( $i=1; $i<=$size; $i++ ) {
147
+ if( $i % 2 == 0 ) continue;
148
+ echo "<div class='wprss-input'>";
149
+
150
+ $key = key( $options );
151
+
152
+ echo "<p><label class='textinput' for='$key'>" . wprss_convert_key( $key ) . "</label>
153
+ <input id='$key' class='wprss-input' size='100' name='wprss_options[$key]' type='text' value='$options[$key]' /></p>";
154
+
155
+ next( $options );
156
+
157
+ $key = key( $options );
158
+
159
+ echo "<p><label class='textinput' for='$key'>" . wprss_convert_key( $key ) . "</label>
160
+ <input id='$key' class='wprss-input' size='100' name='wprss_options[$key]' type='text' value='$options[$key]' /></p>";
161
+
162
+ next( $options );
163
+ echo "</div>";
164
+
165
+ }
166
+ }
167
+
168
+ $siteurl = get_option('siteurl');
169
+ $images_url = $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/images';
170
+ ?>
171
+ <div id="buttons"><a href="#" id="add"><img src="<?php echo $images_url; ?>/add.png"></a>
172
+ <a href="#" id="remove"><img src="<?php echo $images_url; ?>/remove.png"></a></div>
173
+ <p class="submit"><input type="submit" value="Save Settings" name="submit" class="button-primary"></p>
174
+
175
+ </form>
176
+ </div>
177
+ </div>
178
+ <?php
179
+ }
180
+
181
+
182
+ /**
183
+ * Register and define settings
184
+ */
185
+
186
+ add_action( 'admin_init', 'wprss_admin_init' );
187
+
188
+ function wprss_admin_init() {
189
+ register_setting( 'wprss_options', 'wprss_options' );
190
+ add_settings_section( 'wprss_main', 'WP RSS Aggregator settings', 'wprss_section_text', 'wprss' );
191
+ }
192
+
193
+
194
+ /**
195
+ * Explain the options section
196
+ */
197
+
198
+ function wprss_section_text() {
199
+ echo '<p>Enter a name and URL for each of your feeds. The name is used just for your reference.</p>';
200
+ }
201
+
202
+
203
+ /**
204
+ * Convert from field name to user-friendly name
205
+ */
206
+
207
+ function wprss_convert_key( $key ) {
208
+ if ( strpos( $key, 'feed_name_' ) === 0 ) {
209
+ $label = str_replace( 'feed_name_', 'Feed name ', $key );
210
+ }
211
+
212
+ else if ( strpos( $key, 'feed_url_' ) === 0 ) {
213
+ $label = str_replace( 'feed_url_', 'Feed URL ', $key );
214
+ }
215
+ return $label;
216
+ }
217
+
218
+
219
+ /**
220
+ * Set up shortcodes and call the main function for output
221
+ */
222
+
223
+ // Register a new shortcode
224
+ add_shortcode( 'wp_rss_aggregator', 'wprss_shortcode');
225
+
226
+ function wprss_shortcode( $atts ) {
227
+ if ( !empty ($atts) ) {
228
+ foreach ( $atts as $key => &$val ) {
229
+ $val = html_entity_decode($val);
230
+ }
231
+ }
232
+ wp_rss_aggregator( $atts );
233
+ }
234
+
235
+
236
+ /**
237
+ * Get feeds and output the aggregation
238
+ */
239
+
240
+ function wp_rss_aggregator( $args = array() ) {
241
+
242
+ $defaults = array(
243
+ 'date_before' => '<h3>',
244
+ 'date_after' => '</h3>',
245
+ 'links_before' => '<ul>',
246
+ 'links_after' => '</ul>',
247
+ 'link_before' => '<li>',
248
+ 'link_after' => '</li>'
249
+ );
250
+
251
+ // Parse incoming $args into an array and merge it with $defaults
252
+ $args = wp_parse_args( $args, $defaults );
253
+ // Declare each item in $args as its own variable
254
+ extract( $args, EXTR_SKIP );
255
+
256
+ $wprss_options = get_option( 'wprss_options', 'option not found' );
257
+
258
+ foreach ( $wprss_options as $key => $value ) {
259
+ if ( strpos( $key, 'feed_url_' ) === 0 ) {
260
+ $feed_uris[] = $value;
261
+ }
262
+ }
263
+
264
+ if ( !empty( $feed_uris ) ) {
265
+ // update feeds every hour else serve from cache
266
+ function wprss_hourly_feed() { return 3600; }
267
+ add_filter( 'wp_feed_cache_transient_lifetime', 'wprss_hourly_feed' );
268
+ $feed = fetch_feed( $feed_uris );
269
+ }
270
+ else echo 'No feed defined';
271
+ remove_filter( 'wp_feed_cache_transient_lifetime', 'wprss_hourly_feed' );
272
+
273
+ $items = $feed->get_items();
274
+ $items_today = array();
275
+ $items_yesterday = array();
276
+ $items_two_days_ago = array();
277
+ $items_older = array();
278
+
279
+
280
+ foreach ( $items as $item ):
281
+ $item_date = $item->get_date('l jS F (Y-m-d)');
282
+ if ( $item_date == date('l jS F (Y-m-d)', strtotime('today') ) ) {
283
+ $items_today[] = $item;
284
+ }
285
+ else if ( $item_date == date('l jS F (Y-m-d)', strtotime('yesterday') ) ) {
286
+ $items_yesterday[] = $item;
287
+ }
288
+ else if ( $item_date == date('l jS F (Y-m-d)', strtotime('-2 days') ) ) {
289
+ $items_two_days_ago[] = $item;
290
+ }
291
+ else {
292
+ $items_older[] = $item;
293
+ }
294
+ endforeach;
295
+
296
+ if ( !empty( $items_today ) ) {
297
+ echo $date_before . 'Today' . $date_after;
298
+ echo $links_before;
299
+ foreach ( $items_today as $item ) {
300
+
301
+ echo $link_before . '<a class="colorbox" href="' . $item->get_permalink() .'">'. $item->get_title(). ' '. '</a>';
302
+ echo '<br><span class="feed-source">Source: '.$item->get_feed()->get_title()/* . ' | ' . $item->get_date('l jS F').''*/ . '</span>';
303
+ echo $link_after;
304
+
305
+ }
306
+ echo $links_after;
307
+ }
308
+
309
+ if ( !empty( $items_yesterday ) ) {
310
+ echo $date_before . 'Yesterday' . $date_after;
311
+ echo $links_before;
312
+ foreach ( $items_yesterday as $item ) {
313
+ echo '<li><a class="colorbox" href="' . $item->get_permalink() .'">'. $item->get_title(). ' '. '</a>';
314
+ echo '<br><span class="feed-source">Source: '.$item->get_feed()->get_title()/* . ' | ' . $item->get_date('l jS F').''*/ . '</span>';
315
+ echo $link_after;
316
+ }
317
+ echo $links_after;
318
+ }
319
+
320
+ if ( !empty( $items_two_days_ago ) ) {
321
+ echo $date_before . '2 days ago' . $date_after;
322
+ echo $links_before;
323
+ foreach ( $items_two_days_ago as $item ) {
324
+ echo '<li><a class="colorbox" href="' . $item->get_permalink() .'">'. $item->get_title(). ' '. '</a>';
325
+ echo '<br><span class="feed-source">Source: '.$item->get_feed()->get_title()/* . ' | ' . $item->get_date('l jS F').''*/ . '</span>';
326
+ echo $link_after;
327
+ }
328
+ echo $links_after;
329
+ }
330
+ if ( !empty( $items_older ) ) {
331
+ echo $date_before . 'More than 2 days ago' . $date_after;
332
+ echo $links_before;
333
+ foreach ( $items_older as $item ) {
334
+ echo '<li><a class="colorbox" href="' . $item->get_permalink() .'">'. $item->get_title(). ' '. '</a>';
335
+ echo '<br><span class="feed-source">Source: '.$item->get_feed()->get_title() . ' | ' . $item->get_date('l jS F').'</span>';
336
+ echo $link_after;
337
+ }
338
+ echo $links_after;
339
+ }
340
+ }
341
+
342
+ // use just for testing - runs on each wp load
343
+ //add_action( 'wp_loaded', 'wp_rss_aggregator' );
344
+
345
+ ?>