Ignore:
Timestamp:
Dec 26, 2013, 12:48:21 PM (10 years ago)
Author:
mistic100
Message:

update for 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/instagram2piwigo/admin/import.php

    r24817 r26199  
    11<?php
    2 if (!defined('INSTAG_PATH')) die('Hacking attempt!');
     2defined('INSTAG_PATH') or die('Hacking attempt!');
    33
    44set_time_limit(600);
     
    77
    88// check API parameters and connect to instagram
    9 if ( empty($conf['Instagram2Piwigo']['api_key']) or empty($conf['Instagram2Piwigo']['secret_key']) )
    10 {
    11   array_push($page['warnings'], l10n('Please fill your API keys on the configuration tab'));
     9if (empty($conf['Instagram2Piwigo']['api_key']) or empty($conf['Instagram2Piwigo']['secret_key']))
     10{
     11  $page['warnings'][] = l10n('Please fill your API keys on the configuration tab');
    1212  $_GET['action'] = 'error';
    1313}
    1414else if (!function_exists('curl_init'))
    1515{
    16   array_push($page['errors'], l10n('No download method available').' (cURL)');
     16  $page['errors'][] = l10n('No download method available').' (cURL)';
    1717  $_GET['action'] = 'error';
    1818}
     
    2525   
    2626    $auth_config = array(
    27         'client_id'         => $conf['Instagram2Piwigo']['api_key'],
    28         'client_secret'    => $conf['Instagram2Piwigo']['secret_key'],
    29         'redirect_uri'      => get_absolute_root_url() . INSTAG_ADMIN . '-import',
    30     );
     27      'client_id'     => $conf['Instagram2Piwigo']['api_key'],
     28      'client_secret' => $conf['Instagram2Piwigo']['secret_key'],
     29      'redirect_uri'  => get_absolute_root_url() . INSTAG_ADMIN . '-import',
     30      );
    3131   
    3232    $auth = new Instagram_Auth($auth_config);
     
    5757
    5858
    59 if (!isset($_GET['action'])) $_GET['action'] = 'main';
     59if (!isset($_GET['action']))
     60{
     61  $_GET['action'] = 'main';
     62}
    6063
    6164
     
    142145    if ($duplicates>0)
    143146    {
    144       $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;prefilter=instagram">'
    145           .l10n_dec('One picture is not displayed because already existing in the database.', '%d pictures are not displayed because already existing in the database.', $duplicates)
     147      $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;filter=prefilter-instagram">'
     148          .l10n_dec(
     149            'One picture is not displayed because already existing in the database.',
     150            '%d pictures are not displayed because already existing in the database.',
     151            $duplicates)
    146152        .'</a>';
    147153    }
     
    195201    if (isset($_POST['done']))
    196202    {
    197       $_SESSION['page_infos'][] = sprintf(l10n('%d pictures imported'), $_POST['done']);
     203      $_SESSION['page_infos'][] = l10n('%d pictures imported', $_POST['done']);
    198204    }
    199205    redirect(INSTAG_ADMIN . '-import');
     
    204210$template->assign('ACTION', $_GET['action']);
    205211
    206 $template->set_filename('Instagram2Piwigo', dirname(__FILE__) . '/template/import.tpl');
    207 
    208 ?>
     212$template->set_filename('Instagram2Piwigo', realpath(INSTAG_PATH . 'admin/template/import.tpl'));
Note: See TracChangeset for help on using the changeset viewer.