
CaRP: Caching RSS Parser - Revision History
For information about version 4.0.19 and later, see the CaRP section of the Gecko Tribe Blog.
6/22/2010: version 4.0.18- Added 2 new settings: baggi and aaggi, which can be used to prepend and append content before and after items when aggregating. baggi is prepended before any channel data, and aaggi is appended after any channel data.
- Added the ability to use locale-aware date formatting using the cidateformat and iidateformat settings. If these are set, they are used to call strftime for format the channel and item dates respectively. (Otherwise cdateformat and idateformat are used with the date function).
- The Group Date and Hours Ago plugins were updated to support locale-aware date formatting.
- A new plugin was added: ItemIDs. It wraps each item in a <div> with a unique ID. This plugin is useful when integrating with other scripts that need to address individual feed items.
- Added example code showing how to integrate CaRP with PopCard.
- Fixed a bug that sometimes prevented feeds from being fully loaded, resulting in XML parsing errors.
- Adds mapping of audio in media:content elements to the internal "podcast" element.
- Ensures that "$carpversion" is a global variable, even if CaRP is loaded from within a script.
- Fixed a bug in the installer that prevented display of test feeds whose URL contained a question mark.
- Fixed a bug in the Processed Data and Sort plugins that caused them to malfunction if iorder, cborder or caorder contained extra spaces.
- Fixed a documentation error in the README.
- CaRP now sends an "Accept" header to increase the probability that remote servers will send it data in Atom or RSS format.
- HTTPS feeds are now loaded using CaRP's code rather than PHP's fopen wrapper code. This enables CaRP to support password protected feeds via HTTPS, detect redirection loops and excessive redirection, send customized HTTP headers, etc.
- Fixed a bug in the Expander plugin that prevented open HTML tags from being closed if the description was truncated between opening and closing tags.
- Changes to the MySQL plugin:
- The plugin now treats atom:id the same as an RSS guid.
- Field mappings created for duplicate detection are now also used for data retrieval. They are set to a low priority to prevent conflicts with mappings set up by the user.
- A bug was fixed in the code that deletes old items that had been marked for deletion.
- After calling any of the display functions, $carpconf['items-shown'] is set to the number of items that were displayed.
- The Expander plugin now supports displaying the description in a hovering box.
- The Page plugin's CarpPageLinks function can automatically determine whether or not to display a "next" page link if called after the feed is displayed based on whether or not enough items were found for display on the current page. The one limitation is that if the last item on the current page was the last item in the feed, a link to one blank page will still be displayed.
Skipped version 4.0.13 -- I wouldn't want anyone to miss out on the new features because of superstitions!
12/27/2008: New Plugin- Added an "Expander" plugin to enable dynamically expanding and collapsing descriptions.
- Added a "Page" plugin to enable simple paging through long feeds.
- Fixed a bug that prevented plugins that filter items during aggregation from being able to stop processing of blocked items by other plugins.
- Added an optional parameter to CarpRegisterCallback to enable plugins to request that their callbacks be called before callbacks that don't need to be called earlier than others.
- Fixed a bug that prevented channel data from getting stored properly.
- Fixed a bug that prevented character set transcoding from being handled properly in some cases.
- Fixed a potential security issue -- on servers where PHP's register_globals option is turned on (it's been off by default since the release of PHP 4.2.0 back in 2002), an attacker could cause functions that don't require any arguments to be executed when CaRP loads.
- Fixed a bug that prevented the same theme from being loaded twice on the same page.
- The Podcast plugin was updated to add support for Carp(Cache)Filter, CarpAggregate and CarpInterleave.
- CaRP Evolution was updated to work with the changes to the Podcast plugin.
- CaRP LE is unchanged.
- Fixed a bug that caused an error message to be displayed when using the Processed Data plugin (or the Sort plugin, which itself uses the Processed Data plugin), manually caching the output, and using an output encoding not supported by PHP's XML parser.
- Fixed a bug that prevented sorted output from being transcoded to the desired output encoding when using the Processed Data plugin (or the Sort plugin, which itself uses the Processed Data plugin).
- Fixed a bug that prevented error messages from being displayed when using the Processed Data plugin with "allow_display" set to 0.
- Created two new functions that plugins or code that uses the Processed Data plugin can use to transcode their output.
- Updated the Processed Data plugin to enable it either to transcode its output or not when CaRP's output encoding is not supported by PHP's XML parser. If the plugin does not transcode the output, the code that calls the plugin can transcode it more efficiently all at once before display.
- Replaced CaRP SE with CaRP LE, which does not display descriptions, but does display dates and authors.
- Added a new podcast plugin.
- Added a plugin to enable sorting items in a user-specified order or shuffling the order randomly.
- Fixed a trivial bug in the sorting code used with CarpAggregate (which may never have had any effect at all).
- Added two new configuration settings, "afield" and "aitem", to control what, if anything, is to be output immediately after each "field" (the things listed in iorder, cborder and caorder), as well as after each item. By default, a "newline" character is output in each of these places (as in previous versions of CaRP). In a webpage, the newline character is displayed as a space instead of a line break. The "aitem" setting should only be modified if you wish to omit the newline character -- for all other purposes, use the "ai" setting instead.
- Some unused code was removed from CaRP SE.
- A bug was fixed in CaRP Evolution which caused the URLs of images containing ampersands (&) to become corrupted.
- CaRP Evolution's MySQL plugin was updated in several ways:
- When used with CarpCacheShow, it now stores the feed URL in the "real_url" field instead of the address of the cache file.
- The timestamp from when the feed was last polled is now stored in the rssfeeds table.
- Individual feed items can be marked for deletion (using your own custom code and two new functions that were added to the plugin). When the feed is refreshed, any items marked for deletion which no longer appear in the feed can be purged from the database. (They should not be deleted until they no longer appear in the feed, or they will be reinserted into the database the next time the feed is polled).
- CaRP Evolution only: fixed a bug that prevented plugins using the "handlefield" phase from working (oops!)
- Added a "cachemiss" callback phase to CaRP Evolution which can be used to avoid executing unnecessary configuration code when CaRP is pulling formatted data from its manual cache.
- Added a "Processed Data" plugin to return parsed data in a PHP variable (similar to RSS parsing libraries like Magpie which parse, but don't display, feeds).
- Added support for the mb_convert_encoding for servers that don't support iconv for character encoding conversions (CaRP Evolution only).
- Fixed a bug in the MySQL plugin which caused it to require a database connection to be explicitly set up.
- Various performance optimizations.
- Enabled plugins to prevent full processing from the startprocessing phase, and added notification to plugins called at the startprocessing and endprocessing phases to tell them whether some plugin prevented full processing.
- Updated plugins to support the change in startprocessing and endprocessing.
- Fixed a bug introduced in version 4.0.3 that caused warning messages to be display in some cases, and prevented the NumericEntities plugin from converting output to encodings other than UTF-8.
- Updated the QuickTime plugin so that it can handle videos pointed to by Media RSS elements.
- Added a new Click plugin which can route clicks to the channel and item title links through any URL you wish. It could be used, for example, to track how many times each headline was clicked. (You should always finish by redirecting to the original link target).
- Fixed the "fixentities" setting so that it handles numeric entities properly.
- Added a new NumericEntities plugin that converts numeric entities (like Ӓ or 㨬) to regular characters. This is useful when converting feeds to email or other formats where numeric entities aren't always handled properly.
- Added a new QuickTime plugin that displays QuickTime, MPEG and MPEG-4 videos.
- Added a hook for plugins for the "output" phase.
- The Hours Ago plugin now respects the "timeoffset" setting.
- When using the XMLEncode plugin, HTML tag removal wasn't working, and truncation of the description was counting the lengths of HTML tags. Both problems have been fixed.
- The YouTube plugin now sets the "classid" attribute on the object tag, which is necessary for some browsers to display the videos properly.
- Note: CaRP SE 4.0.2 was not released because none of the changes affected it.
- Fixed a bug that caused the contents of the ilink_attrs and clink_attrs settings to be displayed when iorder contained "title" instead of "link".
- The timeoffset setting now affects the sort order when using it with CarpAggregate.
- Apparently under some circumstances, carriage return characters in a feed caused problems with CarpAggregate and CarpInterleave (I wasn't able to reproduce the problem -- I think it's related to PHP version 5, which I'm not yet using). CaRP now replaces those characters with spaces to ensure that they don't cause problems.
- Fixed a bug that sometimes caused too many cache files to be refreshed at a time when using CarpGroupFilter.
- Added the ability to call CarpGroupFilter without specifying cache file names for the feeds. Instead, simply list the feeds to be processed, and add a group name as a second argument to CarpGroupFilter.
- The YouTube plugin now checks for "youtube.com" in the URL of the video so that it can be used with composite feeds containing YouTube and other Flash content.
- The YouTube plugin has a new function, YouTubeScale, that can be used to easily set the dimensions of the video.
- Fixed a bug in the RSS 2.0 theme which caused it to use the element name "date" instead of "pubdate" in the channel section when using the RSS20Aggregate function.
- Added a YouTube plugin to CaRP Evolution.
- Initial rollout of CaRP 4.0 to previous buyers began on March 4, 2008. Availability to new purchasers began March 11.
- Added a new function, CarpInterleave, which works like CarpAggregate except that items are taken from the feeds in round robin order rather than sorting them together by timestamp.
- Added "clink_attrs" and "ilink_attrs" to enable easy adding of arbitrary attributes to the channel and item link tags.
- Moved control of which tags are always removed from the description (regardless of the "descriptiontags" setting) from a hard-coded place in carpinc.php to a constant that is set in carpconf.php.
- Updated the installer to make it possible to use on servers that aren't connected to the internet.
- Removed backwards compatibility with the following configuration settings (use the setting listed in parenthesis instead): corder (cborder), bc (bcb), ac (acb), clinktarget and ilinktarget (linktarget).
- Stopped distributing CaRP Free -- replaced it with an essentially identical version named CaRP SE (which is also available at no charge).
- Stopped distributing CaRP Koi (except to a very limited number of people). CaRP Koi users can upgrade to CaRP Evolution 4.0 at a discounted price.
- Enabled to process Atom 0.3 and Atom 1.0 feeds internally without the use of Grouper Evolution (Koi also).
- Added a "strip-xhtml-prefixes" option to control whether namespace prefixes are removed from XHTML content in Atom feeds (Koi also).
- Added support for xml:base processing in Atom feeds (Koi also).
- Added the XML Encode plugin, which prepares all feed data for output within an XML document.
- Added an RSS 2.0 theme which works with the XML Encode plugin to generate an RSS 2.0 feed from the input data. This theme and plugin enable CaRP Evolution to generate "mashup" feeds -- a process which used to require CaRP, Grouper Evolution and Moray, all working together.
- Added a Group Date plugin, which groups feed items by date, displays a date header for each group, etc.
- Updated the Flex Format plugin to be able to repeat the same settings at specified intervals to, for example, alternate between different background colors for each item.
- Added an "alternating" theme that works with the updated Flex Format plugin.
- Updated the Replace Text plugin so to it can operate either before or after CaRP applies formatting settings to each piece of data. This also enables CaRP to apply Replace Text settings before the MySQL plugin stores the data.
- Updated the MySQL plugin to:
- enable setting static values for some fields.
- check for pre-existing database connections better.
- Store the actual URL of each feed in the rssfeeds table.
- Enable storage of the URL of a podcast file.
- Updated so that plugins are reinitialized if they are reloaded.
- Added a new processing phase, "getfieldvalue", that plugins can hook into.
- Standardized all internal field names to lowercase (which is usually transparent to the user, but if you're writing plugins or hacking around, it may make a difference) (Koi also).
- CaRP Koi is no longer available as a purchase option. It will continue to be updated and supported for those who have purchased it in the past.
- CaRP is only distributed in a ZIP archive (not in a Tar/GZip or StuffIt archive as in the past). Copies of carpconf.php with Mac and UNIX style linebreaks are provided along with a Perl script that can be used to convert linebreaks in other files if desired.
- When using mySQL caching, if another script on the page has connected to mySQL and selected the appropriate database, it is no longer necessary to tell CaRP the name of the database
- CaRP will use the GUID element as the item link if no link element is found and the GUID element's isPermaLink attribute's value is "true" or there is no isPermaLink attribute.
- A "showfuturedates" option has been added. If an item has a datestamp that is in the future and this option is set to "0" (zero), the datestamp will not be displayed (this is to avoid things like "Posted -15 minutes ago").
- If no datestamp is to be displayed, the before and after settings for the date will not be displayed.
- If the "dodays" option is set to a negative number, that number specifies how old an item may be and have it's datestamp displayed using the plugin's format. Older dates are displayed using CaRP's built-in date formatting.
- When mySQL-based caching is selected, the installation script now creates tables capable of holding 16MB feeds. Earlier version created tables capable of holding only 64KB feed, resulting in erronous XML parsing errors being reported.
- The function CarpGroupFilter now generates and returns a list of cache file names which can be passed to CarpAggregate, so that you don't have to generate the list yourself.
- The function CarpCacheShow now returns the same value as CarpCache--ie. 1 if the cache was refreshed, or 0 if the existing cache data was used.
- Before attempting to use the "iconv" function to convert a feed's encoding (a.k.a. charset), CaRP now verifies that iconv support is available on the server. If it isn't, CaRP attempts to process the feed as UTF-8, and reports an error if that attempt fails.
- The Newer Than plugin was updated to enable it to work with feeds that aren't sorted in the usual most-recent-first order. (For performance reasons, the default settings still require feeds to be sorted most-recent-first, but one line of code will enable it to work regardless of sort order).
- The mySQL plugin was updated to ensure that it doesn't open multiple mySQL connections when displaying multiple feeds on the same page.
- The setup script for the mySQL plugin was updated to enable it to work properly on some mySQL versions that it had trouble on before.
- The Replace Text plugin was updated so that when using "regular expressions", it is no longer necessary to precede slashes (ie. "/") with two backslashes (e.g. "\\/"). NOTE: Existing code containing "\\/" must be updated to work with the new version of the plugin.
- Added the ability to process feeds that use unusual namespace prefixes. For example, while nearly all feeds do not use a namespace prefix for RSS core elements, http://www.us-cert.gov/current/index.rdf uses the prefix "rss" (eg., it uses "rss:link" instead of "link", "rss:title" instead of "title", etc.). To enable CaRP to process such feeds, use the function CarpMapPrefix.
- CaRP now displays a more informative error message when given a URL that points to something other than an RSS feed (eg. and HTML webpage, an Atom feed, etc.).
- The README file contains new sections about how to get started displaying feeds, using CaRP with Grouper, the parts of an RSS feed and CaRP's names for them, and overview of CaRP's configuration system, etc.
- The setup script now works with PHP versions below 4.1.
- The setup script can now run successfully on servers that do not allow scripts to open TCP/IP connections to the same server on which they are hosted.
- The setup script now outputs the necessary mySQL caching setup code for installations where the database name begins with a digit or contains a hyphen.
- Fixes a bug that prevented cache data from being saved in some circumstances where your code calls CarpCache directly.
- Enables caching in mySQL databases whose names start with a digit by adding the option "mysql-select-db".
If your database name starts with a digit and you wish to use mySQL caching, use must set this option to "1" using this code:
CarpConf('mysql-select-db',1);
I recommend putting this code, along with all the other code that configures CaRP for mySQL caching, into carpconf.php as noted by the installation script. - Adds a new plugin named AgeFormat, which is similar to the FlexFormat plugin, but which alters CaRP's output formatting based on the timestamp in each item. This plugin works only with feeds that have timestamps for each item.
- Adds support for "Media RSS" elements that point to images. If your "iorder" configuration setting includes "image" and the feed uses Media RSS elements (but not enclosure or image elements pointing to images), CaRP will display the images pointed to by the Media RSS elements. If you wish to give higher priority to Media RSS elements over enclosures and image elements, you must use the CarpMapField function.
- Pre-configures CaRP to use the content:encoded element when it appears in items that don't have description elements. If you wish to give higher priority to the content:encoded element, you must use CarpMapField.
- The installation script outputs an error message if PHP is not active on your server. Previous versions of the installer script obviously didn't work in such cases, but did not clearly indicate the cause of the problem.
- The installation script automatically fixes the path to the carp folder on some servers where the path must begin with "//" (eg. some if not all Yahoo! web hosting accounts).
- Integrated the code from transcode.php into CaRP Koi and CaRP Evolution, enabling automatic detection and processing of feeds using encodings other than those supported by PHP's built-in XML parser.
- Also added support for automatic transcoding of output to enable display on webpages using encodings other than those supported by PHP's built-in XML parser.
- NOTE: iconv support on the server is required for both of the above.
- Changed the behavior of the "encodingin" setting. In the past, if the feed specified an encoding, it overrode any "encodingin" setting. Now, the default value of "encodingin" is blank, and if it is specified, it overrides the encoding claimed by the feed.
- Updated the "ul" theme with the latest changes.
- Added two podcast themes: podcast-lite and podcast-heavy.
- Added some icons to use in conjunction with podcast feeds.
- Changed the license for the free version of CaRP from the GPL to a license of our own. Also changed the name from "CaRP GPL" to "CaRP Free" to reflect the change. In summary, CaRP Free is free for use and modification for your own use, but in most cases can only be redistributed unmodified in its original archives.
- Reversed the order of operations when restoring the previous state of PHP error reporting to reduce the probability of warning messages being displayed on some systems.
- Added podcast support.
- Added support for conditionally mapping elements based on things like vales of their attributes.
- Added support for "themes"--reusable configuration presets--and bundled an unordered list theme.
- Added the ability to have CaRP errors link to documentation descibing their causes and solutions.
- Fixed a bug where the "timeoffset" configuration value was applied even if the date could not be parsed, resulting in a non-zero timestamp when the time was unknown, and thus should have been zero.
- Fixed the truncation code (for titles and descriptions) to make it count multi-byte characters and HTML entities as single characters, and to prevent either of the above from being split at the end of the data.
- Added the ability to have CaRP request cache data from Grouper by specifying "grouper:cache-name" as the URL of a feed. This is to enable CaRP to work with Grouper installations that use mySQL-based caching.
- CaRP now deletes everything from the start of a feed to the first "<" symbol to avoid XML parsing errors in feeds which erroneously contain blank lines or whitespace at the beginning of the document.
- Fixed CarpGetCache to always return cache contents as a string. Previously, they were returned in an array of strings if the cache contents were coming from a file, and as a string if coming from a mySQL database.
- Updated the installation script to generate 64 character index columns in cache databases rather than 32 character (except for the auto-cache table, which remains at 32 characters).
- Added documentation and forum search forms to the README file. Documentation search may not yet search all of the documentation since it is Google-powered, and Google hasn't yet completely indexed the new location to which we recently moved the documentation.
- CaRP Evolution only: Updated the ReplaceText plugin to make regular expressio matches match the "." metacharacter to line ending characters, enabling a wider variety of multi-line matches.
- CaRP Evolution only: Updated mysql_setup.php to make the table creation code compatible with more versions of mySQL (those that require default values to be enclosed in quote marks).
- Fixed a bug in the aggregation code which occurred when using mySQL-based caching.
- Added the option of caching in a mySQL database instead of in flat files.
- Updated the installer script to offer the choice of setting up cache directories or mySQL cache tables.
- Fixed a bug that caused an error message to be displayed if two processes tried to update the same cache file at almost the same instant.
- Added the "Hours Ago" plugin to CaRP Evolution, enabling display of datestamps in formats like "x minute ago", "x hours ago", and "x days ago".
- Added the ability to delete only inactive files using the CarpClearCache function.
- Added encoding detection to the free version.
- Bundled a transcoder script with CaRP Koi and CaRP Evolution to convert feeds encoded in character sets other than UTF-8, ISO-8859-1 and US-ASCII so that PHP's XML parser will be able to process them. This addition will enable support for any feed in a character set supported by iconv.
- A new function was added: CarpGroupFilter. It does the same thing as CarpCacheFilter, except that it processes multiple feeds at once, and you can specify the maximum number of feeds to refresh at once to increase the perceived speed of your website. In the past, aggregating many feeds required setting up a cron job to keep them up-to-date without periodically causing a slow page load for one website visitor when the feeds were refreshed. Using this function, you can guarantee that each site visitor only has to wait for a few of the feeds to be updated, which usually happens fast enough that it isn't noticable.
- Added a new option, maxgroupfilter, to specify that maximum number of feeds that will be re-fetched from their source during a single call to CarpGroupFilter.
- The default for the "fixentities" option was changed from 1 to 0. Therefore, by default, CaRP no longer attempts to fix certain types of broken RSS feeds. The reason for this change is that this setting could cause incorrect display of some valid feeds, and valid feeds are becoming more common than they used to be.
- The default for the "encodingin" option was changed from nothing to "UTF-8". With the old empty setting, the default was effectively "ISO-8859-1". In CaRP Koi and CaRP Evolution, if the feed specifies its encoding in the XML prologue, which many if not most do, that value overrides this setting. In CaRP GPL, or for feeds that don't specify the encoding, use the "encodingin" configuration setting to specify the encoding if it is not UTF-8.
- Updated the NewerThan plugin so that it works with CarpAggregate. A plugin API callback phase was added to enable this.
- The mySQL plugin was updated to fix a bug in the duplicate detection code.
- Handling of HTML tag stripping was updated to fix a bug that occurred when attempting to remove all HTML tags.
- Added the ability to offset the timestamps by any number of minutes.
- Added an option to not fix invalid XML entities. This is useful when displaying feeds whose content is enclosed in CDATA sections. The old code erroneously re-escaped any entities found in these sections.
- The values of "atruncidesc" and "atrunccdesc" are now appended to truncated data before any open HTML tags are closed. This is mainly to prevent the text from being appended after closing paragraph tags (</p>).
- Ampersands (&) are now entity encoded when they appear in URLs in link or image elements.
- Improved the code for turning display of PHP errors on.
- Formatting of channel data is done later so that channel images can be displayed in RSS 1.X feeds where the image element is not a child of the channel element.
- Updated the installation assistant to use either FTP or Telnet to set access permissions, rather than only supporting use of Telnet.
- Improved the instructions for setting access permissions manually.
- If the cache folders already exist and have their access permissions set properly, the setup assistant now skips the step where it creates them.
- A new installation assistant automates the process of setting directory access permissions.
- Changed so that by default, no PHP errors or warnings are displayed.
- Changed the default text that is appended to truncated descriptions from "...continues" to "...".
- Updated the default configuration to output XHTML compatible <br /> tags.
- Added code to handle entity encoded line breaks properly when outputting as JavaScript.
- Fix a bug that caused HTML stripping to malfunction when configured so that no HTML is allowed.
- Added code to strip NULL characters, which were causing XML parsing errors in some feeds.
- When auto-detecting character encoding, CaRP now checks for both single and double quote delimiters.
- Fixed a bug which caused numerical entities to be double-escaped, resulting in incorrect display.
- Made a few minor improvements to the setup assistant scripts.
- Fixed a bug that prevented newsfeeds from being displayed properly from cache files.
- Fixed an issue that prevented newsfeeds from being loaded from some web servers.
- Fixed a bug in proxy server code.
- Fixed a bug that could cause a cache file or error message to be displayed if a connection failed when calling CarpFilter (nothing should be displayed when calling CarpFilter).
- Fixed an oversight that caused configuration variables to become undefined if a null value was passed to CarpConf.
- CaRP now decodes entity encoded apostrophies ('), because some browsers (including Internet Explorer) do not recognize it as a valid entity.
- Added the ability to parse ISO 8601 format dates using the "Z" time zone designator.
- Created a setup assistant to help with creating the cache folders as securely as possible, to assist in specifying paths correctly, and to assist with specifying proxy server settings correctly.
- Modified and rearranged the caching folders for better organization and security. When upgrading, you must switch to the new directory structure. We recommend using the setup assistant to help with this process.
- Added the ability to replace the functions that set the paths to the cache files, in case you do not want to use the standard directory structure.
- Changed the default configuration to turn off PHP warnings and notices (errors are enabled by default).
- Added functions to delete single cache files or clear entire cache directories.
- Fixed an oversight that required field names in calls to GetFieldValue to be specified in uppercase. (Koi and Evolution only)
- Added a plugin for performing more powerful filtering (and, or, regular expressions, etc.) (Evolution only)
- Added a plugin for storing parsed newsfeed contents in a mySQL database, including a setup script to create the database tables. (Evolution only)
- Fixed an issue that caused warnings to be displayed on some systems when running CaRP Evolution.
- Changed the internal name of the field containing the link URL from "LINK" to "URL", to be more consistent with other parts of the program. If using the function CarpMapField('LINK',..., you must change it to CarpMapField('URL',... when upgrading. Evolution plugin developers using the function GetFieldValue('LINK'); must change it to GetFieldValue('URL');
- Made a few changes to the CaRP Evolution plugin API for the displaychannel and displayitem phases. See the CaRP Evolution plugin API documentation for details.
- Added a plugin for CaRP Evolution to enable varying the visual formatting of the newsfeed from item to item.
- Added functions to combine CarpCache with CarpShow or CarpFilter (CarpCacheShow and CarpCacheFilter). The new functions call CarpCache to cache the raw newsfeed in an automatically named file, and then either display or filter it. Using this function will ensure that you are not needlessly loading the same newsfeed for display on multiple web pages without requiring you to make sure you use the same cache file name on each.
- Added the ability to display channel information either before or after the list of news items, or both.
- Added the ability to display the channel information associated with each news item when aggregating from multiple feeds using CarpFilter. If you are using CarpFilter and do not wish to display channel information, you must call CarpConf('cborder','');
- Changed the internal field names used with CarpMapField for the description and date fields from "DESCRIPTION" to "DESC" and "PUBDATE" to "DATE" respectively for greater consistency with other naming conventions used by CaRP (Koi & Evolution only).
- When determining a timestamp for newsfeeds which do not indicate timestamps for individual items, CaRP now choose a timestamp for each that will keep them in order when calling CarpFilter and CarpAggregate.
- Added the function CarpUnregisterCallback to un-register plugin callback functions when displaying one feed using a plugin followed by another not using the plugin (Evolution only).
- Updated the AccessKeys plugin for CaRP Evolution to unregister its callbacks when it is reset.
- Added a new plugin for CaRP Evolution named "Replace Text". This plugin can be used to modify the contents of a newsfeed based on string or regular expression matching. Expand acronyms, add bold or italics to certain words or phrases, "bleep" language you don't want appearing on your site, etc. (Be aware that modifying the contents of a newsfeed may be a violation of copyrights or have other legal consequences.)
Officially fixed the names of the three CaRP versions as:
- CaRP GPL: The free version, released under the GNU General Public License
- CaRP Koi: The standard commercial version
- CaRP Evolution: The plugin extendable version
- Added a configuration option to specify a proxy server address. IMPORTANT NOTE: If you use a proxy server, you will have to switch to the new method of specifying the proxy server. The old method is no longer supported.
- Added the ability put configuration overrides into a separate file (carpconf.php) and have it automatically loaded, removing the need to modify new versions of carp.php when upgrading.
- carpconf.php may also be used to create any number of configuration sets, making it easier to standardize newsfeed formatting across your website.
- Added the ability to display the link URL (i.e., actually display the URL rather than using it to make the title into a link).
- Added the ability to display the channel date (Koi & Evolution only).
- CaRP now attempts to determine a reasonable timestamp for items with no date indicated when calling CarpFilter, making the order of items output by CarpAggregate more accurate.
- Beginning with version 3.3, we have created a new version, CaRP Evolution, which can be extended by plugins, both from us and third parties. We have periodically received requests for features which do not fit well into the scope of what CaRP is designed to do, and would simply bloat the program for the many users who do not need those features. Going forward, we will be able to accomodate more feature requests by creating plugins. Version 3.3 includes one plugin, which adds "access keys" to item links. Access keys allow the links to be selected or activated using the keyboard by typing alt-access key (Windows) or control-access key (Macintosh). Most modern web browsers support access keys.
- Fixed a bug that caused a "</span>" tag to be output at the end of titles even if no CSS class or style was specified.
- Added the ability to decode the full date/time format for the "DC:DATE" field. (NOTE: the date is only displayed by the commercial version of CaRP, but is used by either version to sort items when aggregating.)
- Added the ability to display item titles as plain text instead of as hyperlinks (as could already be done for the channel title).
- Fixed a situation that caused a notice to be displayed if the PHP error reporting setting included display of notices and filtering was being performed on both the title and description.
- Added the ability to change the mapping of RSS fields to CaRP's display fields, making it possible to correctly display many incorrectly formatted newsfeeds, and providing greater compatibility with current and future extensions to RSS.
- Fixed a bug that caused some characters in image alt tags to be incorrectly entity-encoded.
- Fixed a design limitation that could have produced unpredictable image output if multiple images were specified for a single item.
- Added the function CarpCachePath, which returns the path to the cache directory,
which is $carpconf['cachepath'], prepended by the path to carp.php if $carpconf['cacherelative'] is not "0".
This function is useful for displaying cached raw RSS feeds.
For example, you might use the following commands:
CarpCache('http://www.somewhere.com/headlines.rss','somewhere.headlines.rss');
CarpShow(CarpCachePath().'somewhere.headlines.rss'); - Added the function CarpConfAdd, which can either prepend or append additional text to an existing configuration variable. For example, to add the <u> and </u> tags to the list of HTML tags allowed in the description field, you could use the command CarpConfAdd('descriptiontags','|u|/u');
- Added the function CarpConfRemove, which removes text from an existing configuration variable. For example, to remove the <b> and </b> tags from the list of HTML tags allowed in the description field, you could use the command CarpConfRemove('descriptiontags','b|/b');
- Made a few minor performance enhancements.
- Added ability to turn CaRP's error reporting off.
- Added the ability to set PHP's error reporting level. The original error reporting level is restored when CaRP exits.
- XML documents encoded in character sets not supported by PHP's XML parser no longer set their encoding automatically (full version only). Doing so would have produced unpredicatable results.
- Fixed a number of issues that caused warning notices to be displayed on some systems, but which did not affect functionality in any way.
- Added support for displaying images specified by the RSS 2.0 "enclosure" tag (commercial version only).
- Added the ability to show a user-specified message if no news items are found (usually due to use of the "filterin" and/or "filterout" settings).
- Fixed display of entity encoded characters in channel and item titles.
- HTML in channel and item titles is now completely removed rather than being displayed as raw HTML.
- Changed the default behavior of CaRP so that it looks for its cache files in a subdirectory of the location where CaRP itsself is located rather than an absolute file path.
- Fixed a bug that could cause one newsfeed to be displayed twice on a page that first displays and caches a newsfeed and later dislays a newsfeed without caching it if the second feed failed to load.
- Fixed a bug that could result in a misleading error message if a newsfeed could not be opened and there was no cached version of it available for display.
- Fixed a bug that could cause extra HTML tags to be considered when making sure that paired tags are properly closed when truncating long descriptions. This bug would not actually cause any problems, but was fixed because it was technically incorrect.
- Made the capitalization of "Carp" or "CaRP" more consistent in style throughout the script.
- Added the ability to save cache files in a path relative to the location of CaRP itsself. Older versions required an absolute path or a path relative to the location of the PHP page being loaded by the web browser.
- Combined the $carpconf['clinktarget'] and $carpconf['ilinktarget'] settings into one ($carpconf['linktarget']), since it seems highly unlikely that they will ever be different. This will make overriding the defaults easier since only one setting will need to be changed. The old settings are still supported for backward compatibility, but ilinktarget will override clinktarget if it is set.
- The link target for image links is now controlled by the linktarget setting.
- $carpconf['bc'] and $carpconf['ac'] are no longer displayed if the requested channel fields are all empty.
- Fixed a bug which caused the "alt" text for images to appear in the associated link ("a") tag rather than in the "img" tag.
- Fixed a bug that caused $carpconf['bc'] and $carpconf['ac'] to be displayed even if no channel fields is being displayed.
- Fixed a bug that caused extra line breaks to be added to the ends of some fields.
- The files created by CarpFilter (and used by CarpAggregate) are not compatible with earlier versions, and should be deleted when upgrading.
- Added the option to skip duplicate stories based on whether the headline is identical. This is especially useful when using CarpAggregate, or when displaying newsfeeds that are aggregates of multiple news sources.
- Added the ability to display both channel and item images. Maximum, fixed and default image dimensions may be specified.
- After calling CarpCache or CarpShow (with a cache file specified), $carpconf['mtime'] contains the UNIX timestamp for the last time the cache file was modified. Programmers of complex systems based on CaRP may find this information useful in avoiding unnecessary processing of files.
- Fixed a bug in JavaScript output that caused script errors when reading a JavaScript formatted file from cache.
- Fixed a bug in title display that caused HTML tags in the text that was appended when the title was truncated to be displayed incorrectly.
- Removed two legacy functions, ShowRSSPage and ShowRSSFeed, both of which were old names for CarpShow.
- Split CaRP into 2 versions: a freely available version (GPL) and a commercial version ("full version") with a few extra features. The full version is available for a nominal fee--essentially a donation to support the development of CaRP.
- Completely overhauled the system for specifying how to display newsfeeds to make it more flexible, logical and extendable in the future. NOTE: Due to the extent of the changes that were made, CaRP 3.0 is not backward compatible with many configuration settings from previous version. See the upgrade guide in the manual for details of how to convert smoothly from a previous version.
- Security enhancement: Removes JavaScript handlers from any HTML tags that are not removed (onMouseOver, etc.)
- Security enhancement: Does not allow certain HTML tags, even if they are listed in the "descriptiontags" setting. Disallowed tags are script, embed, object, applet, and iframe.
- CarpCache now has a return value indicating whether or not it was necessary to update the cache file. If you have a script that processes the cache file after it is updated, your script may skip this processing if the cache was not updated.
- Automatically sets the encoding of the incoming newsfeed if the newsfeed specifies it explicitly (full version only).
- Displays the author/creator and date/time fields. (full version only).
- Fixed a bug that caused attempts to override "cachepath" using the CarpConf() function to fail.
- To avoid the possibility of having two processes update the same cache file at the same time, CaRP now attempts to lock the cache file before updating it.
- Changed the name of the "newwindow" configuration option to "linktarget" to better reflect the additional functions it now controls. "newwindow" is still supported for backward compatibility.
- You now have three options for how to handle CaRP's output: as JavaScript (so that the news can be displayed in non-PHP pages), storing it in a PHP variable (so that your code can do whatever it wants with it), or simply displaying it as it does now.
- When CaRP is run in a frameset, you can now have the link targets set to any frame.
- Fixed a bug in the handling of the "newwindow" setting.
- Added support for newsfeeds requiring basic authentication (username and password) to access.
- Added the ability to cache a complete newsfeed without performing any processing on it, which is useful to increase performance when creating multiple sets of aggregated news stories on different topics from a set of newsfeeds.
- Added the ability to break out of a frameset when opening a story in the existing window.
- Added the following functions to facilitate better aggregating of news from multiple sources:
- CarpFilter: Filters news stories from a single newsfeed and stores them in a cache file. Note that the format of cache files created by CarpFilter is different from the format created by CarpShow (formerly ShowRSSFeed). Nothing is displayed when calling this function.
- CarpAggregate: Displays the most recent stories from any number of cache files created by CarpFilter.
- Renamed "ShowRSSFeed" to "CarpShow" to make it more consistent with "CarpFilter" and "CarpAggregate". The function name "ShowRSSFeed" is still supported for backwards compatibility, but may be removed in the future.
- Added the ability to filter for text which contains colons if you are specifying a field to filter. (It is still not possible to look for colons if you do not specify a field).
- Added a new function, CarpConf, to set values in the $carpconf array. This method will help to ensure that the names of the options are spelled correctly, because it displays an error if the option is unknown.
- Added the ability to filter news stories by keywords, including and/or excluding stories based on whether specified words appear in the title and/or description fields.
- If an RSS feed fails to load or parse properly, CaRP no longer deletes the contents of the cache file. Instead, it marks the cache to be refreshed again after a configurable number of minutes.
- Added the function CarpConfReset to allow the user to quickly reset all the values in $carpconf to their default values.
- Split the script into two parts to reduce overhead when reading a newsfeed from cache.
- Changed the script filename from rssparser.php to carp.php.
- Added support for proxy servers requiring authentication.
- Removed the "truncdesc" option, which was made unnecessary by improvements introduced in version 2.5.1.
- When the description is longer than $carpconf['maxdesc'], CaRP now truncates the text more intelligently in three ways:
- The text will never be truncted in the middle of an HTML tag.
- Any paired tags that have been opened in the description will be closed, even if the closing tag is in the part that was chopped off.
- The length of HTML tags no longer counts toward the total length allowed, since they are not actually displayed.
- If a newsfeed contains one of the following errors, CaRP now corrects it:
- If the description ends in the middle of an HTML tag, CaRP removes the broken tag.
- If the description contains unpaired opening and closing tags, CaRP adds the closing tags.
- By default, CaRP now completely removes any HTML tags not listed in $carpconf['descriptiontags'] rather than displaying them like '<tag>'.
- Added the ability to add a "title" element to links in order to display the entire item title as a "tool tip" either in cases where it is truncated by the $carpconf['maxtitle'] setting, or to all title links, whether truncated or not.
5/21/2003: version 2.4.1
- Fixed a bug that prevented 'preitems' and 'postitems' from being displayed when reading from the cache file.
- Changed the license for CaRP to the GPL.
- Added, by default, a link to the CaRP homepage to the end of each newsfeed.
- Added the ability to load redirected RSS feeds. To avoid spending too much time following multiple redirects, you can specify the maximum number of redirects to follow. CaRP also checks for redirections loops.
- Added the ability to convert RSS feeds between UTF-8 (Unicode), US-ASCII and ISO-8859-1 character encodings.
- You can now specify the maximum number of characters to display from the description field and the text to display (if any) after the description field if it is truncated.
- Cache files can now be set to expire at a particular time of day. Previous versions refreshed the cache if it was more than a specified number of minutes old. This version can work either way.
- Added the ability to specify text to appear before and after each news item, and before and after the entire list of news items. This makes it possible to put the items in ordered and unordered lists, for example.
- Changed the name of the main function from ShowRSSPage to ShowRSSFeed, and made the cache parameter optional. The old function name is still supported for backward compatibility, but may be removed in future versions.
- Added support for proxy servers.
- Handles improperly encoded "entities" in incorrectly formatted RSS feeds.
- Works with PHP installations that don't allow "fopen" to open remote files.
- Added ability to set time out for the "CONNECT" phase of slow connections.
- Added ability to turn off the sending of the "Host" HTTP header, which one user reported is necessary to work with their particular server.
- Added a "User-Agent" HTTP header to identify CaRP.
- Removed unnecessary "pass-by-reference" from call to xml_set_object, which generated a warning on some systems.
- Dies gracefully if it cannot open or create the cache file.
- Moved all configuration into an array (to allow global configuration without the risk of being overridden by malicious website visitors).
- Added many new options for formatting, including showing the channel title and description, setting CSS classes and styles for the links, etc.
- Added the ability to have links open in a new window.
- Dies gracefully if it can't retrieve the remote feed or encounters some other XML parsing error. (The original version was based on code which ended all PHP processing if that happened, meaning that the rest of your page disappeared).
- Removed "DIV" from the default set of allowed HTML tags, due to the likelihood of unpaired DIVs disrupting page formatting.
- Allows you to specify a set of HTML tags which will NOT be converted to HTML entities in the description field.
- Provides a default set of HTML tags to allow in the description field (<b>, </b>, <i>, </i>, <br>, <p>, </p>, <hr>, <span>, </span>, <div>, </div>, <font>, and </font>)
- Original implementation based on http://www.webmasterbase.com/examples/phpxml/sitepointcover-oo.php.txt.
- Version 1.0.1 and 1.0.2 followed soon thereafter with little tweaks that I don't specifically remember.