CaRP Evolution Documentation
CaRP Evolution Documentation
twitter youtube linkedin google-plus
CaRP Evolution Box
Web This Site

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

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:

For example, to display items up to 2 days old, do this:
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).