r41628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41627‎ | r41628 | r41629 >
Date:00:30, 4 October 2008
Author:dale
Status:old (Comments)
Tags:
Comment:
updates for player Stats Collection (currently disabled)
Modified paths:
  • /trunk/extensions/OggHandler/OggHandler.php (modified) (history)
  • /trunk/extensions/OggHandler/OggHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggHandler.php
@@ -25,8 +25,8 @@
2626 $wgExtensionCredits['media'][] = array(
2727 'name' => 'OggHandler',
2828 'author' => 'Tim Starling',
29 - 'svn-date' => '$LastChangedDate$',
30 - 'svn-revision' => '$LastChangedRevision$',
 29+ 'svn-date' => '$LastChangedDate$',
 30+ 'svn-revision' => '$LastChangedRevision$',
3131 'url' => 'http://www.mediawiki.org/wiki/Extension:OggHandler',
3232 'description' => 'Handler for Ogg Theora and Vorbis files, with JavaScript player.',
3333 'descriptionmsg' => 'ogg-desc',
@@ -34,6 +34,11 @@
3535
3636 /******************* CONFIGURATION STARTS HERE **********************/
3737
 38+
 39+//the absolute or relative path of the playerStatsCollector.js file
 40+$wgStatsCollection=false;
 41+//$wgPlayerStatsCollectionJs = $wgScriptPath . '/extensions/PlayerStatsGrabber/playerStats.js';
 42+
3843 // Location of the FFmpeg binary
3944 $wgFFmpegLocation = 'ffmpeg';
4045
Index: trunk/extensions/OggHandler/OggHandler_body.php
@@ -390,7 +390,7 @@
391391 }
392392
393393 function setHeaders( $out ) {
394 - global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer;
 394+ global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer, $wgUser, $wgProxyKey, $wgPlayerStatsCollectionJs;
395395 if ( $out->hasHeadItem( 'OggHandler' ) ) {
396396 return;
397397 }
@@ -403,7 +403,9 @@
404404 'ogg-player-totem', 'ogg-player-kaffeine', 'ogg-player-kmplayer', 'ogg-player-mplayerplug-in',
405405 'ogg-player-thumbnail', 'ogg-player-selected', 'ogg-use-player', 'ogg-more', 'ogg-download',
406406 'ogg-desc-link', 'ogg-dismiss', 'ogg-player-soundthumb', 'ogg-no-xiphqt' );
407 - $msgValues = array_map( 'wfMsg', $msgNames );
 407+ $msgValues = array_map( 'wfMsg', $msgNames );
 408+
 409+
408410 $jsMsgs = Xml::encodeJsVar( (object)array_combine( $msgNames, $msgValues ) );
409411 $cortadoUrl = $wgCortadoJarFile;
410412 $scriptPath = self::getMyScriptPath();
@@ -413,7 +415,7 @@
414416 }
415417 $encCortadoUrl = Xml::encodeJsVar( $cortadoUrl );
416418 $encExtPathUrl = Xml::encodeJsVar( $scriptPath );
417 -
 419+
418420 $out->addHeadItem( 'OggHandler', <<<EOT
419421 <script type="text/javascript" src="$scriptPath/OggPlayer.js?$wgOggScriptVersion"></script>
420422 <script type="text/javascript">
@@ -430,8 +432,19 @@
431433 }
432434 </style>
433435 EOT
434 - );
435 -
 436+ );
 437+ //if collecting stats add relevant code:
 438+ if($wgPlayerStatsCollectionJs){
 439+ $jsUserHash = sha1( $wgUser->getName() . $wgProxyKey);
 440+ $enUserHash = Xml::encodeJsVar( $jsUserHash );
 441+ $out->addHeadItem('playerStatsCollection', <<<EOT
 442+<script type="text/javascript" src="$wgPlayerStatsCollectionJs"></script>
 443+<script type="text/javascript">
 444+wgOggPlayer.userHash = $enUserHash;
 445+</script>
 446+EOT
 447+);
 448+ }
436449 }
437450
438451 function parserTransformHook( $parser, $file ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r41969Revert r41628:...tstarling14:14, 11 October 2008

Comments

#Comment by Tim Starling (talk | contribs)   14:14, 11 October 2008

Reverted, see r41969.

Status & tagging log