Plugin Directory

Changeset 646387


Ignore:
Timestamp:
12/31/2012 01:35:50 PM (13 years ago)
Author:
hranchFundi
Message:

1.0.20: New feature release
Added a new short-code parameter, truncateTitleAtWord, which allows you to set a word, which, if detected in the title will truncate the title just prior to that word. The result is that the word, and all words following it will not be shown on the page. This is especially useful for affiliate rss feeds where product meta information is included in the article title, but is not actually important.
Also updated docs on the help tab.

Location:
syndicate-press/trunk
Files:
3 edited

Legend:

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

    r644097 r646387  
    22/*
    33File: TinyFeedParser.php
    4 Date: 12/24/2012
    5 Version 1.9.7
     4Date: 12/31/2012
     5Version 1.9.8
    66Author: HenryRanch LLC
    77
     
    7777    var $allowMarkupInDescription = 'false';
    7878   
    79     var $addNoFollowTag = 'true';
     79    var $addNoFollowTag = 'true';
    8080   
    8181    var $showContentOnlyInLinkTitle = false;
     
    9898    var $numArticles = 0;
    9999   
    100     var $useCustomTimestampFormat = true;
    101     var $defaultTimestampFormatString = 'l F jS, Y h:i:s A';
    102     var $timestampFormatString = 'l F jS, Y h:i:s A';
     100    var $useCustomTimestampFormat = true;
     101    var $defaultTimestampFormatString = 'l F jS, Y h:i:s A';
     102    var $timestampFormatString = 'l F jS, Y h:i:s A';
     103    var $truncateTitleAtWord = '';
    103104   
    104105    function TinyFeedParser()
     
    444445        $article->headline = (string)$this->removeAllHtmlMarkup($article->headline);
    445446        $article->headline = $this->truncateToLength($article->headline, $this->maxHeadlineLength, 'NO_LINK');
     447        if($this->truncateTitleAtWord != '')
     448        {
     449            $length = strpos($article->headline, $this->truncateTitleAtWord, 0) - 1;
     450            $article->headline = $this->truncateToLength($article->headline, $length, 'NO_LINK', false);
     451        }
    446452       
    447453        $article->title = (string)$this->removeAllHtmlMarkup($article->title);
    448454        $article->title = $this->truncateToLength($article->title, $this->maxHeadlineLength, 'NO_LINK');
     455        if($this->truncateTitleAtWord != '')
     456        {
     457            $length = strpos($article->title, $this->truncateTitleAtWord, 0) - 1;
     458            $article->title = $this->truncateToLength($article->title, $length, 'NO_LINK', false);
     459        }
    449460               
    450461        $article->subtitle = (string)$this->removeAllHtmlMarkup($article->subtitle);
     
    458469    }
    459470   
    460     function truncateToLength($text, $length, $urlLink="")
     471    function truncateToLength($text, $length, $urlLink="", $elipsis=true)
    461472    {
    462473        if($length != -1 && strlen($text) > $length)
     
    469480            {
    470481                $text .= " <a href=\"$urlLink\" target=\"_blank\" title=\"Open article in a new window\"";             
    471                 if($this->addNoFollowTag == 'true')
    472                 {
    473                     $text .= ' rel="nofollow"';
    474                 }
    475                 $text .= ">...</a>";
    476             }
    477             else
     482                if($this->addNoFollowTag == 'true')
     483                {
     484                    $text .= ' rel="nofollow"';
     485                }
     486                $text .= ">";
     487                if($elipsis)
     488                {
     489                    $text .= '...';
     490                }
     491                $text .= "</a>";
     492            }
     493            else if($elipsis)
    478494            {
    479495                $text .= '...';
  • syndicate-press/trunk/readme.txt

    r644097 r646387  
    55Requires at least: 2.8
    66Tested up to: 3.5
    7 Stable tag: 1.0.19
     7Stable tag: 1.0.20
    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.20: New feature release<br>
     51Added a new short-code parameter, truncateTitleAtWord, which allows you to set a word, which, if detected in the title will truncate the title just prior to that word.  The result is that the word, and all words following it will not be shown on the page.  This is especially useful for affiliate rss feeds where product meta information is included in the article title, but is not actually important. Also updated docs on the help tab.
    4952
    50531.0.19: Bug fix release<br>
  • syndicate-press/trunk/syndicate-press-plugin.php

    r644097 r646387  
    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.19
     7Version: 1.0.20
    88Author URI: http://syndicatepress.henryranch.net/
    99License: GPL2
     
    6161if (!class_exists("SyndicatePressPlugin")) {
    6262    class SyndicatePressPlugin {
    63         var $version = "1.0.19";
     63        var $version = "1.0.20";
    6464        var $homepageURL = "http://syndicatepress.henryranch.net/";
    6565       
     
    284284                            $customConfigOverrides['limitArticles'] = $list[1];
    285285                        }
     286                        else if(strpos($param, 'truncateTitleAtWord') !== false)
     287                        {
     288                            $list = explode('=', $param);
     289                            $customConfigOverrides['truncateTitleAtWord'] = $list[1];
     290                        }
    286291                        else if(strpos($param, 'feedList') !== false)
    287292                        {
     
    636641                $customConfigShowImages = $customConfigOverrides['showImages'];
    637642                $customConfigLimitArticles = $customConfigOverrides['limitArticles'];
     643        $customConfigTruncateTitleAtWord = $customConfigOverrides['truncateTitleAtWord'];
    638644            }
    639645           
     
    699705                    $parser->showContentOnlyInLinkTitle = 'false';
    700706                }
     707        if(isset($customConfigTruncateTitleAtWord))
     708        {
     709            $parser->truncateTitleAtWord = $customConfigTruncateTitleAtWord;
     710        }
    701711                if($parser->showContentOnlyInLinkTitle == 'true')
    702712                {
     
    12091219        [sp# feedList=feedname include=keyword exclude=keyword] - insert the feeds with the given name and the given inclusive and exclusive keyword filters<br>
    12101220        </p>
    1211         </div>       
     1221        </div>   
     1222        <b><u>Shortcode parameters</u></b>
     1223        <div style="padding-left: 20px;">
     1224        <p>
     1225        The following case-sensitive parameters may be used within shortcodes and will override corrosponding global settings from the admin panel:<br><br>
     1226        <i>feedList</i> - a comma separated list of keywords that are contained in either the feed name or in the feed url<br>
     1227        <i>exclude</i> - a comma separated list of words that, if found in the article, will result in the article not being shown<br>
     1228        <i>include</i> - a comma separated list of words that, if found in the article, will show the article.  Articles without one of the words listed, will not be shown<br>
     1229        <i>showImages</i> - true/false.  show the image for the article, if it was included in the article feed from the publisher
     1230        <i>limitArticles</i> - set to the maximum number of articles to show for each of the feeds matched by this shortcode<br>
     1231        <i>truncateTitleAtWord</i> - truncate the feed and article titles if they contain this word.  This will cut off the title at this word, and not include the word or any words following<br>
     1232        </p>
     1233        </div>     
    12121234        <b><u>Inserting feed content into a Wordpress theme...</u></b>
    12131235        <div style="padding-left: 20px;">
Note: See TracChangeset for help on using the changeset viewer.