Jump to content

Extension:InteriaVideo: Difference between revisions

From mediawiki.org
Bouncingmolar (talk | contribs)
No edit summary
m 3 revision(s) from meta:InteriaVideo
(No difference)

Revision as of 21:39, 25 June 2007

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 <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.