r50564 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50563‎ | r50564 | r50565 >
Date:21:32, 13 May 2009
Author:dale
Status:deferred
Tags:
Comment:
added stream length keyword
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_MagicWords.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_MagicWords.php
@@ -70,11 +70,26 @@
7171 case 'VIDEOBILL':
7272 return $this->getBillOut();
7373 break;
 74+ case 'TOTALSTREAMLENGTH':
 75+ return $this->getTotalLength();
 76+ break;
7477 default:
7578 return "error: unknown mvData function: <b>{$this->magicTypeKey}</b> <br>";
7679 break;
7780 }
7881 }
 82+ function getTotalLength(){
 83+ $dbr = & wfGetDB( DB_READ );
 84+ $result =& $dbr->query(' SELECT SUM( `duration` ) as `dur`
 85+FROM `mv_streams`
 86+WHERE 1 ');
 87+ if ( $dbr->numRows( $result ) == 0 ) {
 88+ return '';
 89+ } else {
 90+ $row = $dbr->fetchObject( $result );
 91+ return seconds2Description ( $row->dur);
 92+ }
 93+ }
7994 function getBillOut() {
8095 // return 'bill results';
8196 if ( $this->params['bill'] != '' ) {

Status & tagging log