Browse Source

Adding Odeo Mp3 format

vbracco 18 years ago
parent
commit
efa1b44dca
3 changed files with 18 additions and 1 deletions
  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 View File

3
 			<label for="url">MP3 URL</label>			
3
 			<label for="url">MP3 URL</label>			
4
 			<input class="txt" type="text" name="url" id="url" value="{editUrl}" size="80" />
4
 			<input class="txt" type="text" name="url" id="url" value="{editUrl}" size="80" />
5
 			<div style="color: rgb(136, 136, 136); margin-bottom: 5px; font-size: 11px; font-weight: bold;">
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
 				<span style="font-size: 10px; font-weight: normal;">(ie. http://www.goear.com/listen.php?v=c0a2c85)</span>
7
 				<span style="font-size: 10px; font-weight: normal;">(ie. http://www.goear.com/listen.php?v=c0a2c85)</span>
8
 			</div>
8
 			</div>
9
 		</div>								
9
 		</div>								

+ 15 - 0
classes/functions.php View File

50
 			}
50
 			}
51
 		} elseif (isGoEar($remoteFileName)) {
51
 		} elseif (isGoEar($remoteFileName)) {
52
 			return true;
52
 			return true;
53
+		} elseif (isOdeo($remoteFileName)) {
54
+			return true;			
53
 		} else {
55
 		} else {
54
 			return false;
56
 			return false;
55
 		}
57
 		}
69
 			return false;
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
 	function isImageFile($photoUrl) {
87
 	function isImageFile($photoUrl) {
73
 		if (endsWith($photoUrl, ".jpg")) { return true; }
88
 		if (endsWith($photoUrl, ".jpg")) { return true; }
74
 		elseif (endsWith($photoUrl, ".gif")) { return true; }
89
 		elseif (endsWith($photoUrl, ".gif")) { return true; }

+ 2 - 0
classes/gelato.class.php View File

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";
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
 		} elseif (isGoEar($url)) {
182
 		} elseif (isGoEar($url)) {
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";
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
 		} else {
186
 		} else {
185
 			return "This URL is not an MP3 file.";
187
 			return "This URL is not an MP3 file.";
186
 		}		
188
 		}