瀏覽代碼

Add files via upload

tobychui 8 年之前
父節點
當前提交
ce9a88044c
共有 10 個文件被更改,包括 356 次插入0 次删除
  1. 二進制
      image/Banner.png
  2. 二進制
      image/circle.png
  3. 二進制
      image/logo.png
  4. 二進制
      logo.png
  5. 96 0
      music.php
  6. 66 0
      play.php
  7. 39 0
      request.php
  8. 0 0
      tocas.min.css
  9. 60 0
      video.php
  10. 95 0
      vidplay.php

二進制
image/Banner.png


二進制
image/circle.png


二進制
image/logo.png


二進制
logo.png


+ 96 - 0
music.php

@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html>
+<link rel="stylesheet" href="//cdn.rawgit.com/TeaMeow/TocasUI/master/dist/tocas.min.css">
+    <head>
+	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
+	<meta charset="UTF-8">
+        <title>Meow</title>
+    <!--Written by Rub-->
+	<!-- Rewritten by TC@IMUS Lab in 2016 -->
+	<script>
+		$(document).ready(function(){
+				if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
+					//Mobile
+				}else{
+					//Viewing on PC
+				}
+		});
+		</script>
+    </head>
+    <body>
+	<script type="text/javascript">
+	$(document).ready(function(){
+		$("div").click(function(){
+			if ($(this).attr('id') != null && $(this).attr('id')!= "headbar"){
+				//alert($(this).attr('id'));
+				$("#headbar").load("play.php?song=" + $(this).attr('id'));
+			}
+		});
+                
+				
+	});
+	</script>
+	<div class="ts container">
+	<br>
+	<h1>IMUS Laboratory </h1><br>
+	<h2>ArOZ Music Bank</h2>
+	<div class="ts pointing secondary big menu">
+    <a class="item" href="index.php">Index</a>
+    <a class="active item" href="music.php">Music</a>
+	<a class="item" href="video.php">Video</a>
+	<a class="item" href="upload/">Upload</a>
+	<a class="item" href="upload/uploads/">Upload Dir</a>
+</div>
+	
+	<div id="headbar" class="ts segment">
+	<p><br></p>
+    <p>On this page,
+	<br>you can loop one of your favourite music by clicking the "Play" button on the right.
+	<br>You can also adjust the global volume by using the Vol+ and Vol- Buttons, or adjust local volume by player's volume button.
+	<br>Design for single person and local network use ONLY.</p>
+    <p></p>
+    <div class="ts top left attached label">Information</div>
+	</div>
+
+	<div class="ts horizontal divider">Music Bank</div>
+        
+		<?php
+		//Change this to your upload dir if you are not using ArOZ build in upload system
+		$uploaddir = 'upload/uploads/music/';
+		//List out all the files in the upload dir first.
+		$files = scandir($uploaddir);
+		$linenumber = 0;
+			foreach($files as $file) {
+				if(strpos($file,"inith") !== False){
+					$filename =  substr($file,0,strripos($file,"."));//mp4 acceptable playing method
+					//$filename = str_replace(".mp3","",$file); //mp3 only method
+					$filename = str_replace("inith","",$filename);
+					$filename = hex2bin($filename);
+					echo '<div class="ts text container">
+						<div class="ts two column narrow container grid">
+						
+						<div align="left" class="column">
+							<div class="ts text container">
+							<i class="music icon"></i>'.$filename.'
+							</div>
+						</div>
+						
+						<div align="right" class="column">
+							<div  class="ts buttons">
+							<div id="'.$uploaddir.$file.'"class="ts mini basic button" href="#">Play</div>
+							<a class="ts mini secondary basic button" href="'.$uploaddir.$file.'" download>Download</a>
+							</div>
+						</div>
+
+						</div>
+						</div>';
+				}
+			  $linenumber += 1;
+			}
+		
+		?>
+        <br>
+		<p align="right"><img class="ts small image" src="logo.png""></p>
+        </div>
+    </body>
+</html>

