Changeset 19056 for extensions/gvideo/admin/photo.php
- Timestamp:
- Nov 17, 2012, 5:05:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/photo.php
r17687 r19056 70 70 array_push($page['errors'], l10n('Please fill the video URL')); 71 71 } 72 if ( !empty($_POST['url']) and ($video = parse_video_url($_POST['url'])) === false ) 73 { 74 array_push($page['errors'], l10n('Unable to contact host server')); 72 else if ($gvideo['url']!=$_POST['url']) 73 { 74 if( ($video = parse_video_url($_POST['url'])) === false ) 75 { 76 array_push($page['errors'], l10n('Unable to contact host server')); 77 } 78 } 79 else 80 { 81 $video = $gvideo; 75 82 } 76 83 … … 82 89 { 83 90 // download thumbnail 84 $thumb_name = $video['type'].'-'.$video[' id'].'-'.uniqid().'.'.get_extension($video['thumbnail']);91 $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.get_extension($video['thumbnail']); 85 92 $thumb_source = $conf['data_location'].$thumb_name; 86 93 if (download_remote_file($video['thumbnail'], $thumb_source) !== true) … … 95 102 $updates = array( 96 103 'name' => pwg_db_real_escape_string($video['title']), 97 'comment' => pwg_db_real_escape_string($video['description']),98 104 'author' => pwg_db_real_escape_string($video['author']), 99 105 'is_gvideo' => 1, 100 106 ); 107 108 if ( $_POST['sync_description'] and !empty($video['description']) ) 109 { 110 $updates['comment'] = pwg_db_real_escape_string($video['description']); 111 } 112 else 113 { 114 $updates['comment'] = null; 115 } 116 if ( $_POST['sync_tags'] and !empty($video['tags']) ) 117 { 118 set_tags(get_tag_ids(implode(',', $video['tags'])), $image_id); 119 } 101 120 102 121 single_update( … … 126 145 'url' => $video['url'], 127 146 'type' => $video['type'], 128 'video_id' => $video[' id'],147 'video_id' => $video['video_id'], 129 148 'width' => $_POST['width'], 130 149 'height' => $_POST['height'], … … 199 218 $gvideo['autoplay_common'] = 'true'; 200 219 } 220 $gvideo['sync_description'] = $conf['gvideo']['sync_description']; 221 $gvideo['sync_tags'] = $conf['gvideo']['sync_tags']; 201 222 202 223 if (function_exists('imagecreatetruecolor'))
Note: See TracChangeset
for help on using the changeset viewer.