Jump to content

Extension:InteriaVideo

From mediawiki.org
Revision as of 21:42, 25 June 2007 by Jack Phoenix (talk | contribs)
MediaWiki extensions manual
InteriaVideo
Release status: unknown
Implementation User interface
MediaWiki
Licence No licence specified
Download see below
Example Piotr Giza goal with Polonia Warszawa

InteriaVideo extension allows to 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 <script type="text/javascript" src="http://video.interia.pl/player.js#55037,468,376"></script>
#   <interiavideo>55037,468,376</interiavideo>
# 
# 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.