Commit 53becbaf0d2df1f85625a3c60ac425d0a76dd805

sql file changed, more support to feeds added
  
11-- phpMyAdmin SQL Dump
2-- version 3.2.3
23-- http://www.phpmyadmin.net
34--
45-- Host: localhost
6-- Generation Time: Feb 25, 2010 at 09:31 PM
7-- Server version: 5.1.37
8-- PHP Version: 5.2.10-2ubuntu6.4
59
610SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
711
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12/*!40101 SET NAMES utf8 */;
13
1412--
1513-- Database: `test`
1614--
2626 `title` varchar(255) DEFAULT NULL,
2727 `video_url` varchar(255) DEFAULT NULL,
2828 PRIMARY KEY (`id`)
29) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ;
29) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=59 ;
3030
3131--
3232-- Dumping data for table `node`
3333--
3434
35INSERT INTO `node` (`id`, `title`, `video_url`) VALUES
36(1, 'first video', 'http://www.youtube.com/watch?v=28G9aAnA2RI'),
37(2, 'second video', 'http://www.youtube.com/watch?v=P2pcyxeLRmI'),
38(3, 'third video', 'http://www.youtube.com/watch?v=KHWItMZyjEg'),
39(4, '"Tune Jo Na Kaha" - Promo - NEW YORK', 'http://www.youtube.com/watch?v=q56Iru5OWFQ'),
40(19, 'muralitharan', 'http://www.dailymotion.com/video/x7i25v_sanath-jayasuriya-125-v-india-final_sport'),
41(20, 'from google', 'http://video.google.com/videoplay?docid=-2829745058296164658&hl=en'),
42(21, 'from dailymotion', 'http://www.dailymotion.com/us/featured/channel/music/video/xa3cin_miracle-man-by-cocosuma_music');
4335
4436-- --------------------------------------------------------
4537
  
3939
4040$db['default']['hostname'] = "localhost";
4141$db['default']['username'] = "root";
42$db['default']['password'] = "";
42$db['default']['password'] = "kasthuri";
4343$db['default']['database'] = "test";
4444$db['default']['dbdriver'] = "mysql";
4545$db['default']['dbprefix'] = "";
  
33/**
44 * Super Class
55 * @package Embedded Video
6 * @author Sivaji
67 * @link
78 */
89
4646
4747 $feed = '';
4848 switch($provider){
49 case 'youtube' :
49 case 'youtube' :
5050 include_once('Youtube.inc');
5151 $youtube = new Youtube();
5252 $feed = $youtube->youtube_video_feed($url);
5353 break;
54 case 'dailymotion':
55 include_once('dailymotion.inc');
56 $dailymotion=new Dailymotion();
57 $feed = $dailymotion->dailymotion_video_feed($url);
58 break;
59
60 case 'new':
61 include_once('yahoomusic.inc');
62 $yahoomusic=new yahoomusic();
63 $feed= $yahoomusic->yahoomusic_video_feed($url);
64 break;
5465 }
66
67
5568 return $feed;
5669
5770
105105 $guba=new guba();
106106 $output= $guba->guba_html($url,$options);
107107 break;
108
108 case 'tudou':
109 include_once('todou.inc');
110 $todou=new todou();
111 $output= $todou->todou_html($url,$options);
112 break;
109113
110114 case 'livevideo':
111115 include_once('livevideo.inc');
  
1717 */
1818 function dailymotion_html(&$url, $options = array()) {
1919 // convert http://www.dailymotion.com/video/x7i25v_sanath-jayasuriya-125-v-india-final_sport to http://www.dailymotion.com/swf/x7i25v_sanath-jayasuriya-125-v-india-final_sport&related=1
20 $ur=str_replace('video','swf',$url);
21 $url=$ur."&related=1";
20 //$ur=str_replace('video','swf',$url);
21 //$url=$ur."&related=1";
22 $str1 = explode("video/", $url);
23 $video_id = '';
24 if(strstr($str1[1], "/"))
25 {
26 $str2 = explode("/", $str1[1]);
27 $video_id = $str2[0];
28 }
29 else
30 $video_id = $str1[1];
31
32
33
34 $url="http://www.dailymotion.com/swf/".$video_id;
2235
2336 $div_id = isset($options['div_id']) ? $options['div_id'] : 'dailymotion';
2437 $height = isset($options['height']) ? $options['height'] : '300';
5151FLASH;
5252 return $output;
5353 }
54
55 function dailymotion_video_feed($url)
56{
57
58 $str1 = explode("video/", $url);
59 $video_id = '';
60 if(strstr($str1[1], "/"))
61 {
62 $str2 = explode("/", $str1[1]);
63 $video_id = $str2[0];
64 }
65 else
66 $video_id = $str1[1];
67
68$feedurl="http://www.dailymotion.com/rss/video/".$video_id;
69
70$curl = curl_init();
71
72# CURL SETTINGS.
73curl_setopt($curl, CURLOPT_URL, $feedurl);
74curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
75curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
76
77# GRAB THE XML FILE.
78$xmlTwitter = curl_exec($curl);
79
80curl_close($curl);
81
82# SET UP XML OBJECT.
83$xmlObjTwitter = simplexml_load_string( $xmlTwitter );
84
85
86
87foreach ( $xmlObjTwitter -> channel -> item as $item )
88{
89 $title = $item -> title;
90 // $item -> link;
91 $media = $item->xpath('//media:title');
92 // echo $media[0];
93 $desc = $item->xpath('//media:thumbnail/@url');
94 //echo "<img src =$desc[0]>";
95 $summary = $item->xpath('//itunes:summary');
96 }
97
98
99$feed= "<img src =$desc[0]>"."<br>".$title."<br>".$summary[0];
100return $feed;
101
102
103
104/*
105$feedurl = "http://www.dailymotion.com/rss/video/".$video_id;
106
107
108if(ini_get('allow_url_fopen') == 1)
109 {
110 $feed = @file($video_id);
111 if($feed === false)
112 $error = 1;
113 }
114 /*if( (ini_get('allow_url_fopen') == 1 && $error == 1) || ini_get('allow_url_fopen') == 0)
115 {
116 if(function_exists('curl_init'))
117 {
118 $ch = curl_init();
119 curl_setopt($ch, CURLOPT_URL, $feedurl);
120 curl_setopt($ch, CURLOPT_HEADER, 0);
121 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
122 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
123 $feed = curl_exec($ch);
124 $errormsg = curl_error($ch);
125 curl_close($ch);
126
127 if($errormsg != '')
128 {
129 echo $errormsg;
130 return false;
131 }
132 }
133 }
134 if(!is_array($feed))
135 {
136 $feed = explode("\n", $feed);
137 }
138
139 // cleanup
140 $buff_arr = array();
141 $i = 0;
142 foreach($feed as $k => $v)
143 {
144 $v = trim($v, " \t\r\n");
145 if($v != '')
146 $buff_arr[$i++] = $v;
147 print_r($buff_arr);
148 }
149
150print_r($feed);*/
151
152
153}
154
54155}
55156
  
