Commit 53becbaf0d2df1f85625a3c60ac425d0a76dd805
- Diff rendering mode:
- inline
- side by side
localhost.sql
(5 / 15)
|   | |||
| 1 | 1 | -- phpMyAdmin SQL Dump | |
| 2 | -- version 3.2.3 | ||
| 2 | 3 | -- http://www.phpmyadmin.net | |
| 3 | 4 | -- | |
| 4 | 5 | -- 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 | ||
| 5 | 9 | ||
| 6 | 10 | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; | |
| 7 | 11 | ||
| 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 | |||
| 14 | 12 | -- | |
| 15 | 13 | -- Database: `test` | |
| 16 | 14 | -- | |
| … | … | ||
| 26 | 26 | `title` varchar(255) DEFAULT NULL, | |
| 27 | 27 | `video_url` varchar(255) DEFAULT NULL, | |
| 28 | 28 | PRIMARY KEY (`id`) | |
| 29 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ; | ||
| 29 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=59 ; | ||
| 30 | 30 | ||
| 31 | 31 | -- | |
| 32 | 32 | -- Dumping data for table `node` | |
| 33 | 33 | -- | |
| 34 | 34 | ||
| 35 | INSERT 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'); | ||
| 43 | 35 | ||
| 44 | 36 | -- -------------------------------------------------------- | |
| 45 | 37 |
|   | |||
| 39 | 39 | ||
| 40 | 40 | $db['default']['hostname'] = "localhost"; | |
| 41 | 41 | $db['default']['username'] = "root"; | |
| 42 | $db['default']['password'] = ""; | ||
| 42 | $db['default']['password'] = "kasthuri"; | ||
| 43 | 43 | $db['default']['database'] = "test"; | |
| 44 | 44 | $db['default']['dbdriver'] = "mysql"; | |
| 45 | 45 | $db['default']['dbprefix'] = ""; |
|   | |||
| 3 | 3 | /** | |
| 4 | 4 | * Super Class | |
| 5 | 5 | * @package Embedded Video | |
| 6 | * @author Sivaji | ||
| 6 | 7 | * @link | |
| 7 | 8 | */ | |
| 8 | 9 | ||
| … | … | ||
| 46 | 46 | ||
| 47 | 47 | $feed = ''; | |
| 48 | 48 | switch($provider){ | |
| 49 | case 'youtube' : | ||
| 49 | case 'youtube' : | ||
| 50 | 50 | include_once('Youtube.inc'); | |
| 51 | 51 | $youtube = new Youtube(); | |
| 52 | 52 | $feed = $youtube->youtube_video_feed($url); | |
| 53 | 53 | 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; | ||
| 54 | 65 | } | |
| 66 | |||
| 67 | |||
| 55 | 68 | return $feed; | |
| 56 | 69 | ||
| 57 | 70 | ||
| … | … | ||
| 105 | 105 | $guba=new guba(); | |
| 106 | 106 | $output= $guba->guba_html($url,$options); | |
| 107 | 107 | break; | |
| 108 | |||
| 108 | case 'tudou': | ||
| 109 | include_once('todou.inc'); | ||
| 110 | $todou=new todou(); | ||
| 111 | $output= $todou->todou_html($url,$options); | ||
| 112 | break; | ||
| 109 | 113 | ||
| 110 | 114 | case 'livevideo': | |
| 111 | 115 | include_once('livevideo.inc'); |
|   | |||
| 17 | 17 | */ | |
| 18 | 18 | function dailymotion_html(&$url, $options = array()) { | |
| 19 | 19 | // 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; | ||
| 22 | 35 | ||
| 23 | 36 | $div_id = isset($options['div_id']) ? $options['div_id'] : 'dailymotion'; | |
| 24 | 37 | $height = isset($options['height']) ? $options['height'] : '300'; | |
| … | … | ||
| 51 | 51 | FLASH; | |
| 52 | 52 | return $output; | |
| 53 | 53 | } | |
| 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. | ||
| 73 | curl_setopt($curl, CURLOPT_URL, $feedurl); | ||
| 74 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | ||
| 75 | curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0); | ||
| 76 | |||
| 77 | # GRAB THE XML FILE. | ||
| 78 | $xmlTwitter = curl_exec($curl); | ||
| 79 | |||
| 80 | curl_close($curl); | ||
| 81 | |||
| 82 | # SET UP XML OBJECT. | ||
| 83 | $xmlObjTwitter = simplexml_load_string( $xmlTwitter ); | ||
| 84 | |||
| 85 | |||
| 86 | |||
| 87 | foreach ( $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]; | ||
| 100 | return $feed; | ||
| 101 | |||
| 102 | |||
| 103 | |||
| 104 | /* | ||
| 105 | $feedurl = "http://www.dailymotion.com/rss/video/".$video_id; | ||
| 106 | |||
| 107 | |||
| 108 | if(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 | |||
| 150 | print_r($feed);*/ | ||
| 151 | |||
| 152 | |||
| 153 | } | ||
| 154 | |||
| 54 | 155 | } | |
| 55 | 156 |
|   | |||
| 17 | 17 | */ | |
| 18 | 18 | function google_video_html(&$url, $options = array()) { | |
| 19 | 19 | // 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); | ||
| 21 | 21 | $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; | ||
| 22 | 27 | ||
| 23 | 28 | $div_id = isset($options['div_id']) ? $options['div_id'] : 'google_video'; | |
| 24 | 29 | $height = isset($options['height']) ? $options['height'] : '300'; |
|   | |||
| 18 | 18 | function myspace_html(&$url, $options = array()) { | |
| 19 | 19 | // change http//vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=101432953 to | |
| 20 | 20 | // 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 | ||
| 21 | 23 | ||
| 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]; | ||
| 24 | 27 | $div_id = isset($options['div_id']) ? $options['div_id'] : 'myspace'; | |
| 25 | 28 | $height = isset($options['height']) ? $options['height'] : '300'; | |
| 26 | 29 | $width = isset($options['width']) ? $options['width'] : '350'; |
|   | |||
| 16 | 16 | * array containing video height, width, autoplay etc | |
| 17 | 17 | */ | |
| 18 | 18 | function sevenload_html(&$url, $options = array()) { | |
| 19 | //http://in.sevenload.com/videos/5TtIXUg-The-timelapse-alone | ||
| 19 | 20 | //http://www.livevideo.com/video/9E77A4AC44DA41848E64A7949009C94E/flintoff-shows-off-his-koala-b.aspx | |
| 20 | 21 | //http://www.livevideo.com/flvplayer/embed/9E77A4AC44DA41848E64A7949009C94E" | |
| 21 | 22 | ||
| 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); | ||
| 24 | 30 | $div_id = isset($options['div_id']) ? $options['div_id'] : 'sevenload'; | |
| 25 | 31 | $height = isset($options['height']) ? $options['height'] : '300'; | |
| 26 | 32 | $width = isset($options['width']) ? $options['width'] : '350'; | |
| … | … | ||
| 39 | 39 | <param name="movie" value="$url"></param> | |
| 40 | 40 | <param name="allowFullScreen" value="true"></param> | |
| 41 | 41 | <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> | ||
| 43 | 43 | </object> | |
| 44 | 44 | </div> | |
| 45 | 45 | FLASH; | |
| 46 | |||
| 46 | 47 | return $output; | |
| 47 | 48 | ||
| 48 | 49 |
|   | |||
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | 43 | return $output; | |
| 44 | } | ||
| 44 | 45 | ||
| 46 | function 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; | ||
| 45 | 54 | ||
| 55 | $feed ="<br>"."<img src = $thumbnail>"; | ||
| 56 | |||
| 57 | return $feed; | ||
| 58 | } | ||
| 59 | |||
| 46 | 60 | ||
| 61 | |||
| 47 | 62 | ||
| 48 | 63 | } | |
| 49 | 64 | ||
| 50 | 65 | ||
| 51 | 66 | ||
| 52 | 67 | ||
| 53 | } |

