WordPress.org

Plugin Directory

Changeset 658509 for syndicate-press


Ignore:
Timestamp:
01/25/13 05:06:01 (15 months ago)
Author:
hranchFundi
Message:

1.0.23: New feature release: Show the first X number of articles from a feed and then hide the rest. Allow the website viewer to click a link to show the hidden articles. Setting is available on the 'Display Settings' tab of the SP Admin panel

Location:
syndicate-press/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • syndicate-press/trunk/php/TinyFeedParser.php

    r648984 r658509  
    22/* 
    33File: TinyFeedParser.php 
    4 Date: 1/6/2013 
    5 Version 1.9.9 
     4Date: 1/24/2013 
     5Version 1.9.10 
    66Author: HenryRanch LLC 
    77 
     
    7070    var $articles = array(); 
    7171     
     72    var $feedIndex = 0; 
     73 
    7274    var $feedUpdateTime = ''; 
    7375     
     
    8385    var $showFeedMetrics = true; 
    8486    var $maxNumArticlesToDisplay = 5; 
     87    var $hideArticlesAfterArticleNumber = -1; 
    8588    var $exclusiveKeywordList = ""; 
    8689    var $inclusiveKeywordList = ""; 
     
    550553    } 
    551554     
     555    function getJS() 
     556    { 
     557        return '<script language="javascript">'. 
     558               'function toggle(elementId) {'. 
     559               'var ele = document.getElementById(elementId);'. 
     560               'var text = document.getElementById("displayText");'. 
     561               'if(ele.style.display == "block") {'. 
     562               'ele.style.display = "none";'. 
     563               //'text.innerHTML = "show";'. 
     564               '}'. 
     565               'else {'. 
     566               'ele.style.display = "block";'. 
     567               //'text.innerHTML = "hide";'. 
     568               '}'. 
     569               '} '. 
     570               '</script>'; 
     571    } 
     572 
    552573    function getHtml() 
    553574    { 
    554575        $html = ""; 
     576 
     577        if($this->hideArticlesAfterArticleNumber > 1) 
     578        { 
     579            $html .= $this->getJS(); 
     580        } 
     581 
    555582        $articles = $this->articles; 
    556583        $currentArticleIndex = 0; 
     
    566593            else 
    567594            { 
     595                if(($this->hideArticlesAfterArticleNumber > 1) && (($currentArticleIndex - 2) == $this->hideArticlesAfterArticleNumber)) 
     596                { 
     597                    $hiddenDivId = 'hiddenArticleDiv-'.rand().'-feedIndex-'.$this->feedIndex; 
     598                    $html .= "<br><div id=\"showHideArticlesControlDiv\"><a id=\"displayText\" href=\"javascript:toggle('".$hiddenDivId."');\">Show / Hide more articles from this feed.</a><br></div>"; 
     599                    $html .= "<div id=\"".$hiddenDivId."\" style=\"display: none\">\r\n"; 
     600                } 
    568601                $headerHtmlPre = $this->articleTitleHTMLCodePre; 
    569602                $headerHtmlPost = $this->articleTitleHTMLCodePost; 
     
    582615                } 
    583616            } 
    584             $html .= "<div id=\"articleDiv-".($currentArticleIndex-1)."\">\r\n"; 
     617            $html .= "<div id=\"itemDiv-feed-".$this->feedIndex.'-article-'.($currentArticleIndex-1)."\">\r\n"; 
    585618            if($article->image) 
    586619            { 
     
    663696            $html .= "</div>\r\n"; 
    664697        } 
     698        if($this->hideArticlesAfterArticleNumber > 1) 
     699        { 
     700            $html .= "</div>\r\n"; 
     701        } 
    665702        return $html; 
    666703    } 
  • syndicate-press/trunk/readme.txt

    r653372 r658509  
    44Tags: RSS,RDF,Atom,feed,syndicate,syndication,news,aggregator,aggregation,plugin,active,maintained,custom,widget,post,plugin,posts,admin,sidebar,theme,comments,images,twitter,page,google,links 
    55Requires at least: 2.8 
    6 Tested up to: 3.5 
    7 Stable tag: 1.0.22 
     6Tested up to: 3.5.1 
     7Stable tag: 1.0.23 
    88 
    99Syndicate Press lets you include RSS, RDF or Atom feeds directly in your Wordpress posts, pages, widgets or theme.  
     
    4747 
    4848http://syndicatepress.henryranch.net/documentation/changelog/ 
     49 
     501.0.23: New feature release<br> 
     51- Show the first X number of articles from a feed and then hide the rest.  Allow the website viewer to click a link to show the hidden articles.<br> 
     52 
    4953 
    50541.0.22: New feature release<br> 
  • syndicate-press/trunk/syndicate-press-plugin.php

    r653395 r658509  
    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.22 
     7Version: 1.0.23 
    88Author URI: http://syndicatepress.henryranch.net/ 
    99License: GPL2 
     
    6464if (!class_exists("SyndicatePressPlugin")) { 
    6565  class SyndicatePressPlugin { 
    66         var $version = "1.0.22"; 
     66        var $version = "1.0.23"; 
    6767        var $homepageURL = "http://syndicatepress.henryranch.net/"; 
    6868         
     
    9595            'showArticlePublishTimestamp' => 'true', 
    9696            'limitFeedItemsToDisplay' => -1,  
     97            'hideArticlesAfterArticleNumber' => -1, 
    9798            'limitFeedDescriptionCharsToDisplay' => -1,  
    9899            'maxHeadlineLength' => -1, 
     
    305306                        } 
    306307                    } 
     308                    $feedIndex = 0; 
    307309                    foreach($availableFeeds as $availableFeed) 
    308310                    { 
     
    313315                        } 
    314316                        //split the reference string on ',' (comma).  this is the feed reference list provided in the bbcode: [sp# feed1,feed2,feed3,etc...] 
    315             //echo 'feed name ref: '.$feedNameReference.'<br>'; 
    316             $feedNameList = explode(',', $feedNameReference); 
    317              
     317                        //echo 'feed name ref: '.$feedNameReference.'<br>'; 
     318                        $feedNameList = explode(',', $feedNameReference); 
    318319                        foreach($feedNameList as $feedName) 
    319320                        { 
    320               $feedName = trim($feedName); 
     321                            $feedName = trim($feedName); 
    321322                            //print "Checking feedname: '$feedName' against available feed: '$availableFeed'<br>";  
    322323                            if(strpos($availableFeed, $feedName) !== false || ($feedName == 'all')) 
     
    330331                                    //print "feed URL: $availableFeed <br>";  
    331332                                } 
    332                                 $content .= $this->sp_getFormattedRssContent($availableFeed, $customConfigOverrides); 
     333                                $content .= $this->sp_getFormattedRssContent($feedIndex, $availableFeed, $customConfigOverrides); 
     334                                $feedIndex += 1; 
    333335                                if($configOptions['feedSeparationHTMLCode'] != '') 
    334336                                { 
     
    704706         * @return   string     html formatted rss feed content from the given url. 
    705707         */ 
    706         function sp_getFormattedRssContent($url, $customConfigOverrides = NULL) 
     708        function sp_getFormattedRssContent($feedIndex, $url, $customConfigOverrides = NULL) 
    707709        { 
    708710            include_once "php/TinyFeedParser.php"; 
     
    735737                $configOptions = $this->sp_getConfigOptions(); 
    736738                $parser = new TinyFeedParser($cachedInputFeedFile); 
     739                $parser->feedIndex = $feedIndex; 
     740                //echo "feedIndex: $feedIndex<br>"; 
    737741                $parser->showContentOnlyInLinkTitle = $configOptions['showContentOnlyInLinkTitle']; 
    738742                $parser->maxNumArticlesToDisplay = $configOptions['limitFeedItemsToDisplay']; 
     
    760764                $parser->allowMarkupInDescription = $configOptions['allowMarkupInDescription']; 
    761765                $parser->addNoFollowTag = $configOptions['addNoFollowTag']; 
     766                $parser->hideArticlesAfterArticleNumber = $configOptions['hideArticlesAfterArticleNumber']; 
    762767                if($configOptions['timestampFormat']  != '') 
    763768                { 
     
    963968        if (isset($_POST['syndicatePressLimitFeedItemsToDisplay'])) { 
    964969          $configOptions['limitFeedItemsToDisplay'] = $_POST['syndicatePressLimitFeedItemsToDisplay']; 
     970        }   
     971        if (isset($_POST['syndicatePressHideArticlesAfterArticleNumber'])) { 
     972          $configOptions['hideArticlesAfterArticleNumber'] = $_POST['syndicatePressHideArticlesAfterArticleNumber']; 
    965973        }   
    966974        if (isset($_POST['syndicatePressLimitFeedDescriptionCharsToDisplay'])) { 
     
    12401248        <div style="padding-left: 20px;"> 
    12411249        <b><u>Limit the number of articles</u></b> in a feed to <input name="syndicatePressLimitFeedItemsToDisplay" size="10" value="<?php _e(apply_filters('format_to_edit',$configOptions['limitFeedItemsToDisplay']), 'SyndicatePressPlugin') ?>"> items. Depending on the publishers settings, this will typically limit the displayed feeds to the most recent feeds.  For example, limit feed articles to the 4 most recent items.  Set this value to -1 to display all items in feed.<br>&nbsp;<br> 
     1250        <b><u>Hide articles after article number</u></b>: <input name="syndicatePressHideArticlesAfterArticleNumber" size="10" value="<?php _e(apply_filters('format_to_edit',$configOptions['hideArticlesAfterArticleNumber']), 'SyndicatePressPlugin') ?>">. For feeds with articles greater than this number, hide those articles and place a 'show more articles' link for the user to click that will show the articles. Set this value to -1 to display all items in feed.<br>&nbsp;<br> 
    12421251        <b><u>Limit article to</u></b> <input name="syndicatePressLimitFeedDescriptionCharsToDisplay" size="10" value="<?php _e(apply_filters('format_to_edit',$configOptions['limitFeedDescriptionCharsToDisplay']), 'SyndicatePressPlugin') ?>"> characters. (-1 to display complete article description)<br>&nbsp;<br> 
    12431252        <b><u>Limit article headline</u></b> to <input name="syndicatePressMaxHeadlineLength" size="10" value="<?php _e(apply_filters('format_to_edit',$configOptions['maxHeadlineLength']), 'SyndicatePressPlugin') ?>"> characters. (-1 to display complete article headline)<br>&nbsp;<br> 
Note: See TracChangeset for help on using the changeset viewer.