Jump to content

Extension:InteriaVideo

From mediawiki.org
Revision as of 14:16, 10 April 2007 by 83.7.192.111 (talk) (New page: {{MoveToMediaWiki}} This extension display videos from polish site [http://video.interia.pl/ Video - INTERIA.PL]. Upload your videos to interia and then share them in your wiki ! View a '...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:MoveToMediaWiki This extension display videos from polish site Video - INTERIA.PL. Upload your videos to interia and then share them in your wiki !

View a demo at "Piotr Giza goal with Polonia Warszawa" on my wiki.

Based on GoogleVideo extension by Iubito.

Installation

Add this line at the end of LocalSettings.php :

include('extensions/interiaVideo.php');

Copy the following code into extensions/interiaVideo.php :

<?php
# Interia Videos
# 
# Tag :
#   <interiavideo>docid</interiavideo>
# Ex :
#   from url http://video.google.com/videoplay?docid=6444586097901795775
#   <googlevideo>6444586097901795775</googlevideo>
# 
# Enjoy !

$wgExtensionFunctions[] = 'wfInteriaVideo';
$wgExtensionCredits['parserhook'][] = array(
        'name' => 'Interia Video',
        'description' => 'Display Interia Video, based on Google Video extension by Sylvain Machefert',
        'author' => 'Michal "Dinth" Gawronski',
        'url' => 'http://meta.wikimedia.org/wiki/InteriaVideo'
);

function wfInteriaVideo() {
        global $wgParser;
        $wgParser->setHook('interiavideo', 'renderInteriaVideo');
}

# The callback function for converting the input text to HTML output
function renderInteriaVideo($input) {
        $output = '<script type="text/javascript" src="http://video.interia.pl/player.js#'.$input.'"></script>';
        return $output;
}
?>

That's all :-)

Usage

Usage is as follows: <interiavideo>docid</interiavideo> If you use it on your wiki, please place somewhere link to www.wikipasy.pl, it.wikipasy.pl or en.wikipasy.pl depending on your wiki's language.