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
Newer Than
Newer Than is a plugin bundled with CaRP Evolution. Use it when, rather than displaying a specific number of items from a newsfeed, you wish to display all items newer than some specific time. Note that the newsfeed must be sorted with the newest item first for this plugin to function properly. By convention, this is the sort order for most newsfeeds.Installation:
To install Newer Than, put newerthan.php into the "plugins" folder inside the folder containing carp.php. (If no plugins folder exists, create one.)
Use:
To tell CaRP Evolution to use Newer Than, enter the following command into your webpage after "require_once '/path/to/carp.php';":
CarpLoadPlugin('newerthan.php');
Configuration:
By default, Newer Than displays all items from the last 24 hours. You may change this behavior by overriding the default values, as follows:
- when: The UNIX timestamp to use as the cutoff time.
The default is time()-(24*3600), or the current time minus 24 times 3600 seconds (24 hours).
- minitems: The minimum number of items to show, even if some of them are older than the cutoff time.
- stop-at-old: 1 (the default) to tell CaRP to stop processing items once one has been seen that is too old to be displayed,
or 0 to continue processing.
Because most feeds are sorted with the most recent items first (ie. reverse chronological order),
the default setting can usually be used for better performance.
CarpLoadPlugin('newerthan.php'); $newerthanconf['when']=time()-(3600*24*2); CarpCacheShow('http://example.com/feed.rss');To display all items dated since a particular day, use the function NewerThanDay. For the current day, no arguments are required. For any day other than the current day, the first argument is any UNIX timestamp in that day. An optional second argument is the number of minutes into the day to set the cutoff time. A few examples will illustrate the use of NewerThanDay.
NewerThanDay();Show only items dated today.
NewerThanDay(time()-(24*3600));Show items dated today or yesterday (the day of the current time minus 24 hours).
NewerThanDay(time()-(24*3600),(12*60));Show items dated after 12:00 noon yesterday (the day of the current time minus 24 hours, at least 12 hours into the day).