CaRP: Caching RSS Parser - Documentation
YouTube
YouTube is a plugin bundled with CaRP Evolution.
Use it to display videos from a YouTube RSS feed.
Add-on Script:
YesTube is an add-on script
that uses CaRP Evolution and the YouTube plugin to create custom branded YouTube video players.
Click to see YesTube in action.
Example Feed:
Here's an example of using the YouTube plugin (not YesTube) to display videos about "internet marketing":
Social Media Revolution 2013| PELUANG BISNIS INTERNET| MER'S BIZ - BISNIS ONLINE
21 May 2013 at 12:22am
NCB Gala Award Winners 2012 - Project of the Year- Georgia Morel
21 May 2013 at 12:22am
Mario Cavazos: Volunteers Serving The Need (VSTN)
20 May 2013 at 11:44pm
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: [Does not apply if embed-style = 2] 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: [Does not apply if embed-style = 2] 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: [Does not apply if embed-style = 2] The second color for the video player border.
- use-https: [CaRP >= 4.0.20] Loads videos over a secure (https) connection.
Use this option to avoid browser warnings when displaying videos on a secure site.
- embed-style: [CaRP >= 4.0.20] Set to 1 (the default) to use the older style embed code.
Set to 2 to use the newer iframe-based, HTML5 code.
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>