CaRP Evolution Plugin API

CaRP Evolution allows plugins to register callback functions for various stages of the processing of an RSS newsfeed.
The API for registering callbacks, and the arguments that will be sent to your callback functions are described below.

You may use accesskeys.php as a starting point for developing your own plugins.
Further documentation and recommendations for plugin development will be added in the future.

Registering Callbacks

Register your callback functions using the function CarpRegisterCallback.
For details, refer to the documentation for CarpRegisterCallback.

Callbacks should be unregistered during the initialization phase of your plugin, before you register them.
This will ensure that your plugin is not called multiple times if a user reinitializes your plugin.
You may unregister a callback you have previously registered using the function CarpUnregisterCallback.
The arguments to this function are the same as for CarpRegisterCallback, but $phase and $option are both optional.
If $phase is omitted or blank, the callback will be unregistered for all phases.
If $option is ommitted or blank, the callback will be unregistered for all values of the option.

Accessing CaRP Internal Data & Functions

During the callback phases startelement, endelement, characterdata, outputfield, handlefield, displaychannel and displayitem,
$carpconf['rssparser'] contains the RSS parser object that is parsing the newsfeed.
The following functions and data structures are available for access by your plugin.
All others should be considered private and subject to change without notice.

$carpconf['rssparser']->GetFieldValue($fieldname);
This function returns the value of whichever RSS field is the highest priority field mapped to the internal field name named by $fieldname which contains a value.
For example, $carpconf['rssparser']->GetFieldValue('DATE'); may return a value from the RSS pubDate or DC:DATE field, depending on which one the RSS feed contains.

$carpconf['rssparser']->SetItemOrder($itemorder);
This functions takes a comma-separated list of fields (the value of $carpconf['iorder']) and determines which fields will be displayed, and in what order, in an item.

$carpconf['rssparser']->ivalues:
This is an array containing the raw contents of the fields of an item.
Depending on which phase the callback is for, this data will be more or less complete.
The array indices are in the format described as described in the "startelement" section above.

$carpconf['rssparser']->cvalues:
This is an array containing the raw contents of the fields for the channel.

Callback Function Prototypes

Refer to the documentation for CarpRegisterCallback for information regarding the parameters for callback functions.