Advertisement
SgtLegend

Recording updates

Oct 16th, 2011
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.17 KB | None | 0 0
  1. <?php
  2.  
  3. global $siteurl;
  4.  
  5. // Module settings
  6. $module_name    = basename(dirname(__FILE__));
  7. $audioLoc       = 'modules/' . $module_name . '/clan_meetings/current/';
  8. $audiofiles     = dir($audioLoc);
  9. $audiolist      = array();
  10. $meeting        = isset($_POST['meeting']) ? $_POST['meeting'] : false;
  11. $start          = isset($_POST['start'])   ? $_POST['start']   : false;
  12. $audio_loc      = 'modules/' . $module_name . '/clan_meetings/archive/';
  13. $siteurl        = $siteurl;
  14.  
  15. // Go through the file list returned
  16. while ($file = $audiofiles->read()) {
  17.     if (preg_match('/(mp3|wav|ogg|wma)/', $file)) {
  18.         $audiolist[] = $file;
  19.     }
  20. }
  21.  
  22. closedir($audiofiles->handle);
  23.  
  24. // Select a file at random
  25. $total  = sizeof($audiolist) - 2;
  26. $rand   = mt_rand(0, $total);
  27. $audio  = $audiolist[$rand];
  28.  
  29. include_once(NUKE_BASE_DIR . 'header.php');
  30. OpenTable();
  31.  
  32. ?>
  33.  
  34. <div align="center">
  35.     <img src="images/meetings.png" alt="Weekly meeting recording" height="50" width="125" /><br /><br />
  36.     Now Playing<br />
  37.     <strong><em><?php echo $audio; ?></em></strong><br />
  38.    
  39.     <embed type="application/x-mplayer2" pluginspage="http://microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="modules/<?php echo $module_name; ?>/clan_meetings/current/<?php echo $audio; ?>" name="MediaPlayer" width="200" height="100" autostart="0"></embed><br /><br />
  40.    
  41.     [ <a href="<?php echo $siteurl; ?>/modules/<?php echo $module_name; ?>/clan_meetings/current.m3u" onclick="window.open(this.href, 'popup', 'width=300, height=200, scrollbars=no, resizable=no, toolbar=no, directories=no, location=no, status=no, left=0, top=0'); return false;"><strong><em>Pop up player</em></strong></a> ]<br /><br />
  42.    
  43.     <strong>Meeting Archive...</strong><br /><br />
  44.    
  45.     <?php if ($start): ?>
  46.     <object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab" width="125" height="50">
  47.         <param name="FileName" value="<?php echo $audio_loc; ?>/<?php echo $meeting; ?>">
  48.         <param name="AutoStart" value="1">
  49.         <param name="ShowTracker" value="1">
  50.         <param name="ShowControls" value="1">
  51.         <param name="ShowGotoBar" value="1">
  52.         <param name="ShowDisplay" value="0">
  53.         <param name="ShowStatusBar" value="0">
  54.         <param name="AutoSize" value="0">
  55.         <param name="PlayCount" value="1">
  56.         <embed type="application/x-mplayer2" src="<?php echo $audio_loc; ?>/<?php echo $meeting; ?>" name="MediaPlayer" width="200" height="100" AutoStart="1" ShowTracker="1" ShowControls="1" PlayCount="1" ShowGotoBar="1" ShowDisplay="0" ShowStatusBar="0" AutoSize="0" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"></embed>
  57.     </object>
  58.     <?php endif; ?>
  59.    
  60.     <form action="modules.php?name=<?php echo $module_name; ?>" method="post">
  61.         <select name="meeting">
  62.             <option value="">Choose a meeting</option>
  63.             <?php
  64.            
  65.             $files  = array();
  66.             $path   = $audio_loc;
  67.             $handle = opendir($path);
  68.            
  69.             while ($file = readdir($handle)) {
  70.                 if (is_dir($path . '/' . $file)) {
  71.                     continue;
  72.                 }
  73.                
  74.                 if (is_file($path . '/' . $file) && $file != '.' && $file != '..') {
  75.                     $files[] = $file;
  76.                 }
  77.             }
  78.            
  79.             closedir($handle);
  80.             asort($files);
  81.            
  82.             foreach ($files as $i => $f) {
  83.                 echo '<option value="' . $f . '">' . $f . '</option>';
  84.             }
  85.            
  86.             ?>
  87.         </select>
  88.         <input name="start" type="submit" value="Play!" />
  89.     </form>
  90.    
  91.     <br />
  92.    
  93.     <strong>No plug-in? No problem!</strong><br />
  94.    
  95.     [ <a href="http://port25.technet.com/pages/windows-media-player-firefox-plugin-download.aspx" target="_blank"><strong><em>Windows plugin</em></strong></a> ]<br /><br />
  96.     [ <a href="http://www.apple.com/quicktime/download/" target="_blank"><strong><em>Macintosh Quicktime</em></strong></a> - Firefox, Opera, Safari and Google Chrome ]<br /><br />
  97.     [ <a href="http://www.microsoft.com/windows/windowsmedia/player/wmcomponents.mspx" target="_blank"><strong><em>Macintosh Windows media player components</em></strong></a> ]
  98. </div>
  99.  
  100. <div align="right" style="margin-top: 10px;">
  101.     <a href="http://www.phoenixsniperteam.com/modules.php?name=Profile&amp;mode=viewprofile&amp;u=1741" target="_blank">&copy;</a>
  102. </div>
  103.  
  104. <?php
  105.  
  106. CloseTable();
  107. include_once(NUKE_BASE_DIR . 'footer.php');
  108.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement