Changeset 19213 for extensions/gvideo/admin
- Timestamp:
- Nov 28, 2012, 12:49:06 PM (11 years ago)
- Location:
- extensions/gvideo/admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/add.php
r19056 r19213 12 12 array_push($page['errors'], l10n('Please fill the video URL')); 13 13 } 14 if ( !empty($_POST['url']) and ($video = parse_video_url($_POST['url'] )) === false )14 if ( !empty($_POST['url']) and ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false ) 15 15 { 16 array_push($page['errors'], l10n('Unable to contact host server')); 16 if (isset($_POST['safe_mode'])) 17 { 18 array_push($page['errors'], l10n('an error happened')); 19 } 20 else 21 { 22 array_push($page['errors'], l10n('Unable to contact host server')); 23 array_push($page['errors'], l10n('Try in safe-mode')); 24 } 25 $_POST['safe_mode'] = true; 17 26 } 18 27 … … 20 29 { 21 30 // download thumbnail 22 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.get_extension($video['thumbnail']); 31 $thumb_ext = empty($video['thumbnail']) ? 'jpg' : get_extension($video['thumbnail']); 32 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext; 23 33 $thumb_source = $conf['data_location'].$thumb_name; 24 if ( download_remote_file($video['thumbnail'], $thumb_source) !== true)34 if ( empty($video['thumbnail']) or download_remote_file($video['thumbnail'], $thumb_source) !== true ) 25 35 { 26 36 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; -
extensions/gvideo/admin/photo.php
r19056 r19213 72 72 else if ($gvideo['url']!=$_POST['url']) 73 73 { 74 if( ($video = parse_video_url($_POST['url'])) === false ) 75 { 76 array_push($page['errors'], l10n('Unable to contact host server')); 74 if( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false ) 75 { 76 if (isset($_POST['safe_mode'])) 77 { 78 array_push($page['errors'], l10n('an error happened')); 79 } 80 else 81 { 82 array_push($page['errors'], l10n('Unable to contact host server')); 83 array_push($page['errors'], l10n('Try in safe-mode')); 84 } 77 85 } 78 86 } … … 89 97 { 90 98 // download thumbnail 91 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.get_extension($video['thumbnail']); 99 $thumb_ext = empty($video['thumbnail']) ? 'jpg' : get_extension($video['thumbnail']); 100 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext; 92 101 $thumb_source = $conf['data_location'].$thumb_name; 93 if ( download_remote_file($video['thumbnail'], $thumb_source) !== true)102 if ( empty($video['thumbnail']) or download_remote_file($video['thumbnail'], $thumb_source) !== true ) 94 103 { 95 104 $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg'; -
extensions/gvideo/admin/template/add.tpl
r19056 r19213 88 88 89 89 90 <p style="text-align:left;"><input type="submit" name="add_video" value="{'Add'|@translate}"></p> 90 <p style="text-align:left;"> 91 <label style="font-weight:bold;"><input type="checkbox" name="safe_mode" {if $POST.safe_mode}checked="checked"{/if}> {'Safe-mode'|@translate}</label> 92 <a class="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}">i</a> 93 <br> 94 <input type="submit" name="add_video" value="{'Add'|@translate}"> 95 </p> 91 96 92 97 <fieldset> -
extensions/gvideo/admin/template/photo.tpl
r19056 r19213 98 98 99 99 <p style="margin:0;"> 100 <label style="font-weight:bold;"><input type="checkbox" name="safe_mode"> {'Safe-mode'|@translate}</label> 101 <br> 100 102 <input class="submit" type="submit" value="{'Save Settings'|@translate}" name="save_properties"> 101 103 </p>
Note: See TracChangeset
for help on using the changeset viewer.