CaRP: Caching RSS Parser - Documentation
YouTube
YouTube is a plugin bundled with CaRP Evolution.
Use it to display videos from a YouTube RSS feed.
Example Feed:
Here's an example of using the YouTube plugin to display videos about "internet marketing":
Impact Book Pre-launch party invitation!
11 May 2008 at 5:20pm
Web Design Car Wreck
11 May 2008 at 4:31pm
Crush the Competition aka The Fat Rich Pig
11 May 2008 at 4:16pm
Installation:
To install YouTube, put youtube.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 YouTube, first, enter the following command into your webpage after "require_once '/path/to/carp.php';":
CarpLoadPlugin('youtube.php');
Then use the CarpConf function to change your iorder configuration setting to something containing "youtube" -- for example:
CarpConf('iorder', 'link,youtube');
Configuration:
The YouTube plugin has the following settings:
- before: Controls what HTML code or text is displayed before each YouTube video.
This setting is empty by default.
- after: Controls what HTML code or text is displayed after each YouTube video.
The default value for this setting is "<br />" (an HTML line break tag).
- language: Controls the language of the YouTube player.
The default value is "en" (English).
Check YouTube to find other supported language codes.
- height: Specifies the height, in pixels, of the YouTube player.
The default is 355.
- width: Specifies the width, in pixels, of the YouTube player.
The default is 425.
- show-border: Controls whether a multicolored border is displayed around the video player.
The default is 0 (ie. don't display a border).
To add a border, set it to 1.
- show-related: Controls whether links to related videos are shown after the video has finished playing.
The default is 1 (show related videos).
To prevent display of related videos, set it to 0 (zero).
- color-1: You can specify two colors to use in displaying the border of the video player.
They should be six digit hexidecimal color codes like are used in HTML.
For example, bright red would be "ff0000".
- color-2: The second color for the video player border.
To set the above settings, use code like this:
$youtubeconf['width']=400;
$youtubeconf['height']=300;
Example Code:
Here's an example of the full code for a simple webpage that uses this plugin:
<html>
<head>
<title>YouTube Videos Tagged "geckotribe"</title>
</head>
<body>
<?php
require_once '/YOUR/PATH/TO/carp/carp.php';
CarpLoadPlugin('youtube.php');
CarpConf('iorder','title,youtube');
CarpConf('maxitems',3);
$youtubeconf['width']=300;
$youtubeconf['height']=250;
$youtubeconf['language']='de';
$youtubeconf['after']='<hr>';
$youtubeconf['show-border']=1;
$youtubeconf['show-related']=0;
$youtubeconf['color-1']='000066';
$youtubeconf['color-2']='006633';
CarpCacheShow('http://www.youtube.com/rss/tag/geckotribe.rss');
?>
</body>
</html>