Changeset 646387
- Timestamp:
- 12/31/2012 01:35:50 PM (13 years ago)
- Location:
- syndicate-press/trunk
- Files:
-
- 3 edited
-
php/TinyFeedParser.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
syndicate-press-plugin.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
syndicate-press/trunk/php/TinyFeedParser.php
r644097 r646387 2 2 /* 3 3 File: TinyFeedParser.php 4 Date: 12/ 24/20125 Version 1.9. 74 Date: 12/31/2012 5 Version 1.9.8 6 6 Author: HenryRanch LLC 7 7 … … 77 77 var $allowMarkupInDescription = 'false'; 78 78 79 var $addNoFollowTag = 'true';79 var $addNoFollowTag = 'true'; 80 80 81 81 var $showContentOnlyInLinkTitle = false; … … 98 98 var $numArticles = 0; 99 99 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 = ''; 103 104 104 105 function TinyFeedParser() … … 444 445 $article->headline = (string)$this->removeAllHtmlMarkup($article->headline); 445 446 $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 } 446 452 447 453 $article->title = (string)$this->removeAllHtmlMarkup($article->title); 448 454 $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 } 449 460 450 461 $article->subtitle = (string)$this->removeAllHtmlMarkup($article->subtitle); … … 458 469 } 459 470 460 function truncateToLength($text, $length, $urlLink="" )471 function truncateToLength($text, $length, $urlLink="", $elipsis=true) 461 472 { 462 473 if($length != -1 && strlen($text) > $length) … … 469 480 { 470 481 $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) 478 494 { 479 495 $text .= '...'; -
syndicate-press/trunk/readme.txt
r644097 r646387 5 5 Requires at least: 2.8 6 6 Tested up to: 3.5 7 Stable tag: 1.0. 197 Stable tag: 1.0.20 8 8 9 9 Syndicate Press lets you include RSS, RDF or Atom feeds directly in your Wordpress posts, pages, widgets or theme. … … 47 47 48 48 http://syndicatepress.henryranch.net/documentation/changelog/ 49 50 1.0.20: New feature release<br> 51 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. 49 52 50 53 1.0.19: Bug fix release<br> -
syndicate-press/trunk/syndicate-press-plugin.php
r644097 r646387 5 5 Description: This plugin provides a high performance, highly configurable and easy to use news syndication aggregator which supports RSS, RDF and ATOM feeds. 6 6 Author: HenryRanch LLC (henryranch.net) 7 Version: 1.0. 197 Version: 1.0.20 8 8 Author URI: http://syndicatepress.henryranch.net/ 9 9 License: GPL2 … … 61 61 if (!class_exists("SyndicatePressPlugin")) { 62 62 class SyndicatePressPlugin { 63 var $version = "1.0. 19";63 var $version = "1.0.20"; 64 64 var $homepageURL = "http://syndicatepress.henryranch.net/"; 65 65 … … 284 284 $customConfigOverrides['limitArticles'] = $list[1]; 285 285 } 286 else if(strpos($param, 'truncateTitleAtWord') !== false) 287 { 288 $list = explode('=', $param); 289 $customConfigOverrides['truncateTitleAtWord'] = $list[1]; 290 } 286 291 else if(strpos($param, 'feedList') !== false) 287 292 { … … 636 641 $customConfigShowImages = $customConfigOverrides['showImages']; 637 642 $customConfigLimitArticles = $customConfigOverrides['limitArticles']; 643 $customConfigTruncateTitleAtWord = $customConfigOverrides['truncateTitleAtWord']; 638 644 } 639 645 … … 699 705 $parser->showContentOnlyInLinkTitle = 'false'; 700 706 } 707 if(isset($customConfigTruncateTitleAtWord)) 708 { 709 $parser->truncateTitleAtWord = $customConfigTruncateTitleAtWord; 710 } 701 711 if($parser->showContentOnlyInLinkTitle == 'true') 702 712 { … … 1209 1219 [sp# feedList=feedname include=keyword exclude=keyword] - insert the feeds with the given name and the given inclusive and exclusive keyword filters<br> 1210 1220 </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> 1212 1234 <b><u>Inserting feed content into a Wordpress theme...</u></b> 1213 1235 <div style="padding-left: 20px;">
Note: See TracChangeset
for help on using the changeset viewer.