Bladeren bron

Adding Odeo Mp3 format

vbracco 16 jaren geleden
bovenliggende
commit
efa1b44dca
3 gewijzigde bestanden met toevoegingen van 18 en 1 verwijderingen
  1. 1 1
      admin/themes/admin/template_add_mp3.htm
  2. 15 0
      classes/functions.php
  3. 2 0
      classes/gelato.class.php

+ 1 - 1
admin/themes/admin/template_add_mp3.htm Bestand weergeven

@@ -3,7 +3,7 @@
3 3
 			<label for="url">MP3 URL</label>			
4 4
 			<input class="txt" type="text" name="url" id="url" value="{editUrl}" size="80" />
5 5
 			<div style="color: rgb(136, 136, 136); margin-bottom: 5px; font-size: 11px; font-weight: bold;">
6
-				This is the MP3 file URL or a GoEar URL.<br>
6
+				This is the MP3 file URL or a GoEar URL or Odeo URL.<br>
7 7
 				<span style="font-size: 10px; font-weight: normal;">(ie. http://www.goear.com/listen.php?v=c0a2c85)</span>
8 8
 			</div>
9 9
 		</div>								

+ 15 - 0
classes/functions.php Bestand weergeven

@@ -50,6 +50,8 @@ if(!defined('entry') || !entry) die('Not a valid page');
50 50
 			}
51 51
 		} elseif (isGoEar($remoteFileName)) {
52 52
 			return true;
53
+		} elseif (isOdeo($remoteFileName)) {
54
+			return true;			
53 55
 		} else {
54 56
 			return false;
55 57
 		}
@@ -69,6 +71,19 @@ if(!defined('entry') || !entry) die('Not a valid page');
69 71
 			return false;
70 72
 	}
71 73
 	
74
+	function isOdeo($songUrl){
75
+		if (beginsWith($songUrl, "http://odeo.com/audio/") || beginsWith($songUrl, "http://www.odeo.com/audio/"))
76
+			return true;
77
+		else
78
+			return false;
79
+	}
80
+	
81
+	function getOdeoCode($songUrl) {
82
+		$params = explode("audio/", $songUrl);
83
+		$params2 = explode("/",$params[1]);
84
+		return $params2[0];
85
+	}
86
+	
72 87
 	function isImageFile($photoUrl) {
73 88
 		if (endsWith($photoUrl, ".jpg")) { return true; }
74 89
 		elseif (endsWith($photoUrl, ".gif")) { return true; }

+ 2 - 0
classes/gelato.class.php Bestand weergeven

@@ -181,6 +181,8 @@ class gelato extends Conexion_Mysql {
181 181
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"" . $playerUrl . "\" width=\"290\" height=\"24\"><param name=\"movie\" value=\"" . $playerUrl . "\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
182 182
 		} elseif (isGoEar($url)) {
183 183
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"http://www.goear.com/files/localplayer.swf\" width=\"366\" height=\"75\"><param name=\"movie\" value=\"http://www.goear.com/files/localautoplayer.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"file=".getGoEarCode($url)."\" /></object>\n";
184
+		} elseif (isOdeo($url)) {
185
+			return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"http://media.odeo.com/flash/odeo_player.swf?v=3\" width=\"366\" height=\"75\"><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"type=audio&id=".getOdeoCode($url)."\" /><param name=\"wmode\" value=\"transparent\" /></object></object>\n";
184 186
 		} else {
185 187
 			return "This URL is not an MP3 file.";
186 188
 		}