1717 */
1818 function google_video_html(&$url, $options = array()) {
1919 // change http://video.google.com/videoplay?docid=-2829745058296164658&hl=en to http://video.google.com/googleplayer.swf?docid=-2829745058296164658&h
20 $ur=str_replace('videoplay','googleplayer.swf',$url);
20 /*$ur=str_replace('videoplay','googleplayer.swf',$url);
2121 $url=rtrim($ur,"l=en");
22 */
23 preg_match("/docid=([^(\&|$)]*)/", $url, $matches);
24 $videocode=$matches[1];
25
26 $url="http://video.google.com/googleplayer.swf?docid=".$videocode;
2227
2328 $div_id = isset($options['div_id']) ? $options['div_id'] : 'google_video';
2429 $height = isset($options['height']) ? $options['height'] : '300';
  
1818 function myspace_html(&$url, $options = array()) {
1919 // change http//vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=101432953 to
2020 // http://mediaservices.myspace.com/services/media/embed.aspx/m=101432953
21 //http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=64105959
22 // http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=41666942
2123
22 $url=explode('=', "$url");
23 $url="http://mediaservices.myspace.com/services/media/embed.aspx/m=".$url[2];
24 //$url=explode('=', "$url");
25 $url=explode("videoid=",$url);
26 $url="http://mediaservices.myspace.com/services/media/embed.aspx/m=".$url[1];
2427 $div_id = isset($options['div_id']) ? $options['div_id'] : 'myspace';
2528 $height = isset($options['height']) ? $options['height'] : '300';
2629 $width = isset($options['width']) ? $options['width'] : '350';
  
1616 * array containing video height, width, autoplay etc
1717 */
1818 function sevenload_html(&$url, $options = array()) {
19 //http://in.sevenload.com/videos/5TtIXUg-The-timelapse-alone
1920 //http://www.livevideo.com/video/9E77A4AC44DA41848E64A7949009C94E/flintoff-shows-off-his-koala-b.aspx
2021 //http://www.livevideo.com/flvplayer/embed/9E77A4AC44DA41848E64A7949009C94E"
2122
22 $url="http://freevideocoding.com/flvplayer.swf?file=".$url;
23
23 //$url="http://freevideocoding.com/flvplayer.swf?file=".$url;
24 $url1=explode('-',$url);
25 $url2=explode('/',$url1[0]);
26 $videocode=$url2[4];
27 $url="http://in.sevenload.com/pl/".$videocode."/500x314/0";
28 //print_r($url1);
29 //print_r($videocode);
2430 $div_id = isset($options['div_id']) ? $options['div_id'] : 'sevenload';
2531 $height = isset($options['height']) ? $options['height'] : '300';
2632 $width = isset($options['width']) ? $options['width'] : '350';
3939 <param name="movie" value="$url"></param>
4040 <param name="allowFullScreen" value="true"></param>
4141 <param name="allowscriptaccess" value="always"></param>
42 <embed src="$url" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>
42 <script type="text/javascript" src= $url ></script><p>Link: <a href="http://in.sevenload.com/videos/".$videocode."-The-timelapse-alone"><img src="http://static.sevenload.net/img/sevenload.png" width="66" height="10" alt="The timelapse alone" /></a></p>
4343 </object>
4444 </div>
4545FLASH;
46
4647 return $output;
4748
4849
  
4141
4242
4343return $output;
44}
4445
46function yahoomusic_video_feed($url)
47{
48
49$code1=explode('--',$url) ;
50 $code= $code1[1];
51
52
53$thumbnail="http://d.yimg.com/img.music.yahoo.com/image/v1/video/".$code;
4554
55$feed ="<br>"."<img src = $thumbnail>";
56
57return $feed;
58}
59
4660
61
4762
4863 }
4964
5065
5166
5267
53}