WordPress.org

Plugin Directory

Changeset 513346 for syndicate-press


Ignore:
Timestamp:
03/02/12 05:22:02 (2 years ago)
Author:
hranchFundi
Message:

v1.0.8

  • custom (per bbcode) inclusive and exclusive filters
  • new custom Formatting tab
  • Updated help tab
Location:
syndicate-press/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • syndicate-press/trunk/readme.txt

    r513340 r513346  
    55Requires at least: 2.8 
    66Tested up to: 3.3.1 
    7 Stable tag: 1.0.7 
     7Stable tag: 1.0.8 
    88 
    99Syndicate Press lets you include RSS, RDF or Atom feeds directly in your Wordpress posts, pages, widgets or theme.  
     
    3434== Screenshots == 
    3535Here is a screenshot of the Admin Control Panel:<br> 
     36 
    3637<img src="http://henryranch.net/wp-content/uploads/2009/10/tab_news-150x150.jpg"><br><br> 
    3738 
    3839Please see the following pages for examples of the syndicated news feeds on a Wordpress blog:<br> 
     40 
    3941http://henryranch.net/news/ <br> 
     42 
    4043http://henryranch.net/news/real-time-earthquake-news/ <br> 
     44 
    4145http://henryranch.net/news/science-technology/ <br> 
    4246 
     
    4448 
    4549http://henryranch.net/software/syndicate-press/syndicate-press-releases/ 
     50 
     511.0.8: Added ability to define inclusive and exclusive filters within the bbcode i.e. [sp# feedname include=keyword exclude=keyword] 
     52Moved the custom formatting config out of the Display Options tab and into the new Custom Formatting tab 
    4653 
    47541.0.7: Fixed an image display bug.  Placed the cache control buttons at the top of the admin UI. 
     
    6774 
    6875Please see the following pages for examples of the syndicated news feeds on a Wordpress blog:<br> 
     76 
    6977http://henryranch.net/news/ <br> 
     78 
    7079http://henryranch.net/news/real-time-earthquake-news/ <br> 
     80 
    7181http://henryranch.net/news/science-technology/ <br> 
  • syndicate-press/trunk/syndicate-press-plugin.php

    r512000 r513346  
    55Description: This plugin provides a high performance, highly configurable and easy to use news syndication aggregator which supports RSS, RDF and ATOM feeds. 
    66Author: HenryRanch LLC (henryranch.net) 
    7 Version: 1.0.7 
     7Version: 1.0.8 
    88Author URI: http://henryranch.net/ 
    99License: GPL2 
     
    6161if (!class_exists("SyndicatePressPlugin")) { 
    6262    class SyndicatePressPlugin { 
    63         var $version = "1.0.7"; 
     63        var $version = "1.0.8"; 
    6464        var $homepageURL = "http://henryranch.net/software/syndicate-press/"; 
    6565         
     
    197197                        * @package WordPress 
    198198                        * @since version 2.8.4 
    199                         * @param    string    $content    the post/page content 
     199                        * @param    string    $bbCodeTagArray    the values passed in from the bbcode: [sp# match1,match2,match3] 
    200200                        * @return   string     the post/page content with relevant RSS feeds embedded in place of syndicate press bbcodes 
    201201                        */ 
    202         function sp_filterCallback($matches) 
     202        function sp_filterCallback($bbCodeTagArray) 
    203203        { 
    204204            $startTime = $this->sp_getCurrentTime(); 
     
    212212            $content = ''; 
    213213             
     214        
    214215            $enableOutputCache = $configOptions['enableOutputCache']; 
    215             $pageFeedReference = implode(",", $matches); 
     216            $pageFeedReference = implode(",", $bbCodeTagArray); 
     217            //echo "page feed reference: $pageFeedReference<br>"; 
     218            $pageFeedReferenceArray = split(" ", $pageFeedReference); 
    216219            $outputCacheFilename = $this->sp_getOutputCacheFilename($pageFeedReference); 
    217             //print "enableOutputCache: $enableOutputCache <br>"; 
    218220            if(($enableOutputCache == 'true') && !$this->sp_incomingFeedCacheExpired($url) && file_exists($outputCacheFilename)) 
    219221            { 
    220                 //print "Using content from output cache file: $outputCacheFilename<br>"; 
    221222                $content = file_get_contents($outputCacheFilename); 
    222223            } 
     
    224225            { 
    225226                //print "Formatting content...<br>"; 
    226                 foreach($matches as $feedNameReference) 
    227                 { 
    228                     $feedNameReference = trim($feedNameReference);                     
     227                foreach($bbCodeTagArray as $feedNameReference) 
     228                {   
     229                    $feedNameReference = trim($feedNameReference);  
     230                    //ignore array element s that are just the bbcode text.  we don't need the bbcode text b/c the following text is the bbcode parameters as extracted by the sp bbcode filter 
     231                    if(strpos($feedNameReference, '[') !== false) 
     232                    { 
     233                        continue; 
     234                    } 
     235                    $bbcodeParams = explode(' ', $feedNameReference); 
     236                    $feedNameReference = $bbcodeParams[0]; 
     237                    //extract any known params 
     238                    foreach($bbcodeParams as $param) 
     239                    { 
     240                        if(strpos($param, 'include') !== false) 
     241                        { 
     242                            $list = explode('=', $param); 
     243                            $customConfigOverrides['includeFilterList'] = $list[1]; 
     244                        } 
     245                        else if(strpos($param, 'exclude') !== false) 
     246                        { 
     247                            $list = explode('=', $param); 
     248                            $customConfigOverrides['excludeFilterList'] = $list[1]; 
     249                        } 
     250                    } 
    229251                    foreach($availableFeeds as $availableFeed) 
    230252                    { 
     
    236258                        //split the reference string on ',' (comma).  this is the feed reference list provided in the bbcode: [sp# feed1,feed2,feed3,etc...] 
    237259                        $feedNameList = explode(',', $feedNameReference); 
     260                        //print_r($feedNameList); 
    238261                        foreach($feedNameList as $feedName) 
    239262                        { 
     
    248271                                    //print "feed URL: $availableFeed <br>";  
    249272                                } 
    250                                 $content .= $this->sp_getFormattedRssContent($availableFeed); 
     273                                $content .= $this->sp_getFormattedRssContent($availableFeed, $customConfigOverrides); 
    251274                                if($configOptions['feedSeparationHTMLCode'] != "") 
    252275                                { 
     
    532555                        * @return   string     html formatted rss feed content from the given url. 
    533556                        */ 
    534         function sp_getFormattedRssContent($url) 
     557        function sp_getFormattedRssContent($url, $customConfigOverrides = NULL) 
    535558        { 
    536559            include_once "php/TinyFeedParser.php"; 
     560            if(isset($customConfigOverrides)) 
     561            { 
     562                $customConfigExclusiveKeywords = $customConfigOverrides['excludeFilterList']; 
     563                $customConfigInclusiveKeywords = $customConfigOverrides['includeFilterList']; 
     564            } 
    537565             
    538566            //make sure there are no whitespaces leading or trailing the URL string 
     
    557585                $parser->showContentOnlyInLinkTitle = $configOptions['showContentOnlyInLinkTitle']; 
    558586                $parser->maxNumArticlesToDisplay = $configOptions['limitFeedItemsToDisplay']; 
    559                 $parser->exclusiveKeywordList = $configOptions['exclusiveKeywordFilter']; 
    560                 $parser->inclusiveKeywordList = $configOptions['inclusiveKeywordFilter']; 
     587                 
     588                $parser->exclusiveKeywordList = $configOptions['exclusiveKeywordFilter'] . ',' . $customConfigExclusiveKeywords; 
     589                $parser->exclusiveKeywordList = trim($parser->exclusiveKeywordList, ','); 
     590                $parser->inclusiveKeywordList = $configOptions['inclusiveKeywordFilter'] . ',' . $customConfigInclusiveKeywords; 
     591                $parser->inclusiveKeywordList = trim($parser->inclusiveKeywordList, ',');                 
     592                 
    561593                $parser->maxDescriptionLength = $configOptions['limitFeedDescriptionCharsToDisplay']; 
    562594                $parser->showFeedChannelTitle = $configOptions['showFeedChannelTitle']; 
     
    10021034        </div> 
    10031035        </div> 
     1036     </div> 
     1037     </div>      
     1038     <div class="tabbertab"> 
     1039        <h2>Custom Formatting</h2> 
    10041040        Title formatting:<br> 
    10051041        <div style="padding-left: 20px;"> 
     
    10231059        <textarea name="syndicatePressFeedNotAvailableHTMLCode" style="width: 95%; height: 100px;"><?php _e($this->sp_unescapeString(apply_filters('format_to_edit',$configOptions['feedNotAvailableHTMLCode'])), 'SyndicatePressPlugin') ?></textarea> 
    10241060        </div> 
    1025      </div> 
    10261061     </div> 
    10271062     <div class="tabbertab"> 
     
    10341069        [sp# feedname] - insert only the feed with the given name<br> 
    10351070        [sp# feedname1,feedname2,etc...] - insert the feeds with the given names<br> 
    1036         &lt;?php sp_getFeedContent("feedname");?&gt; - inserts the feed(s) into a theme location 
     1071        [sp# feedname1,feedname2 include=keyword1,keyword2] - insert the feeds with the given names and the given inclusive keyword filters<br> 
     1072        [sp# feedname1,feedname2 exclude=keyword1,keyword2] - insert the feeds with the given names and the given exclusive keyword filters<br> 
     1073        [sp# feedname include=keyword exclude=keyword] - insert the feeds with the given name and the given inclusive and exclusive keyword filters<br> 
    10371074        </p> 
    10381075        </div>         
     
    10441081        </p> 
    10451082        </div> 
     1083        <b><u>Respecting publishers terms of use</u></b> 
     1084        <div style="padding-left: 20px;"> 
     1085        <p> 
     1086        By using Syndicate Press you accept full resposibility and liability for adherance to the terms of service of each feed you syndicate.  Please respect the copyright of feed publishers. 
     1087        </p> 
     1088        </div> 
    10461089        <b><u>Credits</u></b> 
    10471090        <div style="padding-left: 20px;"> 
    1048         Lightweight tab library provided by <a href="http://www.barelyfitz.com/projects/tabber/" target=_blank>tabber</a> 
    1049         </div> 
     1091        Syndicate Press is designed, developed, published and maintained by HenryRanchLLC.  No warranties of any kind are made or implied regarding the operation of Syndicate Press.   
     1092        The Syndicate Press Wordpress plugin file is licensed to you under the GPL2.0.  Other files included within the Syndicate Press plugin package are licensed according to the license described in those files.<br><br> 
     1093        Admin panel tab library provided by <a href="http://www.barelyfitz.com/projects/tabber/" target=_blank>tabber</a> 
     1094        </div><br><br> 
    10501095        <p> 
    1051         <a href="<?php echo $this->homepageURL; ?>" target=_blank title="Click for the Syndicate Press homepage...">Help and documentation...</a><br> 
     1096        <a href="<?php echo $this->homepageURL; ?>" target=_blank title="Click for the Syndicate Press homepage...">More Help and documentation...</a><br> 
    10521097        </p> 
    10531098     </div>          
Note: See TracChangeset for help on using the changeset viewer.