Changeset 20804
- Timestamp:
- Feb 18, 2013, 12:20:10 PM (11 years ago)
- Location:
- extensions/gvideo
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/add.php
r19213 r20804 7 7 if (isset($_POST['add_video'])) 8 8 { 9 $_POST['url'] = trim($_POST['url']); 9 10 // check inputs 10 11 if (empty($_POST['url'])) … … 12 13 array_push($page['errors'], l10n('Please fill the video URL')); 13 14 } 14 if ( !empty($_POST['url']) and($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )15 else if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false ) 15 16 { 16 17 if (isset($_POST['safe_mode'])) … … 28 29 if (count($page['errors']) == 0) 29 30 { 30 // download thumbnail31 $thumb_ext = empty($video['thumbnail']) ? 'jpg' : get_extension($video['thumbnail']);32 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext;33 $thumb_source = $conf['data_location'].$thumb_name;34 if ( empty($video['thumbnail']) or download_remote_file($video['thumbnail'], $thumb_source) !== true )35 {36 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg';37 copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source);38 }39 40 if (isset($_POST['add_film_frame']))41 {42 add_film_frame($thumb_source);43 }44 45 // add image and update infos46 $image_id = add_uploaded_file($thumb_source, $thumb_name, array($_POST['category']));47 48 $updates = array(49 'name' => pwg_db_real_escape_string($video['title']),50 'author' => pwg_db_real_escape_string($video['author']),51 'is_gvideo' => 1,52 );53 54 if ( $_POST['sync_description'] and !empty($video['description']) )55 {56 $updates['comment'] = pwg_db_real_escape_string($video['description']);57 }58 if ( $_POST['sync_tags'] and !empty($video['tags']) )59 {60 set_tags(get_tag_ids(implode(',', $video['tags'])), $image_id);61 }62 63 single_update(64 IMAGES_TABLE,65 $updates,66 array('id' => $image_id),67 true68 );69 70 // register video71 31 if ($_POST['size_common'] == 'true') 72 32 { … … 82 42 $_POST['autoplay'] = ''; 83 43 } 44 $_POST['add_film_frame'] = isset($_POST['add_film_frame']); 84 45 85 $insert = array( 86 'picture_id' => $image_id, 87 'url' => $video['url'], 88 'type' => $video['type'], 89 'video_id' => $video['video_id'], 90 'width' => $_POST['width'], 91 'height' => $_POST['height'], 92 'autoplay' => $_POST['autoplay'], 93 ); 94 95 single_insert( 96 GVIDEO_TABLE, 97 $insert 98 ); 99 46 47 $image_id = add_video($video, $_POST); 48 49 100 50 $query = ' 101 51 SELECT id, name, permalink … … 137 87 get_ini_size('post_max_filesize', false); 138 88 89 if (!isset($_POST['safe_mode'])) 90 { 91 $_POST['safe_mode'] = !test_remote_download(); 92 } 93 139 94 // template 140 95 $template->assign(array( -
extensions/gvideo/admin/photo.php
r19213 r20804 100 100 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext; 101 101 $thumb_source = $conf['data_location'].$thumb_name; 102 if ( empty($video['thumbnail']) or download_remote_file($video['thumbnail'], $thumb_source) !== true )102 if ( empty($video['thumbnail']) or gvideo_download_remote_file($video['thumbnail'], $thumb_source) !== true ) 103 103 { 104 104 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; -
extensions/gvideo/admin/template/add.tpl
r19331 r20804 43 43 <li> 44 44 <span class="property">{'Thumbnail'|@translate}</span> 45 <label><input type="checkbox" name="add_film_frame" value="true" > {'Add film effect'|@translate} </label>45 <label><input type="checkbox" name="add_film_frame" value="true" {if $POST.add_film_frame}checked="checked"{/if}> {'Add film effect'|@translate} </label> 46 46 <a class="showInfo" title="<img src='{$GVIDEO_PATH}admin/template/example-frame.jpg'>">i</a> 47 47 </li> -
extensions/gvideo/include/functions.inc.php
r19213 r20804 26 26 case 'youtube': 27 27 { 28 $video['type'] = 'youtube';29 30 28 parse_str($url['query'], $url['query']); 31 29 if (empty($url['query']['v'])) return false; … … 36 34 case 'youtu': // youtu.be (short-url service) 37 35 { 36 $video['type'] = 'youtube'; 37 38 38 if (empty($video['video_id'])) 39 39 { 40 $video['type'] = 'youtube';41 42 40 $url['path'] = explode('/', $url['path']); 43 41 $video['video_id'] = $url['path'][1]; … … 48 46 if (!$safe_mode) 49 47 { 50 $api_url = 'http://gdata.youtube.com/feeds/api/videos/'.$video['video_id'].'?v=2&alt=json'; 51 $json = download_remote_file($api_url, true); 52 if ($json === false or $json == 'file_error') return false; 48 $fields = 'entry(id,author,media:group(media:title(text()),media:description(text()),media:thumbnail(@url),media:keywords))'; 49 $api_url = 'http://gdata.youtube.com/feeds/api/videos/'.$video['video_id'].'?v=2&alt=json&fields='.$fields; 50 $json = gvideo_download_remote_file($api_url, true); 51 52 if ($json===false || $json=='file_error') return false; 53 53 54 54 $json = json_decode($json, true); 55 55 $video = array_merge($video, array( 56 'title' => $json['entry'][' title']['$t'],56 'title' => $json['entry']['media$group']['media$title']['$t'], 57 57 'description' => $json['entry']['media$group']['media$description']['$t'], 58 'thumbnail' => $json['entry']['media$group']['media$thumbnail'][ 2]['url'],58 'thumbnail' => $json['entry']['media$group']['media$thumbnail'][0]['url'], 59 59 'author' => $json['entry']['author'][0]['name']['$t'], 60 60 )); 61 if (!empty($json['entry']['media$group']['media$keywords']['$t'])) 62 { 63 $video['tags'] = $json['entry']['media$group']['media$keywords']['$t']; 64 } 61 65 } 62 66 else … … 80 84 if (!$safe_mode) 81 85 { 82 $api_url = 'http://vimeo.com/api/v2/video/'.$video['video_id'].'.json'; 83 $json = download_remote_file($api_url, true); 84 if ($json === false or $json == 'file_error') return false; 85 86 $json = json_decode($json, true); 87 $video = array_merge($video, array( 88 'title' => $json[0]['title'], 89 'description' => $json[0]['description'], 90 'thumbnail' => $json[0]['thumbnail_large'], 91 'author' => $json[0]['user_name'], 92 'tags' => array_map('trim', explode(',', $json[0]['tags'])), 93 )); 86 // simple API for public videos 87 $api_url_1 = 'http://vimeo.com/api/v2/video/'.$video['video_id'].'.json'; 88 $json = gvideo_download_remote_file($api_url_1, true); 89 90 if ($json!==false && $json!='file_error' && trim($json)!=$video['video_id'].' not found.') 91 { 92 $json = json_decode($json, true); 93 $video = array_merge($video, array( 94 'title' => $json[0]['title'], 95 'description' => $json[0]['description'], 96 'thumbnail' => $json[0]['thumbnail_large'], 97 'author' => $json[0]['user_name'], 98 'tags' => $json[0]['tags'], 99 )); 100 } 101 else 102 { 103 // oEmbed API, for private videos, doesn't return keywords 104 $api_url_2 = 'http://vimeo.com/api/oembed.json?url='.rawurlencode($video['url']); 105 $json = gvideo_download_remote_file($api_url_2, true); 106 107 if ($json===false || $json=='file_error') return false; 108 109 $json = json_decode($json, true); 110 $video = array_merge($video, array( 111 'title' => $json['title'], 112 'description' => $json['description'], 113 'thumbnail' => $json['thumbnail_url'], 114 'author' => $json['author_name'], 115 )); 116 } 94 117 } 95 118 else … … 115 138 { 116 139 $api_url = 'https://api.dailymotion.com/video/'.$video['video_id'].'?fields=description,thumbnail_large_url,title,owner.username,tags'; // DM doesn't accept non secure connection 117 $json = download_remote_file($api_url, true); 118 if ($json === false or $json == 'file_error') return false; 140 $json = gvideo_download_remote_file($api_url, true); 141 142 if ($json===false || $json=='file_error') return false; 119 143 120 144 $json = json_decode($json, true); … … 126 150 'thumbnail' => $json['thumbnail_large_url'], 127 151 'author' => $json['owner.username'], 128 'tags' => $json['tags'],152 'tags' => implode(',', $json['tags']), 129 153 )); 130 154 } … … 143 167 144 168 // no safe_mode for wat.tv 145 $html = download_remote_file($source_url, true); 146 if ($html === false or $html == 'file_error') return false; 169 $html = gvideo_download_remote_file($source_url, true); 170 171 if ($html===false || $html=='file_error') return false; 147 172 148 173 preg_match('#<meta property="og:video" content="http://www.wat.tv/swf2/([^"/>]+)" />#', $html, $matches); … … 164 189 165 190 preg_match_all('#<meta property="video:tag" content="([^">]+)" />#', $html, $matches); 166 $video['tags'] = $matches[1];191 $video['tags'] = implode(',', $matches[1]); 167 192 break; 168 193 } … … 180 205 if (!$safe_mode) 181 206 { 182 $html = download_remote_file($source_url, true); 183 if ($html === false or $html == 'file_error') return false; 207 $html = gvideo_download_remote_file($source_url, true); 208 209 if ($html===false || $html=='file_error') return false; 184 210 185 211 preg_match('#<meta property="og:title" content="([^">]*)" />#', $html, $matches); … … 196 222 197 223 preg_match('#<meta name="keywords" content="([^">]+)" />#', $html, $matches); 198 $video['tags'] = array_map('trim', explode(',', $matches[1]));224 $video['tags'] = $matches[1]; 199 225 } 200 226 else … … 211 237 212 238 return $video; 239 } 240 241 /** 242 * @params: 243 * $video (from parse_video_url) 244 * $config : 245 * - category, integer 246 * - add_film_frame, boolean 247 * - sync_description, boolean 248 * - sync_tags, boolean 249 * - with, integer 250 * - height, integer 251 * - autoplay, integer (0-1) 252 */ 253 function add_video($video, $config) 254 { 255 global $page, $conf; 256 257 $query = ' 258 SELECT picture_id 259 FROM '.GVIDEO_TABLE.' 260 WHERE type = "'.$video['type'].'" 261 AND video_id = "'.$video['video_id'].'" 262 ;'; 263 $result = pwg_query($query); 264 265 if (pwg_db_num_rows($result)) 266 { 267 $page['warnings'][] = l10n('This video was already registered'); 268 list($image_id) = pwg_db_fetch_row($result); 269 return $image_id; 270 } 271 272 include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php'); 273 274 // download thumbnail 275 $thumb_ext = empty($video['thumbnail']) ? 'jpg' : get_extension($video['thumbnail']); 276 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext; 277 $thumb_source = $conf['data_location'].$thumb_name; 278 if ( empty($video['thumbnail']) or gvideo_download_remote_file($video['thumbnail'], $thumb_source) !== true ) 279 { 280 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; 281 copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source); 282 } 283 284 if ($config['add_film_frame']) 285 { 286 add_film_frame($thumb_source); 287 } 288 289 // add image and update infos 290 $image_id = add_uploaded_file($thumb_source, $thumb_name, array($config['category'])); 291 292 $updates = array( 293 'name' => pwg_db_real_escape_string($video['title']), 294 'author' => pwg_db_real_escape_string($video['author']), 295 'is_gvideo' => 1, 296 ); 297 298 if ( $config['sync_description'] and !empty($video['description']) ) 299 { 300 $updates['comment'] = pwg_db_real_escape_string($video['description']); 301 } 302 303 if ( $config['sync_tags'] and !empty($video['tags']) ) 304 { 305 $tags = pwg_db_real_escape_string($video['tags']); 306 set_tags(get_tag_ids($tags), $image_id); 307 } 308 309 single_update( 310 IMAGES_TABLE, 311 $updates, 312 array('id' => $image_id), 313 true 314 ); 315 316 // register video 317 if ( !preg_match('#^([0-9]*)$#', $config['width']) or !preg_match('#^([0-9]*)$#', $config['height']) ) 318 { 319 $config['width'] = $config['height'] = ''; 320 } 321 if ( $config['autoplay']!='0' and $config['autoplay']!='1' ) 322 { 323 $config['autoplay'] = ''; 324 } 325 326 $insert = array( 327 'picture_id' => $image_id, 328 'url' => $video['url'], 329 'type' => $video['type'], 330 'video_id' => $video['video_id'], 331 'width' => $config['width'], 332 'height' => $config['height'], 333 'autoplay' => $config['autoplay'], 334 ); 335 336 single_insert( 337 GVIDEO_TABLE, 338 $insert 339 ); 340 341 return $image_id; 213 342 } 214 343 … … 233 362 * @param: mixed destination file (if true, file content is returned) 234 363 */ 235 if (!function_exists('download_remote_file'))364 function gvideo_download_remote_file($src, $dest, $headers=array()) 236 365 { 237 function download_remote_file($src, $dest) 238 { 239 if (empty($src)) 366 if (empty($src)) 367 { 368 return false; 369 } 370 371 $return = ($dest === true) ? true : false; 372 373 array_push($headers, 'Accept-language: en'); 374 375 /* curl */ 376 if (function_exists('curl_init')) 377 { 378 if (!$return) 379 { 380 $newf = fopen($dest, "wb"); 381 } 382 $ch = curl_init(); 383 384 curl_setopt($ch, CURLOPT_URL, $src); 385 curl_setopt($ch, CURLOPT_HEADER, false); 386 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 387 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'); 388 curl_setopt($ch, CURLOPT_TIMEOUT, 30); 389 if (!ini_get('safe_mode')) 390 { 391 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 392 curl_setopt($ch, CURLOPT_MAXREDIRS, 1); 393 } 394 if (strpos($src, 'https://') !== false) 395 { 396 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 397 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 398 } 399 if (!$return) 400 { 401 curl_setopt($ch, CURLOPT_FILE, $newf); 402 } 403 else 404 { 405 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 406 } 407 408 $out = curl_exec($ch); 409 curl_close($ch); 410 411 if ($out === false) 412 { 413 return 'file_error'; 414 } 415 else if (!$return) 416 { 417 fclose($newf); 418 return true; 419 } 420 else 421 { 422 return $out; 423 } 424 } 425 /* file get content */ 426 else if (ini_get('allow_url_fopen')) 427 { 428 if (strpos($src, 'https://') !== false and !extension_loaded('openssl')) 240 429 { 241 430 return false; 242 431 } 243 432 244 $return = ($dest === true) ? true : false; 245 246 /* curl */ 247 if (function_exists('curl_init')) 248 { 249 if (!$return) 250 { 251 $newf = fopen($dest, "wb"); 252 } 253 $ch = curl_init(); 254 255 curl_setopt($ch, CURLOPT_URL, $src); 256 curl_setopt($ch, CURLOPT_HEADER, false); 257 curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-language: en")); 258 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'); 259 if (!ini_get('safe_mode')) 260 { 261 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 262 curl_setopt($ch, CURLOPT_MAXREDIRS, 1); 263 } 264 if (strpos($src, 'https://') !== false) 265 { 266 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 267 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 268 } 269 if (!$return) 270 { 271 curl_setopt($ch, CURLOPT_FILE, $newf); 272 } 273 else 274 { 275 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 276 } 277 278 $out = curl_exec($ch); 279 curl_close($ch); 280 281 if ($out === false) 282 { 283 return 'file_error'; 284 } 285 else if (!$return) 286 { 287 fclose($newf); 288 return true; 289 } 290 else 291 { 292 return $out; 293 } 294 } 295 /* file get content */ 296 else if (ini_get('allow_url_fopen')) 297 { 298 if (strpos($src, 'https://') !== false and !extension_loaded('openssl')) 299 { 300 return false; 301 } 302 303 $opts = array( 304 'http' => array( 305 'method' => "GET", 306 'user_agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', 307 'header' => "Accept-language: en", 308 ) 309 ); 310 311 $context = stream_context_create($opts); 312 313 if (($file = file_get_contents($src, false, $context)) === false) 314 { 315 return 'file_error'; 316 } 317 318 if (!$return) 319 { 320 file_put_contents($dest, $file); 321 return true; 322 } 323 else 324 { 325 return $file; 326 } 327 } 328 329 return false; 330 } 433 $opts = array( 434 'http' => array( 435 'method' => "GET", 436 'user_agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', 437 'header' => implode("\r\n", $headers), 438 ) 439 ); 440 441 $context = stream_context_create($opts); 442 443 if (($file = file_get_contents($src, false, $context)) === false) 444 { 445 return 'file_error'; 446 } 447 448 if (!$return) 449 { 450 file_put_contents($dest, $file); 451 return true; 452 } 453 else 454 { 455 return $file; 456 } 457 } 458 459 return false; 331 460 } 332 461 -
extensions/gvideo/include/gvideo.inc.php
r19056 r20804 13 13 14 14 // remove autosize 15 global $pwg_loaded_plugins, $autosize_c ontroler;15 global $pwg_loaded_plugins, $autosize_ctrl; 16 16 17 if ( isset($pwg_loaded_plugins['Autosize']) and isset($autosize_c ontroler) )17 if ( isset($pwg_loaded_plugins['Autosize']) and isset($autosize_ctrl) ) 18 18 { 19 remove_event_handler('render_element_content', array(&$autosize_controler, 'init'), EVENT_HANDLER_PRIORITY_NEUTRAL); 20 remove_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'), 40); 21 remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'), EVENT_HANDLER_PRIORITY_NEUTRAL); 22 remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_2'), EVENT_HANDLER_PRIORITY_NEUTRAL); 23 remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL); 24 remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21); 19 remove_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'), EVENT_HANDLER_PRIORITY_NEUTRAL-11, 2); 20 remove_event_handler('render_element_content', array(&$autosize_ctrl, 'init_1'), EVENT_HANDLER_PRIORITY_NEUTRAL-9, 2); 21 remove_event_handler('render_element_content', array(&$autosize_ctrl, 'init'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2); 22 remove_event_handler('render_element_content', array(&$autosize_ctrl, 'init2'), EVENT_HANDLER_PRIORITY_NEUTRAL+1, 2); 23 remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_1')); 24 remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_2')); 25 remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_3')); 26 remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21); 25 27 } 26 28 } … … 46 48 } 47 49 50 // remove some actions 51 $template->assign('U_SLIDESHOW_START', null); 52 $template->assign('U_METADATA', null); 53 $template->append('current', array('U_DOWNLOAD' => null), true); 48 54 49 55 $query = ' … … 88 94 } 89 95 90 $template->set_filename('gvideo_content', dirname(__FILE__).'/../template/video_'.$video['type'].'.tpl');96 $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'template/video_'.$video['type'].'.tpl')); 91 97 return $template->parse('gvideo_content', true); 92 98 } -
extensions/gvideo/include/install.inc.php
r19213 r20804 5 5 6 6 // defined here only because it's more convenient 7 define('gvideo_path', PHPWG_PLUGINS_PATH . 'gvideo/');7 define('gvideo_path', PHPWG_PLUGINS_PATH . GVIDEO_ID . '/'); 8 8 define('gvideo_table', $prefixeTable.'image_video'); 9 9 … … 93 93 } 94 94 95 // remove old configuration and upgrade video files95 // remove old configuration 96 96 if (isset($conf['PY_GVideo'])) 97 97 { 98 98 pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "PY_GVideo" LIMIT 1;'); 99 99 unset($conf['PY_GVideo']); 100 101 gvideo_update_24(); 102 } 100 } 101 102 // updade video files 103 gvideo_update_24(); 103 104 } 104 105 … … 216 217 // update path and rename the file 217 218 $img['new_path'] = $real_path.$thumb_name; 218 rename($img['path'], $img['new_path']); 219 rename($img['path'], $img['new_path']); // why ? what's the purpose of this line ? 219 220 array_push($images_updates, array( 220 221 'id' => $img['id'], … … 257 258 ); 258 259 } 260 261 ?> -
extensions/gvideo/main.inc.php
r19056 r20804 3 3 Plugin Name: Embedded Videos 4 4 Version: auto 5 Description: Add videos from Dailymotion, Youtube, Vimeo, Wideo , videobband Wat.5 Description: Add videos from Dailymotion, Youtube, Vimeo, Wideo and Wat. 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=136 7 7 Author: Mistic & P@t … … 13 13 global $prefixeTable; 14 14 15 define('GVIDEO_PATH', PHPWG_PLUGINS_PATH . 'gvideo/'); 16 define('GVIDEO_ADMIN', get_root_url() . 'admin.php?page=plugin-gvideo'); 15 defined('GVIDEO_ID') or define('GVIDEO_ID', basename(dirname(__FILE__))); 16 define('GVIDEO_PATH', PHPWG_PLUGINS_PATH . GVIDEO_ID . '/'); 17 define('GVIDEO_ADMIN', get_root_url() . 'admin.php?page=plugin-' . GVIDEO_ID); 17 18 define('GVIDEO_TABLE', $prefixeTable.'image_video'); 18 19 define('GVIDEO_VERSION', 'auto'); … … 42 43 if ( 43 44 GVIDEO_VERSION == 'auto' or 44 $pwg_loaded_plugins[ 'gvideo']['version'] == 'auto' or45 version_compare($pwg_loaded_plugins[ 'gvideo']['version'], GVIDEO_VERSION, '<')45 $pwg_loaded_plugins[GVIDEO_ID]['version'] == 'auto' or 46 version_compare($pwg_loaded_plugins[GVIDEO_ID]['version'], GVIDEO_VERSION, '<') 46 47 ) 47 48 { … … 49 50 gvideo_install(); 50 51 51 if ( $pwg_loaded_plugins[ 'gvideo']['version'] != 'auto' and GVIDEO_VERSION !='auto' )52 if ( $pwg_loaded_plugins[GVIDEO_ID]['version'] != 'auto' and GVIDEO_VERSION !='auto' ) 52 53 { 53 54 $query = ' 54 55 UPDATE '. PLUGINS_TABLE .' 55 56 SET version = "'. GVIDEO_VERSION .'" 56 WHERE id = " gvideo"';57 WHERE id = "'. GVIDEO_ID .'"'; 57 58 pwg_query($query); 58 59 59 $pwg_loaded_plugins[ 'gvideo']['version'] = GVIDEO_VERSION;60 $pwg_loaded_plugins[GVIDEO_ID]['version'] = GVIDEO_VERSION; 60 61 61 62 if (defined('IN_ADMIN')) -
extensions/gvideo/maintain.inc.php
r17661 r20804 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 include_once(PHPWG_PLUGINS_PATH . 'gvideo/include/install.inc.php'); 4 defined('GVIDEO_ID') or define('GVIDEO_ID', basename(dirname(__FILE__))); 5 include_once(PHPWG_PLUGINS_PATH . GVIDEO_ID . '/include/install.inc.php'); 6 5 7 6 8 /* install */
Note: See TracChangeset
for help on using the changeset viewer.