CaRP: Caching RSS Parser - Documentation
CaRP Interactive FAQ
Getting Started: Free Download | Purchase | Install
Reference: Functions | Plugins | Themes | Full Index
Etc.: Display Formatting | Example Code | Affiliates
Getting Started: Free Download | Purchase | Install
Reference: Functions | Plugins | Themes | Full Index
Etc.: Display Formatting | Example Code | Affiliates
Processed Data
Processed Data is a plugin primarily for developers which is bundled with CaRP Evolution version 4.0.5 and higher. With it loaded, CaRP stores the parsed feed data in an array named "$processedcarpdata". By default, the plugin prevents CaRP from displaying anything, since you'll presumably be displaying it yourself if desired.Installation:
To install Processed Data, put processeddata.php into the "plugins" folder inside the folder containing carp.php. (If no plugins folder exists, create one.)
Use:
To use this plugin, enter code like the following into your webpage after "require_once '/path/to/carp.php';":
CarpLoadPlugin('processeddata.php');
The channel and item data will be stored in $processedcarpdata['channel'] and $processedcarpdata['items'] respectively.
For example, if the "corder" setting or CaRP's "cborder" setting (see below) contains "title",
the channel title will be found in $processedcarpdata['channel']['title'].
If the "iorder" setting contains "url", the item link URLs will be found in
$processedcarpdata['items'][0]['url'], $processedcarpdata['items'][1]['url'], $processedcarpdata['items'][2]['url'], etc.Important Notes:
- When using this plugin and the Filter plugin, be sure to load the Filter plugin and set up your filters before loading this plugin.
- When using manual caching and this plugin together (ie. specifying a cache file name after the feed URL in calls to CarpShow and CarpCacheShow), you must also specify a cache file name for the processed data using the "cache" setting below. Do not use the same filename as the manual cache filename used with CarpShow or CarpCacheShow.
- If you set allow_display to 0, there is no benefit in using manual caching (though using this plugin's "cache" setting will speed up processing).
Processed Data has a number of configuration options, which are members of the array $processeddatacarpconf:
- corder: If corder is set, it determines which channel data elements will be stored in $processedcarpdata. If corder is empty (the default), CaRP's cborder setting will be used instead.
- iorder: Similar to corder, but for the item data elements. If iorder is empty (the default), CaRP's iorder setting will be used.
- cache: The name of a cache file in which the contents of $processedcarpdata will be stored. It will be stored in your manualcache folder, or carpmanualcache table if you're using MySQL caching. This setting is automatically erased after a feed has been processed to ensure that multiple feeds don't use the same cache when processing multiple feeds on one page.
- process_data: 1 to have CaRP perform processing like HTML tag removal; truncation based on settings like maxidesc; adding values set in settings like bidate, aidate, etc.; and so on. When set to 0, the data will be returned exactly as it was in the feed. Note that CaRP's "aggregate" types from the cborder, caorder and iorder settings cannot be used when process_data is set to 0 (eg. link, podcast, image). Instead you'll need to access the individual parts like url, title, imageurl, etc. The default value is 1.
- transcode: 1 to have the plugin "transcode" (ie. convert the character encoding) of the output if necessary.
0 to return the data as-is.
For faster performance, set this to 0, process the data as desired,
and then transcode the data all at once like this:
if ((!($processeddatacarpconf['transcode']&10))&&($processedcarpdata['encoding']!=$carpconf['encodingout'])) { CarpTranscodePrep(); CarpTranscodeData($youroutput,$processedcarpdata['encoding'],$carpconf['encodingout']); }
- allow_display: 1 to allow CaRP to display the feed or 0 (the default) to prevent display.
- decode_dates_channel and decode_dates_item: these settings are arrays of channel and item elements respectively (using CaRP's internal field names, not the feed element names) which will be converted to UNIX timestamps when process_data is set to 0.