Explorar el Código

Support the new url format for Vimeo. The old format still working too.

vbracco hace 16 años
padre
commit
a05e8a4336
Se han modificado 2 ficheros con 6 adiciones y 3 borrados
  1. 5 2
      classes/functions.php
  2. 1 1
      classes/gelato.class.php

+ 5 - 2
classes/functions.php Ver fichero

@@ -120,14 +120,17 @@ if(!defined('entry') || !entry) die('Not a valid page');
120 120
 	}
121 121
 	
122 122
 	function isVimeoVideo($videoUrl) {
123
-		if (beginsWith($videoUrl, "http://vimeo.com/clip:") || beginsWith($videoUrl, "http://www.vimeo.com/clip:"))
123
+		if (beginsWith($videoUrl, "http://vimeo.com/") || beginsWith($videoUrl, "http://www.vimeo.com/"))
124 124
 			return true;
125 125
 		else
126 126
 			return false;
127 127
 	}
128 128
 	
129 129
 	function getVimeoVideoUrl($videoUrl) {
130
-		return array_pop(explode("clip:",$videoUrl));
130
+		if(substr_count($videoUrl,"clip:")==1)
131
+			return array_pop(explode("clip:",$videoUrl));
132
+		else
133
+			return array_pop(explode("/",$videoUrl));
131 134
 	}
132 135
 	
133 136
 	function isYoutubeVideo($videoUrl) {

+ 1 - 1
classes/gelato.class.php Ver fichero

@@ -174,7 +174,7 @@ class gelato extends Conexion_Mysql {
174 174
 			$id_video = getSlideSharePresentationCode($url);
175 175
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.slideshare.net/swf/player.swf?presentationId=".$id_video[0]."&amp;doc=".$id_video[1]."&amp;inContest=0&amp;startSlide=1\"><param name=\"quality\" value=\"high\" /></object>\n";
176 176
 		} else {
177
-			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion or Yahoo Video)";
177
+			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion, Yahoo Video or SlideShare)";
178 178
 		}		
179 179
 	}
180 180
 	function getMp3Player($url) {