]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Readded giss.tv support.
authorSem <sembrestels@riseup.net>
Sat, 31 Dec 2011 20:04:45 +0000 (21:04 +0100)
committerSem <sembrestels@riseup.net>
Sat, 31 Dec 2011 20:04:45 +0000 (21:04 +0100)
lib/gisstv.php [new file with mode: 0644]
lib/videolist.php
views/default/videolist/watch/gisstv.php [new file with mode: 0644]

diff --git a/lib/gisstv.php b/lib/gisstv.php
new file mode 100644 (file)
index 0000000..24e1134
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+function videolist_parseurl_gisstv($url) {
+       $parsed = parse_url($url);
+       $path = explode('/', $parsed['path']);
+
+       if ($parsed['host'] != 'giss.tv' || $path[1] != 'dmmdb') {
+               return false;
+       }
+       
+       if($path[2] == 'contents' && isset($path[3])) {
+               $video_id = $path[3];
+       } elseif($path[3] == 'contents' && isset($path[4])) {
+               $video_id = $path[4];
+       } else {
+               return false;
+       }
+       
+       return array(
+               'videotype' => 'gisstv',
+               'video_id' => $video_id,
+       );
+}
+
+function videolist_get_data_gisstv($parsed){
+       $video_id = $parsed['video_id'];
+       
+       $buffer = file_get_contents('http://giss.tv/dmmdb//rss.php');
+       $xml = new SimpleXMLElement($buffer);
+       
+       $data = array();
+       foreach($xml->xpath('/rss/channel/item') as $item){
+               if(sanitize_string($item->link) == 'http://giss.tv/dmmdb//contents/'.$video_id) {
+                       $data['title'] = sanitize_string($item->title);
+                       $data['description'] = strip_tags($item->description);
+                       $data['thumbnail'] = sanitize_string($item->thumbnail);
+                       break;
+               }
+       }
+       return $data;
+}
index 4e12c5361bada844c534126e198a34e856da079e..45253a9e397d932d52c5238559c34319b501b74c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define('VIDEOLIST_SUPPORTED_PLATFORMS', 'youtube, vimeo, metacafe, bliptv');
+define('VIDEOLIST_SUPPORTED_PLATFORMS', 'youtube, vimeo, metacafe, bliptv', 'gisstv');
 
 foreach(explode(', ', VIDEOLIST_SUPPORTED_PLATFORMS) as $videotype){
        include(elgg_get_plugins_path()."videolist/lib/$videotype.php");
diff --git a/views/default/videolist/watch/gisstv.php b/views/default/videolist/watch/gisstv.php
new file mode 100644 (file)
index 0000000..15a903a
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+$video_id = $vars['entity']->video_id;
+$width = $vars['width'];
+$height = $vars['height'];
+
+echo "<video width=\"$width\" height=\"$height\" controls=\"\" tabindex=\"0\">
+       <source type=\"video/ogg\" src=\"http://giss.tv/dmmdb//contents/$video_id\"></source>
+</video>";