Changeset 26470 for extensions/gvideo/admin/add.php
- Timestamp:
- Jan 6, 2014, 4:41:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/admin/add.php
r20804 r26470 1 1 <?php 2 if (!defined('GVIDEO_PATH'))die('Hacking attempt!');2 defined('GVIDEO_PATH') or die('Hacking attempt!'); 3 3 4 4 include_once(GVIDEO_PATH.'include/functions.inc.php'); 5 5 include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php'); 6 6 7 7 8 if (isset($_POST['add_video'])) … … 11 12 if (empty($_POST['url'])) 12 13 { 13 array_push($page['errors'], l10n('Please fill the video URL'));14 $page['errors'][] = l10n('Please fill the video URL'); 14 15 } 15 16 else if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false ) … … 17 18 if (isset($_POST['safe_mode'])) 18 19 { 19 array_push($page['errors'], l10n('an error happened'));20 $page['errors'][] = l10n('an error happened'); 20 21 } 21 22 else 22 23 { 23 array_push($page['errors'], l10n('Unable to contact host server'));24 array_push($page['errors'], l10n('Try in safe-mode'));24 $page['errors'][] = l10n('Unable to contact host server'); 25 $page['errors'][] = l10n('Try in safe-mode'); 25 26 } 26 27 $_POST['safe_mode'] = true; 27 28 } 28 29 29 30 if (count($page['errors']) == 0) 30 31 { … … 33 34 $_POST['width'] = $_POST['height'] = ''; 34 35 } 35 else if ( !preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']))36 else if (!preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height'])) 36 37 { 37 array_push($page['errors'], l10n('Width and height must be integers'));38 $page['errors'][] = l10n('Width and height must be integers'); 38 39 $_POST['width'] = $_POST['height'] = ''; 39 40 } … … 55 56 $category = pwg_db_fetch_assoc(pwg_query($query)); 56 57 57 array_push($page['infos'], sprintf(58 l10n('Video successfully added. <a href="%s">View</a>'),58 $page['infos'][] = l10n( 59 'Video successfully added. <a href="%s">View</a>', 59 60 make_picture_url(array( 60 61 'image_id' => $image_id, … … 65 66 ), 66 67 )) 67 ) );68 ); 68 69 unset($_POST); 69 70 } … … 72 73 // categories 73 74 $query = ' 74 SELECT id, name,uppercats,global_rank75 SELECT id, name, uppercats, global_rank 75 76 FROM '.CATEGORIES_TABLE.' 76 77 ;'; … … 101 102 )); 102 103 103 $template->set_filename('gvideo_content', dirname(__FILE__) . '/template/add.tpl'); 104 105 ?> 104 $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'admin/template/add.tpl'));
Note: See TracChangeset
for help on using the changeset viewer.