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

CSS Example

The following code will display the Next Week Times RSS feed as shown in the right hand column.

First, in the <head> section of your webpage, define a few CSS styles:

<style type="text/css">
.h2 {
     font-family: Trebuchet MS,Palatino,Times New Roman,serif;
     font-size: 13pt;
     font-weight: bold;
}
.h3 {
     font-family: Verdana,Arial,Helvetica,sans-serif;
     font-size: 9pt;
     font-weight: bold;
}
</style>

Then, this code in the <body> of your webpage will display the newsfeed. Notice the use of "h2" and "h3", the classes defined above.

<div style="width:220px;border:1px solid #333333; background:#eeeeee; padding:5px;">
<?php
require_once "/path/to/carp.php";

// Show 3 items
CarpConf('maxitems',3);

// surround the item link with a DIV
CarpConf('bilink','<div style="background:#cccccc; width:210px; padding:2px; border:1px solid #333333;">');
CarpConf('ailink','</div>');

// get rid of the underline under the links
CarpConf('ilinkstyle','text-decoration:none');

// set the CSS classes of the channel and item links
CarpConf('clinkclass','h2');
CarpConf('ilinkclass','h3');

// Display it
CarpCacheShow('http://rss.geckotribe.com/rss/0.rss');
?>
</div>