CaRP: Caching RSS Parser - Documentation
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.
To install Newer Than, put newerthan.php into the "plugins" folder inside the folder containing carp.php.
(If no plugins folder exists, create one.)
To tell CaRP Evolution to use Newer Than, enter the following command into your webpage after "require_once '/path/to/carp.php';":
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.
For example, to display items up to 2 days old, do this:
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.
Show only items dated today.
Show items dated today or yesterday (the day of the current time minus 24 hours).
Show items dated after 12:00 noon yesterday (the day of the current time minus 24 hours, at least 12 hours into the day).