+ 66 - 0
play.php

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="UTF-8">
+		<style>a:link {color: #FE9A2E}</style>
+		<link rel="stylesheet" href="//cdn.rawgit.com/TeaMeow/TocasUI/master/dist/tocas.min.css">
+		<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
+		<script>
+		$(document).ready(function(){
+			var player = document.getElementById("musicplayer");
+			if (localStorage.getItem("systemvol") != null){
+				player.volume = localStorage.getItem("systemvol");
+				udvol();
+			}
+		});
+		</script>
+	</head>
+
+<body>
+<div align="center" class="ts text container">
+<?php
+if (isset($_GET['song']) !== False){
+	if (strpos($_GET['song'],".mp4") !== False){
+	echo "Now Playing || " . hex2bin(str_replace("inith","",basename($_GET['song'], ".mp4"))) . " [MP4 AAC]<br>";
+	}elseif (strpos($_GET['song'],".mp3") !== False){
+	echo "Now Playing || " . hex2bin(str_replace("inith","",basename($_GET['song'], ".mp3"))). " [MP3]<br>";
+	}else{
+	echo "Playing unsupported format >> " . str_replace("inith","",$_GET['song']). "<br>";	
+	}
+	echo '<audio id="musicplayer" controls preload="auto" loop autoplay>';
+	echo '<source type="audio/mpeg" src="' . $_GET['song'] . '">';
+	echo '</audio>';
+	echo "<br>";
+}
+?>
+<div align="center" class="ts container">
+<button class="ts mini basic button" onclick="Voldown()" type="button">Vol -</button>
+<span id="vol">[Global Volume:100]</span>
+<button class="ts mini basic button" onclick="Volup()" type="button">Vol +</button>
+</div>
+</div>
+<script>
+var player = document.getElementById("musicplayer");
+function udvol(){
+	$('#vol').text("[Global Volume: " + parseInt(player.volume * 100) + "]");
+}
+
+function saveVol(){
+	var systemvol = player.volume;
+	localStorage.setItem("systemvol", systemvol);
+}
+
+function Voldown() { 
+    player.volume -= 0.1;
+	saveVol();
+	udvol();
+} 
+  
+function Volup() { 
+    player.volume += 0.1;
+	saveVol();
+	udvol();
+} 
+</script>
+</body>
+</html>

+ 39 - 0
request.php

@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="UTF-8">
+    </head>
+
+<body>
+    <link rel="stylesheet" href="//cdn.rawgit.com/TeaMeow/TocasUI/master/dist/tocas.min.css">
+	<div class="ts text container">
+    <h1>IMUS Laboratory </h1>
+	<h2>ArOZ Bulk Download</h2>
+
+
+<?php
+//Change this line if you are not downloading from the aroz upload dir
+$uploaddir = 'upload/uploads/music/';
+
+foreach ($_GET as $key => $value) {
+$files = scandir($uploaddir);
+$filename = "inith" . bin2hex(str_replace("_"," ",$key));
+	foreach($files as $file) {
+	  if(strpos($file,substr($filename,0,-1))!== False){
+		  echo '<div class="ts container" style="outline: solid #353535">';
+		  echo '<h4>' . $file . "</h4><br>";
+		  echo '<a href="'.$uploaddir .$filename.'.mp3">download</a>';
+		  echo '</div><br>';
+	  }
+	  
+	}
+	echo str_replace("_"," ",$key);
+	echo '<a href="'.$uploaddir .$filename.'.mp3">download</a>';
+}
+
+echo "<br>";
+?>
+<br>
+<p align="right"><img class="ts small image" src="logo.png"></p>
+</body>
+</html>

文件差異過大導致無法顯示
+ 0 - 0
tocas.min.css


+ 60 - 0
video.php

@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+<link rel="stylesheet" href="//cdn.rawgit.com/TeaMeow/TocasUI/master/dist/tocas.min.css">
+    <head>
+	<meta charset="utf-8">
+        <title>Meow</title>
+        <?php
+		//Modify this if you need mmfpeg support
+		// movie.avi.... name of the movie you want to take a screenshot from
+		// 00:00:00.... Where in the movie do you wanna take your screenshot, 10 seconds from start? ex: 00:00:10
+		// picname..... name your generated pic
+		//exec("START ffmpeg.exe -vcodec png -i uploads/video/movie.avi -ss  00:00:10 -vframes frames picname%d.png");
+		?> 
+    </head>
+    <body>
+	<div class="ts container">
+	<br>
+	<h1>IMUS Laboratory </h1><br>
+	<h2>ArOZ Video Bank</h2>
+	<div class="ts pointing secondary big menu">
+    <a class="item" href="index.php">Index</a>
+    <a class="item" href="music.php">Music</a>
+	<a class="active item" href="video.php">Video</a>
+	<a class="item" href="upload/">Upload</a>
+	<a class="item" href="upload/uploads/">Upload Dir</a>
+</div>
+	<div class="ts segment">
+	<p><br></p>
+    <p>On this page, you can click "View" to stream a video from your server.
+	<br>You can also download the video after you have entered the "view" page.
+	<br>Make sure your browser support HTML5 player function :)</p>
+    <p></p>
+    <div class="ts top left attached label">Information</div>
+	</div>
+	<div class="ts container">
+	<?php
+	$dir = 'upload/uploads/video/';
+	$files = scandir($dir);
+	$linenumber = 0;
+	foreach($files as $file){
+		#echo substr_count($dir,"/") - 1 . '<br>';
+		if ($linenumber >= substr_count($dir,"/") - 1){ #Bypass the fisrt two directory
+			if (strpos($file, '.mp4') == True){
+			#echo $file;
+			echo '<div class="ts basic jumbotron" style="outline: solid #353535">';
+			$filetitle = hex2bin(str_replace(".mp4","",str_replace("inith","",$file)));
+			echo '<h4 class="ts header"><i class="video play outline icon"></i>' . $filetitle . "</h4>";
+			echo substr(filesize($dir . $file)/1000000,0,4) . "MB [" . pathinfo($dir.$file)['extension'].']<br>';
+			echo '<a class="ts mini primary button" href="vidplay.php?directory='. $dir .'&filename='.$file.'">View</a>';
+			echo '</div>';
+			}
+			}
+		$linenumber += 1;
+	}
+	
+	?>
+	</div>
+	<p align="right"><img class="ts small image" src="logo.png"></p>
+    </body>
+</html>

