Changeset 17383 for extensions/gvideo/include
- Timestamp:
- Aug 4, 2012, 4:15:54 PM (12 years ago)
- Location:
- extensions/gvideo/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/include/functions.inc.php
r17311 r17383 40 40 $json = json_decode($json, true); 41 41 $video = array_merge($video, array( 42 'url' => 'http://youtube.com/watch?v='.$video['id'], 42 43 'title' => $json['entry']['title']['$t'], 43 44 'description' => $json['entry']['media$group']['media$description']['$t'], … … 62 63 $json = json_decode($json, true); 63 64 $video = array_merge($video, array( 65 'url' => 'http://vimeo.com/'.$video['id'], 64 66 'title' => $json[0]['title'], 65 67 'description' => $json[0]['description'], … … 88 90 $video = array_merge($video, array( 89 91 'id' => $json['id'], 92 'url' => 'http://dailymotion.com/video/'.$json['id'], 90 93 'title' => $json['title'], 91 94 'description' => $json['description'], … … 108 111 $video['id'] = $matches[1]; 109 112 113 $video['url'] = $source_url; 114 110 115 preg_match('#<meta name="name" content="([^">]*)" />#', $html, $matches); 111 116 $video['title'] = $matches[1]; … … 131 136 $html = download_remote_file($source_url, true); 132 137 if ($html === false or $html == 'file_error') return false; 133 138 139 $video['url'] = 'http://wideo.fr/video/'.$video['id'].'.html'; 140 134 141 preg_match('#<meta property="og:title" content="([^">]*)" />#', $html, $matches); 135 142 $video['title'] = $matches[1]; … … 166 173 $html = download_remote_file($source_url, true); 167 174 if ($html === false or $html == 'file_error') return false; 168 175 176 $video['url'] = 'http://www.videobb.com/video/'.$video['id']; 177 169 178 preg_match('#<meta content="videobb - ([^">]*)" name="title" property="" />#', $html, $matches); 170 179 $video['title'] = $matches[1]; -
extensions/gvideo/include/gvideo.inc.php
r17307 r17383 70 70 71 71 /** 72 * add message on edition page72 * add message and link on edition page 73 73 */ 74 74 function gvideo_photo_edit() 75 75 { 76 global $page ;76 global $page, $template, $conf; 77 77 78 78 if ($page['page'] != 'photo') return; … … 85 85 $result = pwg_query($query); 86 86 87 if (pwg_db_num_rows($result)) 87 if (!pwg_db_num_rows($result)) return; 88 89 $video = pwg_db_fetch_assoc($result); 90 91 array_push($page['warnings'], l10n('This element is a video added with "Embedded Video"')); 92 93 if (function_exists('imagecreatetruecolor')) 88 94 { 89 array_push($page['warnings'], l10n('This element is a video added with "Embedded Video"')); 95 if (isset($_GET['add_film_frame'])) 96 { 97 include_once(GVIDEO_PATH . '/include/functions.inc.php'); 98 include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php'); 99 100 $image_infos = pwg_db_fetch_assoc(pwg_query('SELECT path, file FROM '.IMAGES_TABLE.' WHERE id = '.$_GET['image_id'].';')); 101 $thumb_source = $conf['data_location'].$image_infos['file']; 102 103 add_film_frame($image_infos['path'], $thumb_source); 104 add_uploaded_file($thumb_source, $image_infos['file'], null, null, $_GET['image_id']); 105 $template->assign('TN_UPDATE', true); 106 } 107 108 $admin_photo_base_url = get_root_url().'admin.php?page=photo-'.$_GET['image_id']; 109 $admin_url_start = $admin_photo_base_url.'-properties'; 110 $admin_url_start.= isset($_GET['cat_id']) ? '&cat_id='.$_GET['cat_id'] : ''; 111 112 $template->assign('U_ADD_FILM_FRAME', $admin_url_start.'&add_film_frame=1'); 113 $template->set_prefilter('picture_modify', 'gvideo_photo_edit_prefilter'); 90 114 } 91 115 } 92 116 117 function gvideo_photo_edit_prefilter($content) 118 { 119 $search[0] = '{if !url_is_remote($PATH)}'; 120 $replace[0] = '<li><a href="{$U_ADD_FILM_FRAME}" id="refresh_video">{\'Add film effect\'|@translate}</a></li>'.$search[0]; 121 122 $search[1] = '{$TN_SRC}'; 123 $replace[1] = $search[1].'{if $TN_UPDATE}?'.time().'{/if}'; 124 125 return str_replace($search, $replace, $content); 126 } 127 93 128 ?>
Note: See TracChangeset
for help on using the changeset viewer.