r41408 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41407‎ | r41408 | r41409 >
Date:00:38, 30 September 2008
Author:dale
Status:old
Tags:
Comment:
embedStream link rewrite for embeding stream videos in the wiki
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_Hooks.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_Hooks.php
@@ -52,6 +52,33 @@
5353 $text = preg_replace( '/xx-marker' . $i . '-xx/', $markerList[$i], $text );
5454 return true;
5555 }
 56+
 57+/*
 58+ * hack to embed embedStream:StreamName links
 59+*/
 60+ function mvLinkEnd($skin, $title, $options, &$text, &$attribs, &$ret){
 61+ global $mvEmbedKey, $mvDefaultAspectRatio,$mvDefaultVideoPlaybackRes;
 62+ if( substr( $title->getText(), 0, strlen($mvEmbedKey) )==$mvEmbedKey){
 63+ //parse text for extra params:
 64+ $params = explode('|', $text);
 65+ //set up defaults:
 66+ $size = $mvDefaultVideoPlaybackRes;
 67+
 68+ foreach($params as $param_set){
 69+ if(strpos($param_set, '=')!==false){
 70+ list($k, $v)= explode('=',$param_set);
 71+ if($k=='width'){
 72+ $size = intval($v) . 'x' . ($mvDefaultAspectRatio * intval($v));
 73+ }
 74+ }
 75+ }
 76+ $mvTitle = new MV_Title( substr( $title->getText(), strlen($mvEmbedKey)+1) );
 77+ $ret = $mvTitle->getEmbedVideoHtml('',$size);
 78+ return false;
 79+ }
 80+ return true;
 81+ }
 82+
5683 // load the sequence page
5784 function mvSeqTag( &$input, &$argv, &$parser ) {
5885 global $wgTitle;
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -178,6 +178,10 @@
179179
180180 $wgHooks['TitleMoveComplete'][] = 'mvMoveHook';
181181
 182+
 183+ $wgHooks['LinkEnd'][] = 'mvLinkEnd';
 184+
 185+
182186 // @@NOTE this hook is not avaliable by default in medaiwiki
183187 // to use this hook you should add this function to moveTo() in Title.php:
184188 /*
Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php
@@ -124,6 +124,9 @@
125125 $mvDefaultSearchVideoPlaybackRes = '320x240';
126126 $mvDefaultVideoIconSize = '80x60';
127127
 128+//The text Embed a metavid Stream inline in the wiki
 129+$mvEmbedKey = 'EmbedStream';
 130+
128131 /*
129132 * All Available meta data layers
130133 * these type keys are used to allow multiple layers of metadata per stream.
Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php
@@ -59,7 +59,7 @@
6060 $this->resolveHLRD();
6161
6262 //print "the final xml:\n";
63 - print $this->getSmilXml();
 63+ //print $this->getSmilXml();
6464 //die;
6565
6666 //get parser Output Object (maybe cleaner way to do this?

Status & tagging log