Ver código fonte

Added Support to SlideShare presentations

vbracco 16 anos atrás
pai
commit
8a07840394
2 arquivos alterados com 18 adições e 1 exclusões
  1. 15 0
      classes/functions.php
  2. 3 1
      classes/gelato.class.php

+ 15 - 0
classes/functions.php Ver arquivo

@@ -170,11 +170,26 @@ if(!defined('entry') || !entry) die('Not a valid page');
170 170
 		return $params2[0];
171 171
 	}
172 172
 	
173
+	function isSlideSharePresentation($videoUrl) {
174
+		if (beginsWith($videoUrl, "[slideshare id="))
175
+			return true;
176
+		else
177
+			return false;
178
+	}
179
+	
180
+	function getSlideSharePresentationCode($videoUrl) {
181
+		$videoUrl = str_replace("[slideshare id=", "", $videoUrl);
182
+		$videoUrl = str_replace("&doc=", " ", $videoUrl);
183
+		$videoUrl = str_replace("&w=", " ", $videoUrl);
184
+		return explode(" ",$videoUrl);
185
+	}
186
+	
173 187
 	function isVideo($url) {
174 188
 		if (isYoutubeVideo($url)) { return true; }
175 189
 		elseif (isVimeoVideo($url)) { return true; }
176 190
 		elseif (isDailymotionVideo($url)) { return true; }
177 191
 		elseif (isYahooVideo($url)) { return true; }
192
+		elseif (isSlideSharePresentation($url)) { return true; }
178 193
 		else { return false; }
179 194
 	}
180 195
 	

+ 3 - 1
classes/gelato.class.php Ver arquivo

@@ -172,11 +172,13 @@ class gelato extends Conexion_Mysql {
172 172
 		} elseif (isYahooVideo($url)) {
173 173
 			$id_video = getYahooVideoCode($url);
174 174
 			return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf\"><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"event_function=YAHOO.yv.Player.SWFInterface&amp;id=".$id_video[1]."&amp;vid=".$id_video[0]."&amp;onsite=1&amp;site=video.yahoo.com&amp;page=792730258&amp;lang=en-US&amp;intl=us\" /></object>\n";
175
+		} elseif (isSlideSharePresentation($url)) {
176
+			$id_video = getSlideSharePresentationCode($url);
177
+			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";
175 178
 		} else {
176 179
 			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion or Yahoo Video)";
177 180
 		}		
178 181
 	}
179
-	
180 182
 	function getMp3Player($url) {
181 183
 		if (isMP3($url)) {
182 184
 			$playerUrl = $this->conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url;