music.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!DOCTYPE html>
  2. <html>
  3. <link rel="stylesheet" href="//cdn.rawgit.com/TeaMeow/TocasUI/master/dist/tocas.min.css">
  4. <head>
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  6. <meta charset="UTF-8">
  7. <title>Meow</title>
  8. <!--Written by Rub-->
  9. <!-- Rewritten by TC@IMUS Lab in 2016 -->
  10. <script>
  11. $(document).ready(function(){
  12. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
  13. //Mobile
  14. }else{
  15. //Viewing on PC
  16. }
  17. });
  18. </script>
  19. </head>
  20. <body>
  21. <script type="text/javascript">
  22. $(document).ready(function(){
  23. $("div").click(function(){
  24. if ($(this).attr('id') != null && $(this).attr('id')!= "headbar"){
  25. //alert($(this).attr('id'));
  26. $("#headbar").load("play.php?song=" + $(this).attr('id'));
  27. }
  28. });
  29. });
  30. </script>
  31. <div class="ts container">
  32. <br>
  33. <h1>IMUS Laboratory </h1><br>
  34. <h2>ArOZ Music Bank</h2>
  35. <div class="ts pointing secondary big menu">
  36. <a class="item" href="index.php">Index</a>
  37. <a class="active item" href="music.php">Music</a>
  38. <a class="item" href="video.php">Video</a>
  39. <a class="item" href="upload/">Upload</a>
  40. <a class="item" href="upload/uploads/">Upload Dir</a>
  41. </div>
  42. <div id="headbar" class="ts segment">
  43. <p><br></p>
  44. <p>On this page,
  45. <br>you can loop one of your favourite music by clicking the "Play" button on the right.
  46. <br>You can also adjust the global volume by using the Vol+ and Vol- Buttons, or adjust local volume by player's volume button.
  47. <br>Design for single person and local network use ONLY.</p>
  48. <p></p>
  49. <div class="ts top left attached label">Information</div>
  50. </div>
  51. <div class="ts horizontal divider">Music Bank</div>
  52. <?php
  53. //Change this to your upload dir if you are not using ArOZ build in upload system
  54. $uploaddir = 'upload/uploads/music/';
  55. //List out all the files in the upload dir first.
  56. $files = scandir($uploaddir);
  57. $linenumber = 0;
  58. foreach($files as $file) {
  59. if(strpos($file,"inith") !== False){
  60. $filename = substr($file,0,strripos($file,"."));//mp4 acceptable playing method
  61. //$filename = str_replace(".mp3","",$file); //mp3 only method
  62. $filename = str_replace("inith","",$filename);
  63. $filename = hex2bin($filename);
  64. echo '<div class="ts text container">
  65. <div class="ts two column narrow container grid">
  66. <div align="left" class="column">
  67. <div class="ts text container">
  68. <i class="music icon"></i>'.$filename.'
  69. </div>
  70. </div>
  71. <div align="right" class="column">
  72. <div class="ts buttons">
  73. <div id="'.$uploaddir.$file.'"class="ts mini basic button" href="#">Play</div>
  74. <a class="ts mini secondary basic button" href="'.$uploaddir.$file.'" download>Download</a>
  75. </div>
  76. </div>
  77. </div>
  78. </div>';
  79. }
  80. $linenumber += 1;
  81. }
  82. ?>
  83. <br>
  84. <p align="right"><img class="ts small image" src="logo.png""></p>
  85. </div>
  86. </body>
  87. </html>