Ignore:
Timestamp:
Jan 6, 2014, 4:41:55 PM (10 years ago)
Author:
mistic100
Message:

Update for Piwigo 2.6
TODO: button on Admin Tools bar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/gvideo/admin/add.php

    r20804 r26470  
    11<?php
    2 if (!defined('GVIDEO_PATH')) die('Hacking attempt!');
     2defined('GVIDEO_PATH') or die('Hacking attempt!');
    33
    44include_once(GVIDEO_PATH.'include/functions.inc.php');
    55include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
     6
    67
    78if (isset($_POST['add_video']))
     
    1112  if (empty($_POST['url']))
    1213  {
    13     array_push($page['errors'], l10n('Please fill the video URL'));
     14    $page['errors'][] = l10n('Please fill the video URL');
    1415  }
    1516  else if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )
     
    1718    if (isset($_POST['safe_mode']))
    1819    {
    19       array_push($page['errors'], l10n('an error happened'));
     20      $page['errors'][] = l10n('an error happened');
    2021    }
    2122    else
    2223    {
    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');
    2526    }
    2627    $_POST['safe_mode'] = true;
    2728  }
    28  
     29
    2930  if (count($page['errors']) == 0)
    3031  {
     
    3334      $_POST['width'] = $_POST['height'] = '';
    3435    }
    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']))
    3637    {
    37       array_push($page['errors'], l10n('Width and height must be integers'));
     38      $page['errors'][] = l10n('Width and height must be integers');
    3839      $_POST['width'] = $_POST['height'] = '';
    3940    }
     
    5556    $category = pwg_db_fetch_assoc(pwg_query($query));
    5657     
    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>',
    5960      make_picture_url(array(
    6061        'image_id' => $image_id,
     
    6566          ),
    6667        ))
    67       ));
     68      );
    6869    unset($_POST);
    6970  }
     
    7273// categories
    7374$query = '
    74 SELECT id,name,uppercats,global_rank
     75SELECT id, name, uppercats, global_rank
    7576  FROM '.CATEGORIES_TABLE.'
    7677;';
     
    101102  ));
    102103
    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.