Changeset 28268 for extensions/gvideo
- Timestamp:
- Apr 27, 2014, 1:30:00 AM (10 years ago)
- Location:
- extensions/gvideo
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/add.php
r26470 r28268 9 9 { 10 10 $_POST['url'] = trim($_POST['url']); 11 // check inputs 12 if (empty($_POST['url'])) 11 $_POST['add_film_frame'] = isset($_POST['add_film_frame']); 12 13 if ($_POST['mode'] == 'provider') 13 14 { 14 $page['errors'][] = l10n('Please fill the video URL'); 15 // check inputs 16 if (empty($_POST['url'])) 17 { 18 $page['errors'][] = l10n('Please fill the video URL'); 19 } 20 else if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false ) 21 { 22 if (isset($_POST['safe_mode'])) 23 { 24 $page['errors'][] = l10n('an error happened'); 25 } 26 else 27 { 28 $page['errors'][] = l10n('Unable to contact host server'); 29 $page['errors'][] = l10n('Try in safe-mode'); 30 } 31 $_POST['safe_mode'] = true; 32 } 33 34 if (count($page['errors']) == 0) 35 { 36 if ($_POST['size_common'] == 'true') 37 { 38 $_POST['width'] = $_POST['height'] = ''; 39 } 40 else if (!preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height'])) 41 { 42 $page['errors'][] = l10n('Width and height must be integers'); 43 $_POST['width'] = $_POST['height'] = ''; 44 } 45 if ($_POST['autoplay_common'] == 'true') 46 { 47 $_POST['autoplay'] = ''; 48 } 49 50 $image_id = add_video($video, $_POST); 51 } 15 52 } 16 else if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )53 else 17 54 { 18 if (isset($_POST['safe_mode'])) 55 $_POST['embed_code'] = trim($_POST['embed_code']); 56 57 if (empty($_POST['embed_code'])) 19 58 { 20 $page['errors'][] = l10n(' an error happened');59 $page['errors'][] = l10n('Please fill the embed code'); 21 60 } 22 61 else 23 62 { 24 $page['errors'][] = l10n('Unable to contact host server'); 25 $page['errors'][] = l10n('Try in safe-mode'); 63 $image_id = add_video_embed($_POST); 26 64 } 27 $_POST['safe_mode'] = true;28 65 } 29 30 if ( count($page['errors']) == 0)66 67 if (isset($image_id)) 31 68 { 32 if ($_POST['size_common'] == 'true')33 {34 $_POST['width'] = $_POST['height'] = '';35 }36 else if (!preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']))37 {38 $page['errors'][] = l10n('Width and height must be integers');39 $_POST['width'] = $_POST['height'] = '';40 }41 if ($_POST['autoplay_common'] == 'true')42 {43 $_POST['autoplay'] = '';44 }45 $_POST['add_film_frame'] = isset($_POST['add_film_frame']);46 47 48 $image_id = add_video($video, $_POST);49 50 51 69 $query = ' 52 70 SELECT id, name, permalink -
extensions/gvideo/admin/photo.php
r26470 r28268 45 45 if (isset($_POST['save_properties'])) 46 46 { 47 // check inputs 48 if (empty($_POST['url'])) 49 { 50 $page['errors'][] = l10n('Please fill the video URL'); 51 } 52 else if ($gvideo['url']!=$_POST['url']) 53 { 54 if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false ) 55 { 56 if (isset($_POST['safe_mode'])) 57 { 58 $page['errors'][] = l10n('an error happened'); 59 } 60 else 61 { 62 $page['errors'][] = l10n('Unable to contact host server'); 63 $page['errors'][] = l10n('Try in safe-mode'); 64 } 65 } 66 } 67 else 68 { 69 $video = $gvideo; 70 } 71 72 if (count($page['errors']) == 0) 73 { 74 75 if ( $gvideo['url'] != $video['url'] ) 76 { 77 // download thumbnail 78 $thumb_ext = empty($video['thumbnail']) ? 'jpg' : get_extension($video['thumbnail']); 79 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext; 80 $thumb_source = $conf['data_location'].$thumb_name; 47 $_POST['url'] = trim($_POST['url']); 48 49 if ($gvideo['type'] != 'embed') 50 { 51 // check inputs 52 if (empty($_POST['url'])) 53 { 54 $page['errors'][] = l10n('Please fill the video URL'); 55 } 56 else if ($gvideo['url']!=$_POST['url']) 57 { 58 if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false ) 59 { 60 if (isset($_POST['safe_mode'])) 61 { 62 $page['errors'][] = l10n('an error happened'); 63 } 64 else 65 { 66 $page['errors'][] = l10n('Unable to contact host server'); 67 $page['errors'][] = l10n('Try in safe-mode'); 68 } 69 } 70 } 71 else 72 { 73 $video = $gvideo; 74 } 75 76 if (count($page['errors']) == 0) 77 { 78 79 if ($gvideo['url'] != $video['url']) 80 { 81 // download thumbnail 82 $thumb_ext = empty($video['thumbnail']) ? 'jpg' : get_extension($video['thumbnail']); 83 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext; 84 $thumb_source = $conf['data_location'].$thumb_name; 85 86 if (empty($video['thumbnail']) or gvideo_download_remote_file($video['thumbnail'], $thumb_source) !== true) 87 { 88 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; 89 copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source); 90 } 91 92 // add image and update infos 93 $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $_GET['image_id']); 94 95 $updates = array( 96 'name' => pwg_db_real_escape_string($video['title']), 97 'author' => pwg_db_real_escape_string($video['author']), 98 'is_gvideo' => 1, 99 ); 100 101 if ($_POST['sync_description'] and !empty($video['description'])) 102 { 103 $updates['comment'] = pwg_db_real_escape_string($video['description']); 104 } 105 else 106 { 107 $updates['comment'] = null; 108 } 109 if ($_POST['sync_tags'] and !empty($video['tags'])) 110 { 111 set_tags(get_tag_ids(implode(',', $video['tags'])), $image_id); 112 } 113 114 single_update( 115 IMAGES_TABLE, 116 $updates, 117 array('id' => $_GET['image_id']), 118 true 119 ); 120 } 81 121 82 if (empty($video['thumbnail']) or gvideo_download_remote_file($video['thumbnail'], $thumb_source) !== true) 83 { 84 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; 85 copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source); 86 } 87 88 // add image and update infos 89 $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $_GET['image_id']); 122 // register video 123 if ($_POST['size_common'] == 'true') 124 { 125 $_POST['width'] = $_POST['height'] = ''; 126 } 127 else if (!preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height'])) 128 { 129 $page['errors'][] = l10n('Width and height must be integers'); 130 $_POST['width'] = $_POST['height'] = ''; 131 } 132 if ($_POST['autoplay_common'] == 'true') 133 { 134 $_POST['autoplay'] = ''; 135 } 90 136 91 137 $updates = array( 92 'name' => pwg_db_real_escape_string($video['title']), 93 'author' => pwg_db_real_escape_string($video['author']), 94 'is_gvideo' => 1, 138 'url' => $video['url'], 139 'type' => $video['type'], 140 'video_id' => $video['video_id'], 141 'width' => $_POST['width'], 142 'height' => $_POST['height'], 143 'autoplay' => $_POST['autoplay'], 95 144 ); 96 97 if ($_POST['sync_description'] and !empty($video['description'])) 98 { 99 $updates['comment'] = pwg_db_real_escape_string($video['description']); 100 } 101 else 102 { 103 $updates['comment'] = null; 104 } 105 if ($_POST['sync_tags'] and !empty($video['tags'])) 106 { 107 set_tags(get_tag_ids(implode(',', $video['tags'])), $image_id); 108 } 109 110 single_update( 111 IMAGES_TABLE, 112 $updates, 113 array('id' => $_GET['image_id']), 114 true 145 } 146 } 147 else 148 { 149 $_POST['embed_code'] = trim($_POST['embed_code']); 150 151 if (empty($_POST['embed_code'])) 152 { 153 $page['errors'][] = l10n('Please fill the embed code'); 154 } 155 else 156 { 157 $updates = array( 158 'url' => $_POST['url'], 159 'embed' => stripslashes($_POST['embed_code']), 115 160 ); 116 161 } 117 118 // register video 119 if ($_POST['size_common'] == 'true') 120 { 121 $_POST['width'] = $_POST['height'] = ''; 122 } 123 else if (!preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height'])) 124 { 125 $page['errors'][] = l10n('Width and height must be integers'); 126 $_POST['width'] = $_POST['height'] = ''; 127 } 128 if ($_POST['autoplay_common'] == 'true') 129 { 130 $_POST['autoplay'] = ''; 131 } 132 133 $updates = array( 134 'url' => $video['url'], 135 'type' => $video['type'], 136 'video_id' => $video['video_id'], 137 'width' => $_POST['width'], 138 'height' => $_POST['height'], 139 'autoplay' => $_POST['autoplay'], 140 ); 141 162 } 163 164 if (isset($updates)) 165 { 142 166 single_update( 143 167 GVIDEO_TABLE, -
extensions/gvideo/admin/template/add.tpl
r26470 r28268 17 17 $(".providersInfo").toggle(); 18 18 }); 19 jQuery(".radio input").on('change', function() { 20 if (jQuery(this).is(':checked')) { 21 var mode = jQuery(this).val(); 22 23 jQuery('.'+mode+'-hide').hide(); 24 jQuery('.'+mode+'-show').show(); 25 } 26 }).trigger('change'); 19 27 {/footer_script} 20 28 … … 24 32 </div> 25 33 26 <form method="post" action="" class="properties"> 34 <form method="post" action="" class="properties" enctype="multipart/form-data"> 35 <div class="radio"> 36 <input type="radio" name="mode" value="provider" id="mode_provider" {if $POST.mode!="embed"}checked{/if}><label for="mode_provider">{'Add video from hosting platform'|translate}</label><!-- 37 --><input type="radio" name="mode" value="embed" id="mode_embed" {if $POST.mode=="embed"}checked{/if}><label for="mode_embed">{'Add video from embed code'|translate}</label> 38 </div> 39 40 <div class="warnings custom-warn embed-show provider-hide"> 41 <ul><li>{'Do not use this form for videos provided by Youtube, Dailymotion, Vimeo, Wat or Wideo.'|translate}</li></ul> 42 </div> 43 27 44 <fieldset> 28 45 <legend>{'Properties'|translate}</legend> … … 38 55 {'... or '|translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a> 39 56 </li> 57 <li class="embed-show provider-hide"> 58 <label> 59 <span class="property">{'Title'|translate}</span> 60 <input type="text"name="title" value="{$POST.title}" style="width:400px;"> 61 </label> 62 </li> 40 63 <li> 41 64 <label> 42 <span class="property">{'Video URL'|translate} </span>65 <span class="property">{'Video URL'|translate} <small class="embed-show provider-hide">({'optional'|translate})</small></span> 43 66 <input type="text" name="url" value="{$POST.url}" style="width:400px;"> 44 67 </label> 45 68 </li> 46 {if $gd_available} 47 <li> 48 <span class="property">{'Thumbnail'|translate}</span> 69 <li class="embed-show provider-hide"> 70 <label> 71 <span class="property">{'Embed code'|translate}</span> 72 <textarea name="embed_code" style="width:400px;height:80px;">{$POST.embed_code}</textarea> 73 </label> 74 </li> 75 <li class="embed-show {if $gd_available}provider-show{else}provider-hide{/if}"> 76 <span class="property">{'Thumbnail'|translate} <small class="embed-show provider-hide">({'optional'|translate})</small></span> 77 <input type="file" size="20" name="thumbnail_file" class="embed-show provider-hide"> 78 {if $gd_available} 49 79 <label><input type="checkbox" name="add_film_frame" value="true" {if $POST.add_film_frame}checked="checked"{/if}> {'Add film effect'|translate} </label> 50 80 <a class="icon-info-circled-1 showInfo" title="<img src='{$GVIDEO_PATH}admin/template/example-frame.jpg'>"></a> 81 {/if} 51 82 </li> 52 {/if}53 83 </ul> 54 84 </fieldset> 55 85 56 <fieldset >86 <fieldset class="embed-hide provider-show"> 57 87 <legend>{'Configuration'|translate}</legend> 58 88 … … 94 124 <p style="text-align:left;"> 95 125 <input type="submit" name="add_video" value="{'Add'|translate}"> 96 <label style="font-weight:bold;"><input type="checkbox" name="safe_mode" {if $POST.safe_mode}checked="checked"{/if}> {'Safe-mode'|translate}</label> 97 <a class="icon-info-circled-1 showInfo" title="{'In safe-mode, the plugin does\'t try to contact the video host, usefull on some websites where remote connections are blocked.'|translate|escape:html}"></a> 126 127 <span class="embed-hide provider-show"> 128 <label style="font-weight:bold;"><input type="checkbox" name="safe_mode" {if $POST.safe_mode}checked="checked"{/if}> {'Safe-mode'|translate}</label> 129 <a class="icon-info-circled-1 showInfo" title="{'In safe-mode, the plugin does\'t try to contact the video host, usefull on some websites where remote connections are blocked.'|translate|escape:html}"></a> 130 </span> 98 131 </p> 99 132 100 <fieldset style="margin-top:40px;" >133 <fieldset style="margin-top:40px;" class="embed-hide provider-show"> 101 134 <legend>{'Supported services'|translate}</legend> 102 135 -
extensions/gvideo/admin/template/photo.tpl
r26470 r28268 1 1 {combine_css path=$GVIDEO_PATH|cat:'admin/template/style.css'} 2 2 3 {if $GVIDEO.type != 'embed'} 3 4 {footer_script} 4 5 jQuery("input[data-toggle]").change(function() { … … 24 25 }); 25 26 {/footer_script} 27 {/if} 26 28 27 29 … … 64 66 </p> 65 67 68 {if $GVIDEO.type != 'embed'} 66 69 <p class="video_update"> 67 70 <b>{'Get video description'|translate}</b> … … 97 100 </span> 98 101 </p> 99 102 {else} 103 <p> 104 <b>{'Embed code'|translate}</b><br> 105 <textarea name="embed_code" style="width:400px;height:80px;">{$GVIDEO.embed}</textarea> 106 </p> 107 {/if} 108 100 109 <p style="margin:0;"> 101 <label style="font-weight:bold;"><input type="checkbox" name="safe_mode"> {'Safe-mode'|translate}</label>102 <br> 110 {if $GVIDEO.type != 'embed'}<label style="font-weight:bold;"><input type="checkbox" name="safe_mode"> {'Safe-mode'|translate}</label> 111 <br>{/if} 103 112 <input class="submit" type="submit" value="{'Save Settings'|translate}" name="save_properties"> 104 113 </p> -
extensions/gvideo/admin/template/style.css
r26470 r28268 64 64 font-size:0.9em; 65 65 } 66 67 .radio { 68 margin-left:2em; 69 } 70 .radio input { 71 display:none; 72 } 73 .radio label { 74 display:inline-block; 75 background:#fff; 76 border:1px solid #ddd; 77 border-left-width:0; 78 padding:5px 10px; 79 } 80 .radio label:first-of-type { 81 border-left-width:1px; 82 border-radius:5px 0 0 5px; 83 } 84 .radio label:last-of-type { 85 border-radius:0 5px 5px 0; 86 } 87 .radio input:checked + label { 88 background:#C6FF91; 89 background:linear-gradient(to bottom, #C6FF91, #A5E06D); 90 border-color:#A5E06D; 91 text-shadow:1px 1px 0 white; 92 } 93 94 .custom-warn { 95 background-image:none; 96 padding:2px 5px; 97 margin-left:2em; 98 border-radius:5px; 99 min-height:0; 100 display:inline-block; 101 } 102 .custom-warn ul li { 103 clear:none; 104 list-style:none; 105 margin:0 !important; 106 } -
extensions/gvideo/include/events.inc.php
r26524 r28268 23 23 $template->assign(array( 24 24 'GVIDEO_PATH' => GVIDEO_PATH, 25 'U_GVIDEO_EDIT' => GVIDEO_ADMIN.'-photo&image_id='.$picture['current']['id'],25 'U_GVIDEO_EDIT' => get_root_url().GVIDEO_ADMIN.'-photo&image_id='.$picture['current']['id'], 26 26 )); 27 27 … … 105 105 } 106 106 107 $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'template/video_'.$video['type'].'.tpl')); 108 return $template->parse('gvideo_content', true); 107 if ($video['type'] == 'embed') 108 { 109 return $video['embed']; 110 } 111 else 112 { 113 $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'template/video_'.$video['type'].'.tpl')); 114 return $template->parse('gvideo_content', true); 115 } 109 116 } 110 117 … … 120 127 pwg_query($query); 121 128 } 129 130 /** 131 * add a prefilter to the Batch Downloader 132 */ 133 function gvideo_add_prefilter($prefilters) 134 { 135 $prefilters[] = array( 136 'ID' => 'gvideo', 137 'NAME' => l10n('Videos'), 138 ); 139 140 return $prefilters; 141 } 142 143 /** 144 * perform added prefilter 145 */ 146 function gvideo_apply_prefilter($filter_sets, $prefilter) 147 { 148 if ($prefilter == 'gvideo') 149 { 150 $query = 'SELECT picture_id FROM '.GVIDEO_TABLE.';'; 151 $filter_sets[] = query2array($query, null, 'picture_id'); 152 } 153 154 return $filter_sets; 155 } -
extensions/gvideo/include/functions.inc.php
r26469 r28268 346 346 347 347 /** 348 * @params: 349 * $config : 350 * - url, string 351 * - category, integer 352 * - add_film_frame, boolean 353 * - title, string 354 * - embed_code, string 355 */ 356 function add_video_embed($config) 357 { 358 global $page, $conf; 359 360 $query = ' 361 SELECT picture_id 362 FROM '.GVIDEO_TABLE.' 363 WHERE url = "'.$config['url'].'" 364 ;'; 365 $result = pwg_query($query); 366 367 if (pwg_db_num_rows($result)) 368 { 369 $page['warnings'][] = l10n('This video was already registered'); 370 list($image_id) = pwg_db_fetch_row($result); 371 return $image_id; 372 } 373 374 include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php'); 375 376 // upload thumbnail 377 if (isset($_FILES['thumbnail_file']) && $_FILES['thumbnail_file']['error'] === UPLOAD_ERR_OK) 378 { 379 $source_filepath = $_FILES['thumbnail_file']['tmp_name']; 380 list(,, $type) = getimagesize($source_filepath); 381 382 if (IMAGETYPE_PNG == $type || IMAGETYPE_GIF == $type || IMAGETYPE_JPEG == $type) 383 { 384 $thumb_name = $_FILES['thumbnail_file']['name']; 385 $thumb_source = $conf['data_location'].$thumb_name; 386 move_uploaded_file($source_filepath, $thumb_source); 387 } 388 } 389 390 if (!isset($thumb_source)) 391 { 392 $thumb_name = 'embed-'.uniqid().'.jpg'; 393 $thumb_source = $conf['data_location'].$thumb_name; 394 copy(GVIDEO_PATH.'mimetypes/any.jpg', $thumb_source); 395 } 396 397 if ($config['add_film_frame']) 398 { 399 add_film_frame($thumb_source); 400 } 401 402 // add image and update infos 403 $image_id = add_uploaded_file($thumb_source, $thumb_name, array($config['category'])); 404 405 if (empty($config['title'])) 406 { 407 $config['title'] = get_filename_wo_extension($thumb_name); 408 } 409 410 $updates = array( 411 'name' => pwg_db_real_escape_string($config['title']), 412 'is_gvideo' => 1, 413 ); 414 415 single_update( 416 IMAGES_TABLE, 417 $updates, 418 array('id' => $image_id), 419 true 420 ); 421 422 $insert = array( 423 'picture_id' => $image_id, 424 'url' => $config['url'], 425 'type' => 'embed', 426 'video_id' => 'embed', 427 'width' => '', 428 'height' => '', 429 'autoplay' => '', 430 'embed' => $config['embed_code'] 431 ); 432 var_dump($insert); 433 single_insert( 434 GVIDEO_TABLE, 435 $insert 436 ); 437 438 return $image_id; 439 } 440 441 /** 348 442 * test if a download method is available 349 443 * @return: bool -
extensions/gvideo/language/en_UK/plugin.lang.php
r20821 r28268 35 35 $lang['Videos can be private if you use the private permalink.'] = 'Videos can be private if you use the private permalink.'; 36 36 $lang['No privacy option.'] = 'No privacy option.'; 37 $lang['Add video from embed code'] = 'Add video from embed code'; 38 $lang['Add video from hosting platform'] = 'Add video from hosting platform'; 39 $lang['Embed code'] = 'Embed code'; 40 $lang['optional'] = 'optional'; 41 $lang['Please fill the embed code'] = 'Please fill the embed code'; 42 $lang['This video was already registered'] = 'This video was already registered'; 43 $lang['Videos'] = 'Videos'; 44 $lang['Width and height must be integers'] = 'Width and height must be integers'; 45 $lang['Do not use this form for videos provided by Youtube, Dailymotion, Vimeo, Wat or Wideo.'] = 'Do not use this form for videos provided by Youtube, Dailymotion, Vimeo, Wat or Wideo.'; 37 46 38 47 ?> -
extensions/gvideo/language/fr_FR/plugin.lang.php
r20809 r28268 35 35 $lang['Videos can be private if you use the private permalink.'] = 'Les videos peuvent être privées si vous utilisez le permalink privé.'; 36 36 $lang['No privacy option.'] = 'Pas d\'option de privacité.'; 37 $lang['Add video from embed code'] = 'Ajouter un code d\'intégration'; 38 $lang['Add video from hosting platform'] = 'Ajouter depuis une plateforme d\'hébergement'; 39 $lang['Embed code'] = 'Code d\'intégration'; 40 $lang['optional'] = 'optionel'; 41 $lang['Please fill the embed code'] = 'Veuilles renseigner le code d\'intégration'; 42 $lang['This video was already registered'] = 'Cette vidéo existe déjà'; 43 $lang['Videos'] = 'Vidéos'; 44 $lang['Width and height must be integers'] = 'Hauteur et largeur doivent être des entiers'; 45 $lang['Do not use this form for videos provided by Youtube, Dailymotion, Vimeo, Wat or Wideo.'] = 'N\'utilisez pas ce formulaire pour les vidéos hébergées par Youtube, Dailymotion, Vimeo, Wat or Wideo.'; 37 46 38 47 ?> -
extensions/gvideo/main.inc.php
r26524 r28268 26 26 { 27 27 add_event_handler('get_admin_plugin_menu_links', 'gvideo_admin_menu'); 28 add_event_handler('tabsheet_before_select','gvideo_tab', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); 28 add_event_handler('tabsheet_before_select','gvideo_tab', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); 29 30 add_event_handler('get_batch_manager_prefilters', 'gvideo_add_prefilter'); 31 add_event_handler('perform_batch_manager_prefilters', 'gvideo_apply_prefilter'); 29 32 } 30 33 … … 76 79 if (!pwg_db_num_rows($result)) return $sheets; 77 80 78 global $gvideo; 81 global $gvideo, $page; 82 83 if ($page['tab'] == 'properties') 84 { 85 $page['infos'][] = 'This element is a video added with "Embedded Video"'; 86 } 87 79 88 $gvideo = pwg_db_fetch_assoc($result); 80 89 -
extensions/gvideo/maintain.inc.php
r26470 r28268 72 72 `width` smallint(9) DEFAULT NULL, 73 73 `height` smallint(9) DEFAULT NULL, 74 `autoplay` tinyint(1) DEFAULT NULL 74 `autoplay` tinyint(1) DEFAULT NULL, 75 `embed` text DEFAULT NULL 75 76 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 76 77 ;'; … … 78 79 79 80 // update video_id lenght 80 $query = 'ALTER TABLE `' . $this->table . '` CHANGE `video_id` `video_id` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;'; 81 pwg_query($query); 81 pwg_query('ALTER TABLE `' . $this->table . '` CHANGE `video_id` `video_id` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;'); 82 82 83 83 // new collumn in images table … … 95 95 ;'; 96 96 pwg_query($query); 97 } 98 99 // new column "embed" 100 $result = pwg_query('SHOW COLUMNS FROM `' . $this->table . '` LIKE "embed";'); 101 if (!pwg_db_num_rows($result)) 102 { 103 pwg_query('ALTER TABLE `' . $this->table . '` ADD `embed` text DEFAULT NULL;'); 97 104 } 98 105
Note: See TracChangeset
for help on using the changeset viewer.