Changeset 176996
- Timestamp:
- 11/25/2009 06:34:59 PM (16 years ago)
- Location:
- feedlist/trunk/feedList
- Files:
-
- 2 edited
-
feedlist.php (modified) (12 diffs)
-
readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
feedlist/trunk/feedList/feedlist.php
r157336 r176996 6 6 Author: Bill Rawlinson 7 7 Author URI: http://blog.rawlinson.us/ 8 Version: 2. 248 Version: 2.50 9 9 */ 10 10 … … 85 85 ($this->args['feedsToShow'] > sizeof($feedInfo)) ? sizeof($feedInfo) : $this->args['feedsToShow']; 86 86 87 87 88 // we will fetch each feed, then coallate items 88 89 for($i=0;$i<$this->args['feedsToShow'];$i++){ 90 89 91 $thisFeed = $feedInfo[$i]; 90 92 … … 137 139 138 140 // coallate feed items 139 echo$this->output;141 return $this->output; 140 142 141 143 } … … 185 187 $Translations['fr_FR']['ReadMore'] = 'Lisez davantage'; 186 188 187 $feedListFile = '/feeds.txt'; // IF you are going to use the random feedlist generator make sure this holds the correct name for your feed file:189 $feedListFile = ABSPATH . 'wp-content\plugins\feeds.txt'; // IF you are going to use the random feedlist generator make sure this holds the correct name for your feed file: 188 190 189 191 // Build an array out of the settings and send them back: … … 219 221 'max_characters' => 0, 220 222 'max_char_wordbreak' => true, 221 'file'=>$settings['f ile'],223 'file'=>$settings['feedListFile'], 222 224 'feedsToShow'=>0, 225 'itemsPerFeed'=>1, 223 226 'mergeFeeds'=>false, 224 227 'show_date_per_item' => false, … … 501 504 */ 502 505 $x = file($file); 503 return preg_split("/--NEXT--/", join('', file($file)));506 return preg_split("/--NEXT--/", join('', $x)); 504 507 } 505 508 … … 535 538 $i++; 536 539 } 540 537 541 return $a; 538 542 } … … 586 590 return preg_replace_callback("/<!--rss:(.*)-->/", "feedListFilter", $text); 587 591 } 592 function rssLinkListFileFilter($text) 593 { 594 return preg_replace_callback("/<!--rssFile:(.*)-->/", "feedListFileFilter", $text); 595 } 588 596 589 597 … … 606 614 607 615 function randomFeedList($args){ 616 echo processRandomFeedList($args); 617 } 618 619 function processRandomFeedList($args){ 608 620 if(!is_array($args)){ 609 621 $args = parse_str($args,$a); … … 611 623 } 612 624 $feed = new FeedList($args); 625 $feed->Debug("called"); 613 626 return $feed->FeedListFile(); 614 627 } … … 633 646 634 647 $feed = new FeedList($args); 635 636 648 return $feed->FeedListFilter(); 649 } 650 651 function feedListFileFilter($args){ 652 $args = explode(",",$args[1]); 653 654 655 if(count($args) == 1 && !strpos($args[0],":=")){ 656 $a = array(); 657 $a["file"] = $args[0]; 658 $args = $a; 659 } else { 660 $a = array(); 661 foreach($args as $arg){ 662 $arg = explode(":=",$arg); 663 $a[$arg[0]] = $arg[1]; 664 } 665 $args = $a; 666 667 } 668 669 return processRandomFeedList($args); 670 637 671 } 638 672 … … 642 676 { 643 677 add_filter('the_content', 'rssLinkListFilter'); 678 add_filter('the_content', 'rssLinkListFileFilter'); 644 679 } 645 680 -
feedlist/trunk/feedList/readme.txt
r157336 r176996 5 5 Requires at least: 1.5 6 6 Tested up to: 2.8.4 7 Stable tag: 2. 247 Stable tag: 2.50 8 8 9 9 Allows you to display lists of links from an rss or atom feed on your blog. … … 93 93 94 94 23 Sep 2009 fixed a variety of issues identified at http://code.google.com/p/wp-feedlist/issues/list (issues: 15, 17, 22, 30, 31, 32, 37) 95 96 25 Nov 2009 Added filter for posts to use the random feed file 95 97 ------------------------------------------------------------------------------------------------------- 96 98 … … 107 109 limited testing with non UTF-8 encoding. 108 110 111 == KNOWN BUG == 112 using the rssFile filter results in a duplication of the feedList display 109 113 110 114 … … 179 183 180 184 185 * random file: 186 <!--rssFile:[FilePath]--> 187 188 NOTE: if you aren't using named parameters with the filter only provide the full path to the file or else it won't work. 189 NOTE: if you don't provide a filepath the default one set in the file, feedlist.php near line 187 will be used (typically siteroot\wp-content\plugins\feeds.txt) 190 191 * Named Parameters 192 <!--rssFile:feedsToShow:=1,num_items:=3,file:=c:\dev\websites\wordpress\wp-content\plugins\feeds2.txt--> 193 194 NOTE: this example will pull one feed from the file, and then show 3 items fro the feed 181 195 182 196 … … 257 271 258 272 ADVANCED: 259 <?php randomFeedList("feedsToShow=2& itemsPerFeed=3") ?>273 <?php randomFeedList("feedsToShow=2&num_items=3") ?> 260 274 261 275 there are ALOT of parameters you can pass into randomFeedList. I am taking a different approach to it here than I do elsewhere in the feedList plugin. … … 266 280 file - the path to your feedfile (default: '.wp-content/plugins/feeds.txt') 267 281 feedsToShow - the number of feeds to poll from your feedfile (default: 5) 268 itemsPerFeed- the number of items to show from each feed polled (default: 1)282 num_items - the number of items to show from each feed polled (default: 1) 269 283 show_description - show the description of each item or not (default: false) 270 284 randomItemsPerFeed - not only can you show random feeds from the feed file but you can also show random items from each feed (default: true)
Note: See TracChangeset
for help on using the changeset viewer.