Plugin Directory

Changeset 226645


Ignore:
Timestamp:
04/08/2010 08:14:42 PM (16 years ago)
Author:
finalcut
Message:

v2.6 added optional support for SimplePie instead of magpie

Location:
feedlist/trunk/feedList
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • feedlist/trunk/feedList/feedlist.php

    r195375 r226645  
    66    Author: Bill Rawlinson
    77    Author URI: http://blog.rawlinson.us/
    8     Version: 2.51
     8    Version: 2.6
    99*/
    1010
    1111// setup error level
    12  error_reporting(E_ERROR);
     12 error_reporting(0);
     13
     14
     15// use Magpie? or SimplePie?
     16$useMagPie = true;
    1317
    1418
     
    1721            $relroot = ABSPATH . '/';
    1822            require_once('feedListExtensions.php');
    19         // get the magpie libary
    20             if (file_exists($relroot . 'wp-includes/rss.php')) {
    21                 require_once($relroot . 'wp-includes/rss.php');
    22             } else if(file_exists($relroot . 'wp-includes/rss-functions.php')){
    23                 require_once($relroot . 'wp-includes/rss-functions.php');
    24             } else {
    25                 function FeedListInitError(){
    26                 ?>
    2723           
    28                 <div id="message" style="margin-top: 15px; padding: 10px;" class="updated fade">There was a problem initializing the feedlist plugin.  Make sure the file feedlist.php is in the feedList directory under your <strong>wp-content/plugins</strong> directory.</div>
    29             <?
    30                 }
     24
     25
     26
     27            if($useMagPie){
     28            // get the magpie libary
     29                if (file_exists($relroot . 'wp-includes/rss.php')) {
     30                    require_once($relroot . 'wp-includes/rss.php');
     31                } else if(file_exists($relroot . 'wp-includes/rss-functions.php')){
     32                    require_once($relroot . 'wp-includes/rss-functions.php');
     33                } else {
     34                    function FeedListInitError(){
     35                    ?>
     36                        <div id="message" style="margin-top: 15px; padding: 10px;" class="updated fade">There was a problem initializing the feedlist plugin.  Make sure the file feedlist.php is in the feedList directory under your <strong>wp-content/plugins</strong> directory.</div>
     37                    <?
     38                    }
     39                }
     40            } else{
     41                require_once('simplepie.php');
    3142            }
    3243        // end
     
    97108                        $this->rs = $this->GetFeed($feedUrl);
    98109
    99                         if($this->rs){
    100                             $this->items = $this->rs->items;
    101 
     110                        if($this->items){
    102111                            if($this->args['random']){
    103112                                shuffle($this->items);
     
    240249
    241250                $this->output = '';
    242                 if($this->rs){
    243                     $this->items = $this->rs->items;
     251                if($this->items){
    244252                    if($this->args['random']){
    245253                        shuffle($this->items);
     
    550558                if(function_exists('fetch_rss')){
    551559                    $this->feed =  fetch_rss($feedUrl);
    552                 }
     560                    if($this->feed){
     561                        $this->items = $this->feed->items;
     562                    }
     563                }elseif(function_exists('simplepie_fetch_rss')) {
     564                    $this->feed = simplepie_fetch_rss($feedUrl,!$this->args['ignore_cache'],$settings["cacheTimeout"]);
     565                    if($this->feed){
     566                        $this->items = $this->feed["items"];
     567                    }
     568                }else {
     569                    print ('rss functionality not available');
     570                }
    553571                return $this->feed;
    554572               
  • feedlist/trunk/feedList/readme.txt

    r195375 r226645  
    44Tags: rss, atom, feeds, listings
    55Requires at least: 1.5
    6 Tested up to: 2.8.4
    7 Stable tag: 2.51
     6Tested up to: 3.0
     7Stable tag: 2.6
    88
    99Allows you to display lists of links from an rss or atom feed on your blog.
     
    9797
    9898    19 Jan 2010         Added new option of to display rel="nofollow" on the links.  Option is called "no_follow_on" and by default is set to false.
     99
     100    08 Apr 2010         Added support for SimplePIE feed parsing as an alternative to the default magpie choice.
    99101-------------------------------------------------------------------------------------------------------
    100102 
     
    252254
    253255
     256    -------------------
     257    SIMPLE PIE
     258    -------------------
     259    If your feeds don't show up properly OR you just want to use a more modern feed parsing engine go into feedList.php and change $useMagPie = false; instead of true.
     260    Eventually this will be the only way I pull back feeds but to insure backward compatability at the moment magpie is remaining the default parser.
    254261
    255262
Note: See TracChangeset for help on using the changeset viewer.