Changeset 28268 for extensions/gvideo/admin/add.php
- Timestamp:
- Apr 27, 2014, 1:30:00 AM (11 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.