+ 95 - 0
vidplay.php

@@ -0,0 +1,95 @@
+<html>
+<link rel="stylesheet" href="tocas.min.css">
+    <head>
+	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
+	<meta charset="utf-8">
+        <title>Video</title>
+        <script>
+		$(document).ready(function(){
+			var vidvol = 0.5
+			var player = document.getElementById("videoplayer");
+			var viddiv = document.getElementById("vidcontainer");
+			var maxvidwidth = document.getElementById("vidcontainer").offsetWidth;
+			var screenwidth = $(window).width();
+			if (localStorage.getItem("systemvol") != null){
+				vidvol = localStorage.getItem("systemvol");
+				player.volume = localStorage.getItem("systemvol");
+				if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
+					//Mobile
+					viddiv.style.left = 0;
+					viddiv.style.width= screenwidth* 0.93 + 'px';
+					player.width = screenwidth * 0.89; 
+				}else{
+					//Viewing on PC
+					player.width = maxvidwidth * 0.65; 
+				}
+			}
+			udvol();
+		});
+		</script>
+    </head>
+    <body>
+	<div class="ts container">
+	<h1>IMUS Laboratory </h1>
+	<h2>ArOZ Video Bank</h2>
+	<div class="ts divider"></div>
+	<div class="ts container">
+	<?php
+			$path = $_GET['directory'];
+			$file = $_GET['filename'];
+			echo '<div id="vidcontainer" class="ts basic jumbotron" style="background-color: #353535;">';
+			$filetitle = "|| " . hex2bin(str_replace(".mp4","",str_replace("inith","",$file)));
+			echo '<h2><font color="white">' . $filetitle . "</font></h2>";
+			echo '<video id="videoplayer" width="480" autoplay controls>';
+			echo '<source src="' . $path .$file.'" type="video/mp4">';
+			echo '<script>';
+			echo 'var video = document.currentScript.parentElement;';
+			echo 'video.volume = vidvol;';
+			echo '</script>';
+			echo '</video><br>';
+			
+			echo '</div>';
+	?>
+	<div class="ts basic jumbotron" style="outline: solid #353535">
+	<a align="right" class="ts mini basic button" href="video.php">Back</a>
+	<button class="ts mini basic button" onclick="Voldown()" type="button">Vol -</button>
+	<span id="vol">[Global Volume:100]</span>
+	<button class="ts mini basic button" onclick="Volup()" type="button">Vol +</button>
+	<button class="ts mini basic button" onclick="cinema()" type="button">Large Screen</button>
+	<a class="ts mini basic button" href="<?php echo $path .$file; ?>" download>Download</a>
+	</div><br>
+	<script>
+	var player = document.getElementById("videoplayer");
+	var oncinema = false;
+	function udvol(){
+		$('#vol').text("[Global Volume: " + parseInt(player.volume * 100) + "]");
+	}
+	function cinema(){
+		var maxvidwidth = document.getElementById("vidcontainer").offsetWidth;
+		if (oncinema == false){
+			player.width = maxvidwidth * 0.95;
+			oncinema = true;
+		}else{
+			player.width = maxvidwidth * 0.65;
+			oncinema = false;
+		}
+	}
+	function saveVol(){
+		var systemvol = player.volume;
+		localStorage.setItem("systemvol", systemvol);
+	}
+
+	function Voldown() { 
+		player.volume -= 0.1;
+		saveVol();
+		udvol();
+	} 
+	  
+	function Volup() { 
+		player.volume += 0.1;
+		saveVol();
+		udvol();
+	} 
+	</script>
+</body>
+</html>

部分文件因文件數量過多而無法顯示