Index: extensions/instagram2piwigo/admin.php
===================================================================
--- extensions/instagram2piwigo/admin.php	(revision 19561)
+++ extensions/instagram2piwigo/admin.php	(revision 19561)
@@ -0,0 +1,35 @@
+<?php
+if (!defined('INSTAG_PATH')) die('Hacking attempt!');
+
+global $template, $page, $conf;
+
+$conf['Instagram2Piwigo'] = unserialize($conf['Instagram2Piwigo']);
+load_language('plugin.lang', INSTAG_PATH);
+
+if (!file_exists(INSTAG_FS_CACHE))
+{
+  mkdir(INSTAG_FS_CACHE, 0755);
+}
+
+// tabsheet
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'import';
+  
+$tabsheet = new tabsheet();
+$tabsheet->add('import', l10n('Import'), INSTAG_ADMIN . '-import');
+$tabsheet->add('config', l10n('Configuration'), INSTAG_ADMIN . '-config');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// include page
+include(INSTAG_PATH . 'admin/' . $page['tab'] . '.php');
+
+// template
+$template->assign(array(
+  'INSTAG_PATH'=> INSTAG_PATH,
+  'INSTAG_ABS_PATH'=> dirname(__FILE__).'/',
+  'INSTAG_ADMIN' => INSTAG_ADMIN,
+  ));
+$template->assign_var_from_handle('ADMIN_CONTENT', 'Instagram2Piwigo');
+
+?>
Index: extensions/instagram2piwigo/admin/config.php
===================================================================
--- extensions/instagram2piwigo/admin/config.php	(revision 19561)
+++ extensions/instagram2piwigo/admin/config.php	(revision 19561)
@@ -0,0 +1,24 @@
+<?php
+if (!defined('INSTAG_PATH')) die('Hacking attempt!');
+
+if (isset($_POST['save_config']))
+{
+  $conf['Instagram2Piwigo'] = array(
+    'api_key' => trim($_POST['api_key']),
+    'secret_key' => trim($_POST['secret_key']),
+    );
+  unset($_SESSION['phpinstagram_auth_token']);
+  conf_update_param('Instagram2Piwigo', serialize($conf['Instagram2Piwigo']));
+}
+
+
+$template->assign(array(
+  'Instagram2Piwigo' => $conf['Instagram2Piwigo'],
+  'INSTAG_HELP_CONTENT' => load_language('help_api_key.html', INSTAG_PATH, array('return'=>true)),
+  'INSTAG_CALLBACK' => get_absolute_root_url() . INSTAG_ADMIN . '-import',
+  ));
+
+
+$template->set_filename('Instagram2Piwigo', dirname(__FILE__) . '/template/config.tpl');
+
+?>
Index: extensions/instagram2piwigo/admin/import.php
===================================================================
--- extensions/instagram2piwigo/admin/import.php	(revision 19561)
+++ extensions/instagram2piwigo/admin/import.php	(revision 19561)
@@ -0,0 +1,206 @@
+<?php
+if (!defined('INSTAG_PATH')) die('Hacking attempt!');
+
+set_time_limit(600);
+
+include_once(INSTAG_PATH . 'include/functions.inc.php');
+
+// check API parameters and connect to instagram
+if ( empty($conf['Instagram2Piwigo']['api_key']) or empty($conf['Instagram2Piwigo']['secret_key']) )
+{
+  array_push($page['warnings'], l10n('Please fill your API keys on the configuration tab'));
+  $_GET['action'] = 'error';
+}
+else if (!function_exists('curl_init'))
+{
+  array_push($page['errors'], l10n('No download method available').' (cURL)');
+  $_GET['action'] = 'error';
+}
+else
+{
+  // init instagram API
+  if (empty($_SESSION['instagram_access_token']))
+  {
+    require_once(INSTAG_PATH . 'include/Instagram/Auth.php');
+    
+    $auth_config = array(
+        'client_id'         => $conf['Instagram2Piwigo']['api_key'],
+        'client_secret'     => $conf['Instagram2Piwigo']['secret_key'],
+        'redirect_uri'      => get_absolute_root_url() . INSTAG_ADMIN . '-import',
+    );
+    
+    $auth = new Instagram_Auth($auth_config);
+  
+    // must authenticate
+    if (@$_GET['action'] != 'login')
+    {
+      $_GET['action'] = 'init_login';
+    }
+    
+    // generate token after authentication
+    if (!empty($_GET['code']))
+    {
+      $_SESSION['instagram_access_token'] = $auth->getAccessToken($_GET['code']);
+      $_GET['action'] = 'logued';
+    }
+  }
+  else
+  {
+    require_once(INSTAG_PATH . 'include/Instagram/Instagram.php');
+    $instagram = new Instagram($_SESSION['instagram_access_token']);
+    $instagram->enableCache(INSTAG_FS_CACHE);
+    
+    $current_user = $instagram->getCurrentUser();
+    $username = $current_user->getData()->username;
+  }
+}
+
+
+if (!isset($_GET['action'])) $_GET['action'] = 'main';
+
+
+switch ($_GET['action'])
+{
+  // button to login page
+  case 'init_login':
+  {
+    $template->assign('instagram_login', INSTAG_ADMIN . '-import&amp;action=login');
+    break;
+  }
+  
+  // call instagram login procedure
+  case 'login':
+  {
+    $auth->authorize();
+    break;
+  }
+  
+  // message after login
+  case 'logued':
+  {
+    $_SESSION['page_infos'][] = l10n('Successfully logged in to you Instagram account');
+    redirect(INSTAG_ADMIN . '-import');
+    break;
+  }
+  
+  // logout
+  case 'logout':
+  {
+    unset($_SESSION['instagram_access_token']);
+    $_SESSION['page_infos'][] = l10n('Logged out');
+    redirect(INSTAG_ADMIN . '-import');
+    break;
+  }
+  
+  // main menu
+  case 'main':
+  {
+    $template->assign(array(
+      'username' => $username,
+      'profile_url' => 'http://instagram.com/'.$username,
+      'logout_url' => INSTAG_ADMIN . '-import&amp;action=logout',
+      'list_photos_url' => INSTAG_ADMIN . '-import&amp;action=list_all',
+      ));
+    break;
+  }
+  
+  // list photos
+  case 'list_all':
+  {
+    $self_url = INSTAG_ADMIN . '-import&amp;action=list_photos';
+    $instagram_prefix = 'instagram-'.$username.'-';
+    
+    // pagination
+    if (isset($_GET['start']))   $page['start'] = intval($_GET['start']);
+    else                         $page['start'] = 0;
+    if (isset($_GET['display'])) $page['display'] = $_GET['display']=='all' ? 500 : intval($_GET['display']);
+    else                         $page['display'] = 20;
+    
+    $all_photos = $current_user->getFeed();
+    
+    // get existing photos
+    $query = '
+SELECT id, file
+  FROM '.IMAGES_TABLE.'
+  WHERE file LIKE "'.$instagram_prefix.'%"
+;';
+    
+    $existing_photos = simple_hash_from_query($query, 'id', 'file');
+    $existing_photos = array_map(create_function('$p', 'return preg_replace("#^'.$instagram_prefix.'([0-9_]+)\.([a-z]{3,4})$#i", "$1", $p);'), $existing_photos);
+    
+    // remove existing photos
+    $duplicates = 0;
+    foreach ($all_photos as $i => $photo)
+    {
+      if (in_array($photo->id, $existing_photos))
+      {
+        $all_photos->unsetItem($i);
+        $duplicates++;
+      }
+    }
+    
+    if ($duplicates>0)
+    {
+      array_push($page['infos'], 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));
+    }
+    
+    // displayed photos
+    $page_photos = $all_photos->getSlice($page['start'], $page['display']);
+    $all_elements = array_map(create_function('$p', 'return  \'"\'.$p->id.\'"\';'), $all_photos->getData());
+    
+    $tpl_vars = array();
+    foreach ($page_photos as $photo)
+    {
+      $tpl_vars[] = array(
+        'id' => $photo->id,
+        'title' => $photo->getCaption(),
+        'thumb' => $photo->getThumbnail()->url,
+        'src' => $photo->getLowRes()->url,
+        'url' => $photo->getLink(),
+        );
+    }
+    
+    $template->assign(array(
+      'nb_thumbs_set' => count($all_photos),
+      'nb_thumbs_page' => count($page_photos),
+      'thumbnails' => $tpl_vars,
+      'all_elements' => $all_elements,
+      'F_ACTION' => INSTAG_ADMIN.'-import&amp;action=import_set',
+      'U_DISPLAY' => $self_url,
+      ));
+      
+    // get piwigo categories
+    $query = '
+SELECT id, name, uppercats, global_rank
+  FROM '.CATEGORIES_TABLE.'
+;';
+    display_select_cat_wrapper($query, array(), 'category_parent_options');
+    
+    // get navbar
+    $nav_bar = create_navigation_bar(
+      $self_url,
+      count($all_elements),
+      $page['start'],
+      $page['display']
+      );
+    $template->assign('navbar', $nav_bar);
+    break;
+  }
+  
+  // success message after import
+  case 'import_set':
+  {
+    if (isset($_POST['done']))
+    {
+      $_SESSION['page_infos'][] = sprintf(l10n('%d pictures imported'), $_POST['done']);
+    }
+    redirect(INSTAG_ADMIN . '-import');
+  }
+}
+
+
+$template->assign('ACTION', $_GET['action']);
+
+$template->set_filename('Instagram2Piwigo', dirname(__FILE__) . '/template/import.tpl');
+
+?>
Index: extensions/instagram2piwigo/admin/index.php
===================================================================
--- extensions/instagram2piwigo/admin/index.php	(revision 19561)
+++ extensions/instagram2piwigo/admin/index.php	(revision 19561)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/admin/template/config.tpl
===================================================================
--- extensions/instagram2piwigo/admin/template/config.tpl	(revision 19561)
+++ extensions/instagram2piwigo/admin/template/config.tpl	(revision 19561)
@@ -0,0 +1,35 @@
+<div class="titrePage">
+	<h2>Instagram2Piwigo</h2>
+</div>
+
+<form method="post" action="" class="properties">
+<fieldset>
+  <legend>{'Instagram logins'|@translate}</legend>
+  
+  <ul>
+    <li>
+      <label>
+        <span class="property">Client ID</span>
+        <input type="text" name="api_key" value="{$Instagram2Piwigo.api_key}" size="40">
+      </label>
+    </li>
+
+    <li>
+      <label>
+        <span class="property">Client Secret</span>
+        <input type="text" name="secret_key" value="{$Instagram2Piwigo.secret_key}" size="40">
+      </label>
+    </li>
+  </ul>
+</fieldset>
+
+<p><input type="submit" name="save_config" value="{'Save Settings'|@translate}"></p>
+
+<fieldset>
+  <legend>{'How do I get my Instagram Client ID ?'|@translate}</legend>
+  
+  <p><b>OAuth redirect_uri :</b> <span style="font-family:monospace;font-size:14px;">{$INSTAG_CALLBACK}</span></p>
+  {$INSTAG_HELP_CONTENT}
+</fieldset>
+  
+</form>
Index: extensions/instagram2piwigo/admin/template/import.list_all.tpl
===================================================================
--- extensions/instagram2piwigo/admin/template/import.list_all.tpl	(revision 19561)
+++ extensions/instagram2piwigo/admin/template/import.list_all.tpl	(revision 19561)
@@ -0,0 +1,438 @@
+{include file='include/colorbox.inc.tpl'}
+{include file='include/add_album.inc.tpl'}
+{combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
+{combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js'}
+{combine_css path="admin/themes/default/uploadify.jGrowl.css"}
+
+{footer_script require='jquery.ajaxmanager,jquery.jgrowl'}
+/* global vars */
+var nb_thumbs_page = {$nb_thumbs_page};
+var nb_thumbs_set = {$nb_thumbs_set};
+var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}];
+
+var errorHead   = '{'ERROR'|@translate|@escape:'javascript'}';
+var errorMsg    = '{'an error happened'|@translate|@escape:'javascript'}';
+var successHead = '{'Success'|@translate|@escape:'javascript'}';
+var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}";
+var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}";
+var selectedMessage_all = "{'All %d photos are selected'|@translate}";
+var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}";
+
+var import_done = 0;
+var import_selected = 0;
+var queuedManager = jQuery.manageAjax.create('queued', {ldelim}
+  queue: true,  
+  maxRequests: 1
+});
+
+{literal}
+/* Shift-click: select all photos between the click and the shift+click */
+jQuery(document).ready(function() {
+  var last_clicked=0;
+  var last_clickedstatus=true;
+  jQuery.fn.enableShiftClick = function() {
+    var inputs = [];
+    var count=0;
+    var This=$(this);
+    this.find('input[type=checkbox]').each(function() {
+      var pos=count;
+      inputs[count++]=this;
+      $(this).bind("shclick", function (dummy,event) {
+        if (event.shiftKey) {
+          var first = last_clicked;
+          var last = pos;
+          if (first > last) {
+            first=pos;
+            last=last_clicked;
+          }
+
+          for (var i=first; i<=last;i++) {
+            input = $(inputs[i]);
+            $(input).attr('checked', last_clickedstatus);
+            if (last_clickedstatus)
+            {
+              $(input).siblings("span.wrap2").addClass("thumbSelected");
+            }
+            else
+            {
+              $(input).siblings("span.wrap2").removeClass("thumbSelected");
+            }
+          }
+        }
+        else {
+          last_clicked = pos;
+          last_clickedstatus = this.checked;
+        }
+        return true;
+      });
+      $(this).click(function(event) {console.log(event.shiftKey);$(this).triggerHandler("shclick",event)});
+    });
+  }
+});
+
+/* sprintf */
+function str_repeat(i, m) {
+    for (var o = []; m > 0; o[--m] = i);
+    return o.join('');
+}
+
+function sprintf() {
+  var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = '';
+  while (f) {
+    if (m = /^[^\x25]+/.exec(f)) {
+      o.push(m[0]);
+    }
+    else if (m = /^\x25{2}/.exec(f)) {
+      o.push('%');
+    }
+    else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) {
+      if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) {
+        throw('Too few arguments.');
+      }
+      if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) {
+        throw('Expecting number but found ' + typeof(a));
+      }
+      switch (m[7]) {
+        case 'b': a = a.toString(2); break;
+        case 'c': a = String.fromCharCode(a); break;
+        case 'd': a = parseInt(a); break;
+        case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break;
+        case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break;
+        case 'o': a = a.toString(8); break;
+        case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break;
+        case 'u': a = Math.abs(a); break;
+        case 'x': a = a.toString(16); break;
+        case 'X': a = a.toString(16).toUpperCase(); break;
+      }
+      a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+'+ a : a);
+      c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
+      x = m[5] - String(a).length - s.length;
+      p = m[5] ? str_repeat(c, x) : '';
+      o.push(s + (m[4] ? a + p : p + a));
+    }
+    else {
+      throw('Huh ?!');
+    }
+    f = f.substring(m[0].length);
+  }
+  return o.join('');
+}
+
+/* update displaying */
+function checkPermitAction() {
+  var nbSelected = 0;
+  if ($("input[name=setSelected]").is(':checked')) {
+    nbSelected = nb_thumbs_set;
+  } else {
+    $(".thumbnails input[type=checkbox]").each(function() {
+      if ($(this).is(':checked')) nbSelected++;
+    });
+  }
+
+  if (nbSelected == 0) {
+    $("#beginImport").hide();
+  } else {
+    $("#beginImport").show();
+  }
+
+  $("#applyOnDetails").text(
+    sprintf(
+      applyOnDetails_pattern,
+      nbSelected
+    )
+  );
+
+  // display the number of currently selected photos in the "Selection" fieldset
+  if (nbSelected == 0) {
+    $("#selectedMessage").text(
+      sprintf(
+        selectedMessage_none,
+        nb_thumbs_set
+      )
+    );
+  } else if (nbSelected == nb_thumbs_set) {
+    $("#selectedMessage").text(
+      sprintf(
+        selectedMessage_all,
+        nb_thumbs_set
+      )
+    );
+  } else {
+    $("#selectedMessage").text(
+      sprintf(
+        selectedMessage_pattern,
+        nbSelected,
+        nb_thumbs_set
+      )
+    );
+  }
+}
+
+/* import queue */
+function performImport(photo, album, fills) {
+  queuedManager.add({
+    type: 'GET',
+    dataType: 'json',
+    url: 'ws.php',
+    data: { method: 'pwg.images.addInstagram', id: photo, category: album, fills: fills, format: 'json' },
+    success: function(data) {
+      if (data['stat'] == 'ok') {
+        jQuery.jGrowl(data['result'], { theme: 'success', header: successHead, life: 4000, sticky: false });
+        jQuery("#photo-"+photo).fadeOut(function(){ $(this).remove(); });
+      } else {
+        jQuery.jGrowl(data['result'], { theme: 'error', header: errorHead, sticky: true });
+      }
+      
+      import_done++;
+      $("#progress").html(import_done +"/"+ import_selected);
+      
+      if (import_done == import_selected) {
+        $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">');
+        $("#import_form").submit();
+      }
+    },
+    error: function(data) {
+      jQuery.jGrowl(errorMsg, { theme: 'error', header: errorHead, sticky: true });
+    }
+  });
+}
+
+
+$(document).ready(function() {
+  checkPermitAction();
+  $("a.preview-box").colorbox({
+    initialWidth:306,
+    initialHeight:306
+  });
+  $('ul.thumbnails').enableShiftClick();
+
+  /* tiptip */
+  $('img.thumbnail').tipTip({
+    'delay' : 0,
+    'fadeIn' : 200,
+    'fadeOut' : 200
+  });
+
+  /* thumbnail click */
+  $(".wrap1 label").click(function (event) {
+    $("input[name=setSelected]").attr('checked', false);
+
+    var wrap2 = $(this).children(".wrap2");
+    var checkbox = $(this).children("input[type=checkbox]");
+
+    checkbox.triggerHandler("shclick",event);
+
+    if ($(checkbox).is(':checked')) {
+      $(wrap2).addClass("thumbSelected"); 
+    }
+    else {
+      $(wrap2).removeClass('thumbSelected'); 
+    }
+
+    checkPermitAction();
+  });
+
+  /* select all */
+  $("#selectAll").click(function () {
+    $("input[name=setSelected]").attr('checked', false);
+    
+    $(".thumbnails label").each(function() {
+      var wrap2 = $(this).children(".wrap2");
+      var checkbox = $(this).children("input[type=checkbox]");
+
+      $(checkbox).attr('checked', true);
+      $(wrap2).addClass("thumbSelected"); 
+    });
+    
+    checkPermitAction();
+    return false;
+  });
+
+  /* select none */
+  $("#selectNone").click(function () {
+    $("input[name=setSelected]").attr('checked', false);
+    
+    $(".thumbnails label").each(function() {
+      var wrap2 = $(this).children(".wrap2");
+      var checkbox = $(this).children("input[type=checkbox]");
+
+      $(checkbox).attr('checked', false);
+      $(wrap2).removeClass("thumbSelected"); 
+    });
+    
+    checkPermitAction();
+    return false;
+  });
+
+  /* select invert */
+  $("#selectInvert").click(function () {
+    $("input[name=setSelected]").attr('checked', false);
+    
+    $(".thumbnails label").each(function() {
+      var wrap2 = $(this).children(".wrap2");
+      var checkbox = $(this).children("input[type=checkbox]");
+
+      $(checkbox).attr('checked', !$(checkbox).is(':checked'));
+
+      if ($(checkbox).is(':checked')) {
+        $(wrap2).addClass("thumbSelected"); 
+      } else {
+        $(wrap2).removeClass('thumbSelected'); 
+      }
+    });
+    
+    checkPermitAction();
+    return false;
+  }); 
+  
+  /* select set */
+  $("#selectSet").click(function () {
+    $("input[name=setSelected]").attr('checked', true);
+    
+    $(".thumbnails label").each(function() {
+      var wrap2 = $(this).children(".wrap2");
+      var checkbox = $(this).children("input[type=checkbox]");
+
+      $(checkbox).attr('checked', true);
+      $(wrap2).addClass("thumbSelected"); 
+    });
+    
+    checkPermitAction();
+    return false;
+  });
+ 
+  /* begin import */
+  jQuery('#beginImport').click(function() {
+    $("#loader_import").fadeIn();
+    var album = $("#albumSelect option:selected").val();
+    
+    var fills = '';
+    $("input[name^='fill_']:checked").each(function() {
+      fills+= $(this).attr("name") +',';
+    }); 
+    
+    if (jQuery('input[name="setSelected"]').attr('checked')) {
+      import_selected = all_elements.length;
+      $("#progress").html("0/"+ import_selected);
+      
+      for (var i in all_elements) {
+        performImport(all_elements[i], album, fills);
+      }
+		} else {
+      import_selected = $("input[name='selection[]']:checked").length;
+      $("#progress").html("0/"+ import_selected);
+      
+			jQuery("input[name='selection[]']:checked").each(function() {
+        performImport(jQuery(this).attr('value'), album, fills);
+      });
+    }
+    
+    return false;
+  });
+  
+  /* pagination loader */
+  jQuery('#navigation a').click(function() {
+    $("#loader_display").fadeIn();
+  });
+});
+{/literal}
+{/footer_script}
+
+{html_head}
+<style type="text/css">
+.thumbnails .wrap2 {ldelim} width:128px; height:128px; }
+.thumbnail {ldelim} width:100px; }
+</style>
+{/html_head}
+
+
+<div id="batchManagerGlobal">
+<form action="{$F_ACTION}" method="post" id="import_form">
+
+  <fieldset>
+    <legend>{'Selection'|@translate}</legend>
+
+  {if !empty($thumbnails)}
+    <p id="checkActions">
+      {'Select:'|@translate}
+    {if $nb_thumbs_set > $nb_thumbs_page}
+      <a href="#" id="selectAll">{'The whole page'|@translate}</a>,
+      <a href="#" id="selectSet">{'The whole set'|@translate}</a>,
+    {else}
+      <a href="#" id="selectAll">{'All'|@translate}</a>,
+    {/if}
+      <a href="#" id="selectNone">{'None'|@translate}</a>,
+      <a href="#" id="selectInvert">{'Invert'|@translate}</a>
+
+      <span id="selectedMessage"></span>
+      <input type="checkbox" name="setSelected" style="display:none">
+      <span id="loader_display" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|@translate}</i></span>
+    </p>
+
+    <ul class="thumbnails">
+      {foreach from=$thumbnails item=thumbnail}
+			<li id="photo-{$thumbnail.id}">
+				<span class="wrap1">
+					<label>
+						<span class="wrap2">
+						<div class="actions"><a href="{$thumbnail.src}" class="preview-box">{'Zoom'|@translate}</a> &middot; <a href="{$thumbnail.url}" target="_blank" title="{'Open Instagram page in a new tab'|@translate}">Open</a></div>
+							<span>
+								<img src="{$thumbnail.thumb}" alt="{$thumbnail.title}" title="{$thumbnail.title|@escape:'html'}" class="thumbnail">
+							</span>
+						</span>
+						<input type="checkbox" name="selection[]" value="{$thumbnail.id}">
+					</label>
+				</span>
+			</li>
+      {/foreach}
+    </ul>
+    
+    
+    <div style="clear:both;" id="navigation">
+    {if !empty($navbar) }
+      <div style="float:left">
+      {include file='navigation_bar.tpl'|@get_extent:'navbar'}
+      </div>
+    {/if}
+    
+      <div style="float:right;margin-top:10px;">{'display'|@translate}
+        <a href="{$U_DISPLAY}&amp;display=20">20</a>
+        &middot; <a href="{$U_DISPLAY}&amp;display=50">50</a>
+        &middot; <a href="{$U_DISPLAY}&amp;display=100">100</a>
+        &middot; <a href="{$U_DISPLAY}&amp;display=all">{'all'|@translate}</a>
+        {'photos per page'|@translate}
+      </div>
+    </div>
+
+  {else}
+    <div>{'No photo in the current set.'|@translate}</div>
+  {/if}
+  </fieldset>
+  
+  <fieldset>
+    <legend>{'Import options'|@translate}</legend>
+
+    <p>
+      <label for="albumSelect"><b>{'Album'|@translate}:</b></label>
+      <select style="width:400px" name="associate" id="albumSelect" size="1">
+        {html_options options=$category_parent_options}
+      </select>
+      {'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
+    </p>
+    
+    <p>
+      <b>{'Fill these fields from Instagram datas'|@translate}:</b>
+      <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|@translate}</label>
+      <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|@translate}</label>
+      <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|@translate}</label>
+      <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'|@translate}</label>
+    </p>
+
+    <p>
+      <input type="hidden" name="album" value="{$album}">
+      <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|@translate}" style="display:none;">
+      <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|@translate}</i> <span id="progress"></span></span>
+    </p>
+  </fieldset>
+</form>
+</div>
Index: extensions/instagram2piwigo/admin/template/import.tpl
===================================================================
--- extensions/instagram2piwigo/admin/template/import.tpl	(revision 19561)
+++ extensions/instagram2piwigo/admin/template/import.tpl	(revision 19561)
@@ -0,0 +1,35 @@
+<div class="titrePage">
+	<h2>Instagram2Piwigo</h2>
+</div>
+
+{* <!-- LOGIN --> *}
+{if $ACTION == 'init_login'}
+<p><input type="submit" onClick="javascript:window.location.href ='{$instagram_login}';" value="{'Login'|@translate}"></p>
+
+{* <!-- MAIN MENU --> *}
+{elseif $ACTION == 'main'}
+{footer_script}{literal}
+jQuery('input[type="submit"]').click(function() {
+  window.location.href = $(this).attr("data");
+});
+jQuery('.load').click(function() {
+  $("#loader_import").fadeIn();
+});
+{/literal}{/footer_script}
+
+<p>
+  <b>{'Logged in as'|@translate}</b> : <a href="{$profile_url}" target="_blank">{$username}</a><br><br>
+  <input type="submit" data="{$logout_url}" value="{'Logout'|@translate}">
+</p>
+<br>
+<p>
+  <input type="submit" data="{$list_photos_url}" class="load" value="{'List my pictures'|@translate}">
+  <br>
+  <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|@translate}</i></span>
+</p>
+
+{* <!-- PHOTOS LIST --> *}
+{elseif $ACTION == 'list_all'}
+{include file=$INSTAG_ABS_PATH|@cat:'admin/template/import.list_all.tpl'}
+
+{/if}
Index: extensions/instagram2piwigo/admin/template/index.php
===================================================================
--- extensions/instagram2piwigo/admin/template/index.php	(revision 19561)
+++ extensions/instagram2piwigo/admin/template/index.php	(revision 19561)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/include/Instagram/Auth.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Auth.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Auth.php	(revision 19561)
@@ -0,0 +1,108 @@
+<?php
+
+/**
+ * Instagram PHP
+ * @author Galen Grover <galenjr@gmail.com>
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
+ */
+
+defined('INSTAGRAM_ROOT') or define('INSTAGRAM_ROOT', realpath(dirname(__FILE__)));
+ 
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+include_once(INSTAGRAM_ROOT.'/Core/ApiException.php');
+include_once(INSTAGRAM_ROOT.'/Net/ClientInterface.php');
+include_once(INSTAGRAM_ROOT.'/Net/CurlClient.php');
+
+
+/**
+ * Auth class
+ *
+ * Handles authentication
+ * 
+ * {@link https://github.com/galen/PHP-Instagram-API#authentication}
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/_auth.php}
+ */
+class Instagram_Auth {
+
+    /**
+     * Configuration array
+     *
+     * Contains a default client and proxy
+     *
+     * client_id:       These three items are required for authorization
+     * redirect_uri:    URL that the Instagram API shoudl redirect to
+     * grant_type:      Grant type from the Instagram API. Only authorization_code is accepted right now.
+     * scope:           {@link http://instagram.com/developer/auth/#scope}
+     * display:         Pass in "touch" if you'd like your authenticating users to see a mobile-optimized
+     *                  version of the authenticate page and the sign-in page. 
+     *
+     * @var array
+     * @access protected
+     */
+        protected $config = array(
+        'client_id'     => '',
+        'client_secret' => '',
+        'redirect_uri'  => '',
+        'grant_type'    => 'authorization_code',
+        'scope'         => array( 'basic' ),
+        'display'       => ''
+        );
+
+    /**
+     * Constructor
+     *
+     * @param array $config Configuration array
+     * @param Instagram_Net_ClientInterface $client Client object used to connect to the API
+     * @access public
+     */
+    public function __construct( array $config = null, Instagram_Net_ClientInterface $client = null ) {
+        $this->config = (array) $config + $this->config;
+        $this->proxy = new Instagram_Core_Proxy( $client ? $client : new Instagram_Net_CurlClient );
+    }
+
+    /**
+     * Authorize
+     *
+     * Redirects the user to the Instagram authorization url
+     * @access public
+     */
+    public function authorize() {
+        header(
+            sprintf(
+                'Location:https://api.instagram.com/oauth/authorize/?client_id=%s&redirect_uri=%s&response_type=code&scope=%s',
+                $this->config['client_id'],
+                $this->config['redirect_uri'],
+                implode( '+', $this->config['scope'] )
+            )
+        );
+        exit;
+    }
+
+    /**
+     * Get the access token
+     *
+     * POSTs to the Instagram API and obtains and access key
+     *
+     * @param string $code Code supplied by Instagram
+     * @return string Returns the access token
+     * @throws Instagram_Core_ApiException
+     * @access public
+     */
+    public function getAccessToken( $code ) {
+        $post_data = array(
+            'client_id'         => $this->config['client_id'],
+            'client_secret'     => $this->config['client_secret'],
+            'grant_type'        => $this->config['grant_type'],
+            'redirect_uri'      => $this->config['redirect_uri'],
+            'code'              => $code
+        );
+        $response = $this->proxy->getAccessToken( $post_data );
+        if ( isset( $response->getRawData()->access_token ) ) {
+            return $response->getRawData()->access_token;
+        }
+        throw new Instagram_Core_ApiException( $response->getErrorMessage(), $response->getErrorCode(), $response->getErrorType() );
+    }
+
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/CollectionAbstract.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/CollectionAbstract.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/CollectionAbstract.php	(revision 19561)
@@ -0,0 +1,219 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+
+
+/**
+ * Abstract Collection
+ *
+ * All Collections extend this class
+ */
+abstract class Instagram_Collection_CollectionAbstract implements IteratorAggregate, ArrayAccess, Countable {
+
+    /**
+     * Holds the pagination data for the collection
+     *
+     * @var StdClass
+     * @access protected
+     */
+    protected $pagination;
+
+    /**
+     * Holds the data for the collection
+     *
+     * @var array
+     * @access protected
+     */
+    protected $data = array();
+
+    /**
+     * Holds the position for the iterator
+     *
+     * @var integer
+     * @access protected
+     */
+    protected $position;
+
+    /**
+     * Constructor
+     *
+     * Sets the data and child object's proxies
+     *
+     * @param StdClass $data Data from the API
+     * @param Instagram_Core_Proxy $proxy Instagram_Core_Proxy to pass on to teh collection's objects
+     * @access public
+     */
+    public function __construct( $raw_data = null, Instagram_Core_Proxy $proxy = null ) {
+        if ( $raw_data ) {
+            $this->setData( $raw_data );
+        }
+        if ( $proxy ) {
+            $this->setProxies( $proxy );
+        }
+    }
+
+    /**
+     * Set the collections data
+     *
+     * @param StdClass $data Data from the API
+     * @access public
+     */
+    public abstract function setData( $raw_data );
+
+    /**
+     * Get the collection's data
+     *
+     * @return StdClass
+     * @access public
+     */
+    public function getData() {
+        return $this->data;
+    }
+
+    /**
+     * Get a collection item
+     *
+     * @param int $position Item to retrieve, starting at 0
+     * @return mixed Returns the collection item at the position
+     * @access public
+     */
+    public function getItem( $position ) {
+        return isset( $this->data[$position] ) ? $this->data[$position] : null;
+    }
+    
+    /**
+     * Remove an item from the collection
+     *
+     * @param int $position Item to remove, starting at 0
+     * @access public
+     */
+    public function unsetItem( $position ) {
+        unset( $this->data[$position] );
+    }
+
+    /**
+     * Get a slice of the collection
+     *
+     * @param int $offset Where to start the slice
+     * @param int $length Length of the slice
+     * @return array Returns a slice of the array
+     * @access public
+     */
+    public function getSlice( $offset, $length ) {
+        return array_slice( $this->data, $offset, $length );
+    }
+
+    /**
+     * Add data
+     *
+     * Add data from another collection the this collection
+     *
+     * @param Instagram_Collection_CollectionAbstract $object Object to add the data of
+     * @access public
+     */
+    public function addData( Instagram_Collection_CollectionAbstract $object ) {
+        $this->data = array_merge( $this->data, $object->getData() );
+    }
+
+    /**
+     * Convert the collection's objects
+     *
+     * Child classes use this to turn the objects into the correct class
+     *
+     * @param string $object
+     * @access protected
+     */
+    protected function convertData( $object ) {
+        $this->data = array_map(
+            create_function( '$c', 'return new '.$object.'( $c );' ),
+            $this->data
+        );
+    }
+
+    /**
+     * Set object proxies
+     *
+     * Sets all the child object's proxies
+     *
+     * @param Instagram_Core_Proxy $proxy
+     * @access public
+     */
+    public function setProxies( Instagram_Core_Proxy $proxy ) {
+        foreach( $this->data as $object ) {
+            $object->setProxy( $proxy );
+        }
+    }
+
+    /**
+     * Implode the collection
+     *
+     * Implode the collection into a string
+     *
+     * Example - Get a media's tags into a comma delimited string
+     *
+     * $media->getTags()->implode(
+     *     function( $t ){ return sprintf( '<a href="?example=tag.php&tag=%1$s">#%1$s</a>', $t ); }
+     * )
+     *
+     * @param Closure $callback Function to run on the collection 
+     * @param string $sep Implode separator
+     * @access public
+     */
+    public function implode( Closure $callback = null, $sep = ', ' ) {
+        if ( !count( $this->getData() ) ) {
+            return null;
+        }
+        if ( !$callback ) {
+            $callback = create_function( '$i', 'return $i->__toString();' );
+        }
+        foreach( $this->getData() as $item ) {
+            $items[] = $callback( $item );
+        }
+        return implode( $sep, $items );
+    }
+
+    /**
+     * IteratorAggregate
+     *
+     * {@link http://us2.php.net/manual/en/class.iteratoraggregate.php}
+     */
+    public function getIterator(){
+        return new ArrayIterator( $this->data );
+    }
+
+    /**
+     * ArrayAccess
+     *
+     * {@link http://us2.php.net/manual/en/class.arrayaccess.php}
+     */
+    public function offsetExists( $offset ) {
+        return isset( $this->data[$offset] );
+    }
+    public function offsetGet( $offset ) {
+        return $this->data[$offset];
+    }
+    public function offsetSet( $offset, $value ) {
+        trigger_error( "You can't set collection data");
+    }
+    public function offsetUnset( $offset ) {
+        trigger_error( "You can't unset collection data" );
+    }
+
+    /**
+     * Countable
+     * 
+     * {@link http://us2.php.net/manual/en/class.countable.php}
+     */
+    public function count() {
+        return count( $this->data );
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/CommentCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/CommentCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/CommentCollection.php	(revision 19561)
@@ -0,0 +1,33 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/CollectionAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Comment.php');
+
+
+/**
+ * Comment Collection
+ *
+ * Holds a collection of comments
+ */
+class Instagram_Collection_CommentCollection extends Instagram_Collection_CollectionAbstract {
+
+    /**
+     * Set the collection data
+     *
+     * @param StdClass $raw_data
+     * @access public
+     */
+    public function setData( $raw_data ) {
+        $this->data = $raw_data->data;
+        $this->convertData( 'Instagram_Comment' );
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/LikedMediaCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/LikedMediaCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/LikedMediaCollection.php	(revision 19561)
@@ -0,0 +1,41 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/MediaCollection.php');
+
+
+/**
+ * Liked Media Collection
+ *
+ * Holds a collection of liked media
+ */
+class Instagram_Collection_LikedMediaCollection extends Instagram_Collection_MediaCollection {
+
+    /**
+     * Get the next max like ID
+     * 
+     * @return string
+     * @access public
+     */
+    public function getNextMaxLikeId() {
+        return isset( $this->pagination->next_max_like_id ) ? $this->pagination->next_max_like_id : null;
+    }
+
+    /**
+     * Get the next max like ID
+     * 
+     * @return string
+     * @access public
+     */
+    public function getNext() {
+        return $this->getNextMaxLikeId();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/LocationCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/LocationCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/LocationCollection.php	(revision 19561)
@@ -0,0 +1,33 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/CollectionAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Location.php');
+
+
+/**
+ * Comment Collection
+ *
+ * Holds a collection of comments
+ */
+class Instagram_Collection_LocationCollection extends Instagram_Collection_CollectionAbstract {
+
+    /**
+     * Set the collection data
+     *
+     * @param StdClass $raw_data
+     * @access public
+     */
+    public function setData( $raw_data ) {
+        $this->data = $raw_data->data;
+        $this->convertData( 'Instagram_Location' );
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/MediaCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/MediaCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/MediaCollection.php	(revision 19561)
@@ -0,0 +1,71 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/CollectionAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Media.php');
+
+
+/**
+ * Media Collection
+ *
+ * Holds a collection of media
+ */
+class Instagram_Collection_MediaCollection extends Instagram_Collection_CollectionAbstract {
+
+    /**
+     * Set the collection data
+     *
+     * @param StdClass $raw_data
+     * @access public
+     */
+    public function setData( $raw_data ) {
+        $this->data = $raw_data->data;
+        $this->pagination = isset( $raw_data->pagination ) ? $raw_data->pagination : null;
+        $this->convertData( 'Instagram_Media' );
+    }
+
+    /**
+     * Get next max id
+     *
+     * Get the next max id for use in pagination
+     *
+     * @return string Returns the next max id
+     * @access public
+     */
+    public function getNextMaxId() {
+        return isset( $this->pagination->next_max_id ) ? $this->pagination->next_max_id : null;
+    }
+
+    /**
+     * Get next url
+     *
+     * Get the API url for the next page of media
+     * You shouldn't need to use this
+     *
+     * @return string Returns the next url
+     * @access public
+     */
+    public function getNextUrl() {
+        return isset( $this->pagination->next_url ) ? $this->pagination->next_url : null;
+    }
+
+    /**
+     * Get next max id
+     *
+     * Get the next max id for use in pagination
+     *
+     * @return string Returns the next max id
+     * @access public
+     */
+    public function getNext() {
+        return $this->getNextMaxId();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/MediaSearchCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/MediaSearchCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/MediaSearchCollection.php	(revision 19561)
@@ -0,0 +1,66 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/CollectionAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Media.php');
+
+
+/**
+ * Media Search Collection
+ *
+ * Holds a collection of searched media
+ */
+class Instagram_Collection_MediaSearchCollection extends Instagram_Collection_CollectionAbstract {
+
+    /**
+     * Next max timestamp for use in pagination
+     *
+     * @var int
+     * @access protected
+     */
+    protected $next_max_timestamp;
+
+    /**
+     * Set the collection data
+     *
+     * @param StdClass $raw_data
+     * @access public
+     */
+    public function setData( $raw_data ) {
+        $this->data = $raw_data->data;
+        $this->convertData( 'Instagram_Media' );
+        $this->next_max_timestamp = count( $this->data ) ? $this->data[ count( $this->data )-1 ]->getCreatedTime() : null;
+    }
+
+    /**
+     * Get next max timestamp
+     *
+     * Get the next max timestamp for use in pagination
+     *
+     * @return string Returns the next max timestamp
+     * @access public
+     */
+    public function getNextMaxTimeStamp() {
+        return $this->next_max_timestamp;
+    }
+
+    /**
+     * Get next max timestamp
+     *
+     * Get the next max timestamp for use in pagination
+     *
+     * @return string Returns the next max timestamp
+     * @access public
+     */
+    public function getNext() {
+        return $this->getNextMaxTimeStamp();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/TagCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/TagCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/TagCollection.php	(revision 19561)
@@ -0,0 +1,52 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/CollectionAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Tag.php');
+
+
+/**
+ * Tag Collection
+ *
+ * Holds a collection of tags
+ */
+class Instagram_Collection_TagCollection extends Instagram_Collection_CollectionAbstract {
+
+    /**
+     * Set the collection data
+     *
+     * @param StdClass $raw_data
+     * @access public
+     */
+    public function setData( $raw_data ) {
+        if ( isset( $raw_data->data ) ) {
+            $this->data = $raw_data->data;
+        }
+        elseif( is_array( $raw_data ) ) {
+            $this->data = array_map( create_function( '$t', 'return (object)array( \'name\' => $t );' ), $raw_data );
+        }
+        $this->convertData( 'Instagram_Tag' );
+    }
+
+    /**
+     * Get an array of tag names
+     * 
+     * @return array Returns an array of tags
+     * @access public
+     */
+    public function toArray() {
+        $tags = array();
+        foreach( $this->data as $tag ) {
+            $tags[] = $tag->getName();
+        }
+        return $tags;
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/TagMediaCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/TagMediaCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/TagMediaCollection.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/MediaCollection.php');
+
+
+/**
+ * Tag Media Collection
+ *
+ * Holds a collection of media associated with a tag
+ */
+class Instagram_Collection_TagMediaCollection extends Instagram_Collection_MediaCollection {
+
+    /**
+     * Get next max tag id
+     *
+     * Get the next max tag id for use in pagination
+     *
+     * @return string Returns the next max tag id
+     * @access public
+     */
+    public function getNextMaxTagId() {
+        return isset( $this->pagination->next_max_tag_id ) ? $this->pagination->next_max_tag_id : null;
+    }
+
+    /**
+     * Get next max tag id
+     *
+     * Get the next max tag id for use in pagination
+     *
+     * @return string Returns the next max tag id
+     * @access public
+     */
+    public function getNext() {
+        return $this->getNextMaxTagId();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Collection/UserCollection.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Collection/UserCollection.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Collection/UserCollection.php	(revision 19561)
@@ -0,0 +1,58 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Collection/CollectionAbstract.php');
+include_once(INSTAGRAM_ROOT.'/User.php');
+
+
+/**
+ * User Collection
+ *
+ * Holds a collection of users
+ */
+class Instagram_Collection_UserCollection extends Instagram_Collection_CollectionAbstract {
+
+    /**
+     * Set the collection data
+     *
+     * @param StdClass $raw_data
+     * @access public
+     */
+    public function setData( $raw_data ) {
+        $this->data = $raw_data->data;
+        $this->pagination = isset( $raw_data->pagination ) ? $raw_data->pagination : null;
+        $this->convertData( 'Instagram_User' );
+    }
+
+    /**
+     * Get next max cursor
+     *
+     * Get the next max cursor for use in pagination
+     *
+     * @return string Returns the next max cursor
+     * @access public
+     */
+    public function getNextCursor() {
+        return isset( $this->pagination->next_cursor ) && !empty( $this->pagination->next_cursor ) ? $this->pagination->next_cursor : null;
+    }
+
+    /**
+     * Get next max cursor
+     *
+     * Get the next max cursor for use in pagination
+     *
+     * @return string Returns the next max cursor
+     * @access public
+     */
+    public function getNext() {
+        return $this->getNextCursor();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Comment.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Comment.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Comment.php	(revision 19561)
@@ -0,0 +1,84 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/BaseObjectAbstract.php');
+include_once(INSTAGRAM_ROOT.'/User.php');
+
+
+/**
+ * Comment class
+ *
+ * @see Instagram_CurrentUser::addMediaComment()
+ * @see Instagram_CurrentUser::deleteMediaComment()
+ * @see Instagram_Media::getCaption()
+ * @see Instagram_Media::getComments()
+ */
+class Instagram_Comment extends Instagram_Core_BaseObjectAbstract {
+
+    /**
+     * Cached user
+     * 
+     * @var Instagram_User
+     */
+    protected $user = null;
+
+    /**
+     * Get comment creation time
+     *
+     * @param $format Time format {@link http://php.net/manual/en/function.date.php}
+     * @return string Returns the creation time with optional formatting
+     * @access public
+     */
+    public function getCreatedTime( $format = null ) {
+        if ( $format ) {
+            $date = date( $format, $this->data->created_time );
+        }
+        else {
+            $date = $this->data->created_time;
+        }
+        return $date;
+    }
+
+    /**
+     * Get the comment text
+     *
+     * @access public
+     * @return string
+     */
+    public function getText() {
+        return $this->data->text;
+    }
+
+    /**
+     * Get the comment's user
+     *
+     * @access public
+     * @return Instagram_User
+     */
+    public function getUser() {
+        if ( !$this->user ) {
+            $this->user = new Instagram_User( $this->data->from, $this->proxy );
+        }
+        return $this->user;
+    }
+
+    /**
+     * Magic toString method
+     *
+     * Return the comment text
+     *
+     * @access public
+     * @return string
+     */
+    public function __toString() {
+        return $this->getText();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Core/ApiAuthException.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Core/ApiAuthException.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Core/ApiAuthException.php	(revision 19561)
@@ -0,0 +1,22 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/ApiException.php');
+
+
+/**
+ * API Auth Exception
+ *
+ * This exception type will be thrown if the access token you are using is no longer valid.
+ *
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/index.php#L39}
+ */
+class Instagram_Core_ApiAuthException extends Instagram_Core_ApiException {}
+
+?>
Index: extensions/instagram2piwigo/include/Instagram/Core/ApiException.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Core/ApiException.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Core/ApiException.php	(revision 19561)
@@ -0,0 +1,60 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+
+/**
+ * API Exception
+ *
+ * This exception type will be thrown for any API error
+ *
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/index.php#L48}
+ */
+class Instagram_Core_ApiException extends Exception {
+
+    /**
+     * Invalid APU URI
+     */
+    const TYPE_NOT_ALLOWED  = 'APINotAllowedError';
+
+    /**
+     * Authorization error
+     */
+    const TYPE_OAUTH        = 'OAuthAccessTokenException';
+
+    /**
+     * Type of error
+     * 
+     * @var string
+     */
+    protected $type;
+
+    /**
+     * Constructor
+     * 
+     * @param string  $message Error message
+     * @param integer $code Error code
+     * @param string  $type Error type
+     * @param Exception $previous Previous exception
+     */
+    public function __construct( $message = null, $code = 0, $type = null, Exception $previous = null ) {
+        $this->type = $type;
+        parent::__construct( $message, $code, $previous );
+    }
+
+    /**
+     * Get error type
+     * 
+     * @return string Get teh error type
+     */
+    public function getType() {
+        return $this->type;
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Core/BaseObjectAbstract.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Core/BaseObjectAbstract.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Core/BaseObjectAbstract.php	(revision 19561)
@@ -0,0 +1,116 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+
+
+/**
+ * Base object that all objects extend from
+ *
+ * Provides core functionality
+ */
+abstract class Instagram_Core_BaseObjectAbstract {
+
+    /**
+     * Object data
+     * 
+     * @var StdClass
+     * @access protected
+     */
+    protected $data;
+
+    /**
+     * Proxy object that does all the API heavy lifting
+     * 
+     * @var Instagram_Core_Proxy
+     * @access protected
+     */
+    protected $proxy = null;
+
+    /**
+     * Get the ID returned from the API
+     *
+     * @return string 
+     * @access public
+     */
+    public function getId() {
+        return $this->data->id;
+    }
+
+    /**
+     * Get the API ID
+     *
+     * Some API objects don't have IDs (tags, some locations )
+     * Those objects define their own getId() methods to return a psuedo ID
+     * Tags = tag name, ID-less locations return null
+     * 
+     * @return string Returns the ID
+     * @access public
+     */
+    public function getApiId() {
+        return $this->getId();
+    }
+
+    /**
+     * Constructor
+     * 
+     * @param StdClass $data Object's data
+     * @param Instagram_Core_Proxy $proxy Object's proxy
+     * @access public
+     */
+    public function __construct( $data, Instagram_Core_Proxy $proxy = null ) {
+        $this->setData( $data );
+        $this->proxy = $proxy;
+    }
+
+    /**
+     * Set the object's data
+     * 
+     * @param StdClass $data Object data
+     * @access public
+     */
+    public function setData( $data ) {
+        $this->data = $data;
+    }
+
+    /**
+     * Get the object's data
+     * 
+     * @return Stdclass Returns the object's data
+     * @access public
+     */
+    public function getData() {
+        return $this->data;
+    }
+
+    /**
+     * Magic method to get data
+     *
+     * This may be removed in future versions
+     * 
+     * @param string $var Variable ot get from the data
+     * @return mixed Returns the variable or null
+     * @access public
+     */
+    public function __get( $var ) {
+        return isset( $this->data->$var ) ? $this->data->$var : null;
+    }
+
+    /**
+     * Set the object's proxy
+     * 
+     * @param Instagram_Core_Proxy $proxy Proxy object
+     * @access public
+     */
+    public function setProxy( Instagram_Core_Proxy $proxy ) {
+        $this->proxy = $proxy;
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Core/Proxy.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Core/Proxy.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Core/Proxy.php	(revision 19561)
@@ -0,0 +1,660 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/ApiException.php');
+include_once(INSTAGRAM_ROOT.'/Core/ApiAuthException.php');
+include_once(INSTAGRAM_ROOT.'/Net/ClientInterface.php');
+include_once(INSTAGRAM_ROOT.'/Net/ApiResponse.php');
+
+
+/**
+ * Proxy
+ *
+ * This class performs all the API calls
+ *
+ * It uses the supplied HTTP client as a default (cURL)
+ * 
+ */
+class Instagram_Core_Proxy {
+
+    /**
+     * HTTP Client
+     * 
+     * @var Instagram_Net_ClientInterface
+     * @access protected
+     */
+    protected $client;
+
+    /**
+     * Instagram access token
+     * 
+     * @var string
+     * @access protected
+     */
+    protected $access_token = null;
+
+    /**
+     * Client ID
+     * 
+     * @var string
+     * @access protected
+     */
+    protected $client_id = null;
+
+    /**
+     * API URL
+     * 
+     * @var string
+     * @access protected
+     */
+    protected $api_url = 'https://api.instagram.com/v1';
+    
+    /**
+     * Cache directory
+     * @var string
+     * @access protected
+     */
+    protected $cache_dir = null;
+    
+    /**
+     * Cache expiration time
+     * @var int
+     * @access protected
+     */
+    protected $cache_expire = 600;
+
+    /**
+     * Constructor
+     *
+     * @param Instagram_Net_ClientInterface $client HTTP Client
+     * @param string $access_token The access token from authentication
+     * @access public
+     */
+    public function __construct( Instagram_Net_ClientInterface $client, $access_token = null ) {
+        $this->client = $client;
+        $this->access_token = $access_token;
+    }
+
+    /**
+     * Enable cache system
+     * @param string $directory where cache is stored
+     * @param int $cache_expire in seconds
+     * @throws Exception
+     * @access public
+     */
+    public function enableCache( $directory, $cache_expire = 600 ) {
+        $directory = realpath($directory);
+        
+        if ($dir = opendir($directory)) {
+            $this->cache_dir = $directory;
+            $this->cache_expire = $cache_expire;
+            
+            while ($file = readdir($dir)) {
+                if (substr($file, -6) == '.cache' && ((filemtime($this->cache_dir . '/' . $file) + $this->cache_expire) < time()) ) {
+                    unlink($this->cache_dir . '/' . $file);
+                }
+            }
+        }
+        else {
+            throw new Exception( "Unable to read cache directory." );
+        }
+    }
+
+    /**
+     * Get cached request, returns false if nothing found
+     * @param string $url
+     * @param array $params
+     * @return string or false
+     * @access private
+     */
+    private function getCached( $url, $params ) {
+        $reqhash = $this->access_token.$url;
+        if ( !empty($params) ) {
+          ksort( $params );
+          $reqhash.= serialize( $params );
+        }
+        $reqhash = sha1( $reqhash );
+        
+        $file = $this->cache_dir . '/' . $reqhash . '.cache';
+        if ( file_exists($file) ) {
+            return file_get_contents( $file );
+        }
+        
+        return false;
+    }
+
+    /**
+     * Cache the unparsed response of a request
+     * @param string $url
+     * @param array $params
+     * @param string $raw_data
+     * @return bool
+     * @access private
+     */
+		private function cache( $url, $params, $raw_data ) {
+        $reqhash = $this->access_token.$url;
+        if ( !empty($params) ) {
+          ksort( $params );
+          $reqhash.= serialize( $params );
+        }
+        $reqhash = sha1( $reqhash );
+      
+        $file = $this->cache_dir . "/" . $reqhash . ".cache";
+        $fstream = fopen( $file, "w" );
+        $result = fwrite( $fstream, $raw_data );
+        fclose( $fstream );
+        
+        return $result;
+    }
+
+    /**
+     * Get the access token
+     * @param array $data Instagram_Auth data
+     * @return string Returns the access token
+     */
+    public function getAccessToken( array $data ) {
+        $response = $this->apiCall(
+            'post',
+            'https://api.instagram.com/oauth/access_token',
+            $data
+        );
+        return $response;
+    }
+
+    /**
+     * Set the access token
+     * 
+     * @param string $access_token The access token
+     * @access public
+     */
+    public function setAccessToken( $access_token ) {
+        $this->access_token = $access_token;
+    }
+
+    /**
+     * Set the client ID
+     * 
+     * @param string $client_id the client ID
+     * @access public
+     */
+    public function setClientID( $client_id ) {
+        $this->client_id = $client_id;
+    }
+
+    /**
+     * Logout of instagram
+     *
+     * This hasn't been implemented by instagram yet
+     * 
+     * @access public
+     */
+    public function logout() {
+        $this->client->get( 'https://instagram.com/accounts/logout/', array() );
+    }
+
+    /**
+     * Get the media associated with an object
+     *
+     * This function is used by the individual object functions
+     * getLocationMedia, getTagMedia, atc...
+     * 
+     * @param  string $api_endpoint API endpoint for the object type
+     * @param  string $id Id of the object to get the media for
+     * @param  array $params Extra parameters for the API call
+     * @return StdClass Returns the raw response
+     * @access protected
+     */
+    protected function getObjectMedia( $api_endpoint, $id, array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/%s/%s/media/recent', $this->api_url, strtolower( $api_endpoint ), $id  ),
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get location media
+     * 
+     * @param string $id Instagram_Location ID
+     * @param array $params Extra params to pass to the API
+     * @return StdClass Returns the location media
+     * @access public
+     */
+    public function getLocationMedia( $id, array $params = null ) {
+        return $this->getObjectMedia( 'Locations', $id, $params );
+    }
+
+    /**
+     * Get tag media
+     * 
+     * @param string $id Instagram_Location ID
+     * @param array $params Extra params to pass to the API
+     * @return StdClass Returns the location media
+     * @access public
+     */
+    public function getTagMedia( $id, array $params = null ) {
+        return $this->getObjectMedia( 'Tags', $id, $params );
+    }
+
+    /**
+     * Get user media
+     * 
+     * @param string $id Instagram_Location ID
+     * @param array $params Extra params to pass to the API
+     * @return StdClass Returns the location media
+     * @access public
+     */
+    public function getUserMedia( $id, array $params = null ) {
+        return $this->getObjectMedia( 'Users', $id, $params );
+    }
+
+    /**
+     * Get user
+     * 
+     * @param string $id Instagram_User ID
+     * @return StdClass Returns the user data
+     * @access public
+     */
+    public function getUser( $id ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/users/%s', $this->api_url, $id )
+        );
+        return $response->getData();
+    }
+
+    /**
+     * Get a user's follows
+     * 
+     * @param string $id Instagram_User's ID
+     * @param array $params Extra params to pass to the API
+     * @return StdClass Returns the user's followers
+     * @access public
+     */
+    public function getUserFollows( $id, array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/users/%s/follows', $this->api_url, $id ),
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get a user's followers
+     * 
+     * @param string $id Instagram_User's ID
+     * @param array $params Extra params to pass to the API
+     * @return StdClass Returns the user's followers
+     * @access public
+     */
+    public function getUserFollowers( $id, array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/users/%s/followed-by', $this->api_url, $id ),
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get media comments
+     * 
+     * @param string $id Instagram_Media ID
+     * @return StdClass Returns the media data
+     * @access public
+     */
+    public function getMediaComments( $id ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/media/%s/comments', $this->api_url, $id )
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get media likes
+     * 
+     * @param string $id Instagram_Media ID
+     * @return StdClass Returns the media likes
+     * @access public
+     */
+    public function getMediaLikes( $id ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/media/%s/likes', $this->api_url, $id )
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get media comments
+     * 
+     * @return StdClass Returns the current user data
+     * @access public
+     */
+    public function getCurrentUser() {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/users/self', $this->api_url )
+        );
+        return $response->getData();
+    }
+
+    /**
+     * Get media
+     * 
+     * @param string $id Instagram_Media ID
+     * @return StdClass Returns the media data
+     * @access public
+     */
+    public function getMedia( $id ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/media/%s', $this->api_url, $id )
+        );
+        return $response->getData();
+    }
+
+    /**
+     * Get tag
+     * 
+     * @param string $id Instagram_Tag ID
+     * @return StdClass Returns the tag data
+     * @access public
+     */
+    public function getTag( $tag ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/tags/%s', $this->api_url, $tag )
+        );
+        return $response->getData();
+    }
+
+    /**
+     * Get location
+     * 
+     * @param string $id Instagram_Location ID
+     * @return StdClass Returns the location data
+     * @access public
+     */
+    public function getLocation( $id ) {
+        $response = $this->apiCall(
+            'get',
+            sprintf( '%s/locations/%s', $this->api_url, $id )
+        );
+        return $response->getData();
+    }
+
+    /**
+     * Search users
+     * 
+     * @param array $params Search params
+     * @return array Returns an array of user data
+     * @access public
+     */
+    public function searchUsers( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/users/search',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Search tags
+     * 
+     * @param array $params Search params
+     * @return array Returns an array of tag data
+     * @access public
+     */
+    public function searchTags( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/tags/search',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Search media
+     * 
+     * @param array $params Search params
+     * @return array Returns an array of media data
+     * @access public
+     */
+    public function searchMedia( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/media/search',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Search locations
+     * 
+     * @param array $params Search params
+     * @return array Returns an array of location data
+     * @access public
+     */
+    public function searchLocations( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/locations/search',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get popular media
+     * 
+     * @param array $params Extra params
+     * @return array Returns an array of popular media data
+     * @access public
+     */
+    public function getPopularMedia( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/media/popular',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get the current user's feed
+     * 
+     * @param array $params Extra params
+     * @return array Returns an array of media data
+     * @access public
+     */
+    public function getFeed( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/users/self/feed',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get the current users follow requests
+     * 
+     * @param $params Extra params (not used in API, here in case it's added)
+     * @return array Returns an array of user data
+     * @access public
+     */
+    public function getFollowRequests( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/users/self/requested-by',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get the current user's liked media
+     * 
+     * @param array $params Extra params
+     * @return array Returns an array of media data
+     * @access public
+     */
+    public function getLikedMedia( array $params = null ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . '/users/self/media/liked',
+            $params
+        );
+        return $response->getRawData();
+    }
+
+    /**
+     * Get a user's relationship to the current user
+     * 
+     * @param string $user_id Instagram_User to check relationship for
+     * @return StdClass Returns the relationship
+     * @access public
+     */
+    public function getRelationshipToCurrentUser( $user_id ) {
+        $response = $this->apiCall(
+            'get',
+            $this->api_url . sprintf( '/users/%s/relationship', $user_id )
+        );
+        return $response->getData();
+    }
+
+    /**
+     * Modify a relationship with the current user
+     * @param string $user_id Instagram_User ID of the user to change the relationship for
+     * @param string $relationship New relationship {@link http://instagram.com/developer/endpoints/relationships/#post_relationship}
+     * @return StdClass Returns the status
+     * @access public
+     */
+    public function modifyRelationship( $user_id, $relationship ) {
+        $response = $this->apiCall(
+            'post',
+            $this->api_url . sprintf( '/users/%s/relationship', $user_id ),
+            array( 'action' => $relationship )
+        );
+        return $response->getData();
+    }
+
+    /**
+     * Add a like form the current user on a media
+     * 
+     * @param string $media_id Instagram_Media ID to like
+     * @return StdClass Returns the status
+     * @access public
+     */
+    public function like( $media_id ) {
+        $this->apiCall(
+            'post',
+            $this->api_url . sprintf( '/media/%s/likes', $media_id )
+        );
+    }
+
+    /**
+     * Delete a like form the current user on a media
+     * 
+     * @param string $media_id Instagram_Media ID to unlike
+     * @return StdClass Returns the status
+     * @access public
+     */
+    public function unLike( $media_id ) {
+        $this->apiCall(
+            'delete',
+            $this->api_url . sprintf( '/media/%s/likes', $media_id )
+        );
+    }
+
+    /**
+     * Add a comment to a media
+     * 
+     * @param string $media_id Instagram_Media ID
+     * @param string $text Instagram_Comment text
+     * @return StdClass Returns the status
+     * @access public
+     */
+    public function addMediaComment( $media_id, $text ) {
+        $this->apiCall(
+            'post',
+            $this->api_url . sprintf( '/media/%s/comments', $media_id ),
+            array( 'text' => $text )
+        );
+    }
+
+    /**
+     * Delete a comment from a media
+     * 
+     * @param string $media_id Instagram_Media ID
+     * @param string $comment_id Instagram_Comment ID to delete
+     * @return StdClass
+     * @access public
+     */
+    public function deleteMediaComment( $media_id, $comment_id ) {
+        $this->apiCall(
+            'delete',
+            $this->api_url . sprintf( '/media/%s/comments/%s', $media_id, $comment_id )
+        );
+    }
+
+    /**
+     * Make a call to the API
+     * 
+     * @param string $method HTTP method to use
+     * @param string $url URL
+     * @param array $params API parameters
+     * @param boolean $throw_exception True to throw exceptoins
+     * @throws Instagram_Core_ApiException, Instagram_Core_ApiAuthException
+     * @return Instagram_Net_ApiResponse Returns teh API response
+     * @access private
+     */
+    private function apiCall( $method, $url, array $params = null, $throw_exception = true ) {
+        if ( $method != 'get' || empty($this->cache_dir) || ($raw_response = $this->getCached($url, $params)) === false ) {
+            $raw_response = $this->client->$method(
+                $url,
+                array(
+                    'access_token'  => $this->access_token,
+                    'client_id'     => isset( $params['client_id'] ) ? $params['client_id'] : $this->client_id
+                ) + (array) $params
+            );
+            
+            if ($method == 'get') {
+                $this->cache($url, $params, $raw_response);
+            }
+        }
+
+        $response = new Instagram_Net_ApiResponse( $raw_response );
+
+        if ( !$response->isValid() ) {
+            if ( $throw_exception ) {
+                if ( $response->getErrorType() == 'OAuthAccessTokenException' ) {
+                    throw new Instagram_Core_ApiAuthException( $response->getErrorMessage(), $response->getErrorCode(), $response->getErrorType() );
+                }
+                else {
+                    throw new Instagram_Core_ApiException( $response->getErrorMessage(), $response->getErrorCode(), $response->getErrorType() );
+                }
+            }
+            else {
+                return false;
+            }
+        }
+        return $response;
+    }
+
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/CurrentUser.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/CurrentUser.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/CurrentUser.php	(revision 19561)
@@ -0,0 +1,376 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+include_once(INSTAGRAM_ROOT.'/Collection/MediaCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/LikedMediaCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/UserCollection.php');
+include_once(INSTAGRAM_ROOT.'/User.php');
+include_once(INSTAGRAM_ROOT.'/Comment.php');
+include_once(INSTAGRAM_ROOT.'/Media.php');
+
+
+/**
+ * Current User
+ *
+ * Holds the currently logged in user
+ *
+ * @see Instagram->getCurrentUser()
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/current_user.php}
+ * {@link http://galengrover.com/projects/PHP-Instagram-API/Examples/?example=current_user.php}
+ */
+class Instagram_CurrentUser extends Instagram_User {
+
+    /**
+     * Holds relationship info for the current user
+     *
+     * @access protected
+     * @var array
+     */
+    protected $relationships = array();
+
+    /**
+     * Holds liked info for the current user
+     *
+     * Current user likes are stored in media objects
+     * If a media is liked after a media has been fetched the like will not be a part of the media object
+     *
+     * @access protected
+     * @var array
+     */
+    protected $liked = array();
+
+    /**
+     * Holds unliked info for the current user
+     *
+     * @access protected
+     * @var array
+     */
+    protected $unliked = array();
+
+    /**
+     * Get the API ID
+     *
+     * @return string Returns "self"
+     * @access public
+     */
+    public function getApiId() {
+        return 'self';
+    }
+
+    /**
+     * Does the current use like a media
+     *
+     * @param Instagram_Media $media Media to query for a like from the current user
+     * @access public
+     */
+    public function likes( Instagram_Media $media ) {
+        return
+            isset( $this->liked[$media->getId()] ) ||
+            (
+                isset( $media->getData()->user_has_liked ) &&
+                (bool)$media->getData()->user_has_liked === true &&
+                !isset( $this->unliked[$media->getId()] )
+            );
+    }
+
+    /**
+     * Add like from current user
+     *
+     * @param Instagram_Media|string $media Media to add a like to from the current Instagram_User
+     * @access public
+     */
+    public function addLike( $media ) {
+        if ( $media instanceof Instagram_Media ) {
+            $media = $media->getId();
+        }
+        $this->proxy->like( $media );
+        unset( $this->unliked[$media] );
+        $this->liked[$media] = true;
+    }
+
+    /**
+     * Delete like from current user
+     *
+     * @param Instagram_Media|string $media Media to delete a like to from the current user
+     * @access public
+     */
+    public function deleteLike( $media ) {
+        if ( $media instanceof Instagram_Media ) {
+            $media = $media->getId();
+        }
+        $this->proxy->unLike( $media );
+        unset( $this->liked[$media] );
+        $this->unliked[$media] = true;
+    }
+
+    /**
+     * Add a comment
+     *
+     * @param \Instagram\Media|string Media to add a comment to
+     * @param string $text Comment text
+     * @access public
+     */
+    public function addMediaComment( $media, $text ) {
+        if ( $media instanceof Instagram_Media ) {
+            $media = $media->getId();
+        }
+        $this->proxy->addMediaComment( $media, $text );
+    }
+
+    /**
+     * Delete a comment
+     *
+     * @param Instagram_Media|string Media to delete a comment from
+     * @param string $text Instagram_Comment text
+     * @access public
+     */
+    public function deleteMediaComment( $media, $comment ) {
+        if ( $media instanceof Instagram_Media ) {
+            $media = $media->getId();
+        }
+        if ( $comment instanceof Instagram_Comment ) {
+            $comment = $comment->getId();
+        }
+        $this->proxy->deleteMediaComment( $media, $comment );
+    }
+
+    /**
+     * Update relationship with a user
+     *
+     * Internal function that updates relationships
+     *
+     * @see Instagram_CurrentUser::follow
+     * @see Instagram_CurrentUser::unFollow
+     * @see Instagram_CurrentUser::getRelationship
+     * @see Instagram_CurrentUser::approveFollowRequest
+     * @see Instagram_CurrentUser::ignoreFollowRequest
+     * @see Instagram_CurrentUser::block
+     * @see Instagram_CurrentUser::unblock
+     *
+     * @param Instagram_User|string Instagram_User object or user id whose relationship you'd like to update
+     * @access protected
+     */
+    protected function updateRelationship( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        if ( !isset( $this->relationships[ $user ] ) ) {
+            $this->relationships[ $user ] = $this->proxy->getRelationshipToCurrentUser( $user );
+        }
+    }
+
+    /**
+     * Follow Instagram_User
+     *
+     * @param Instagram_User|string Instagram_User object or Instagram_User id who should be followed
+     * @return boolean
+     */
+    public function follow( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        $this->updateRelationship( $user );
+        $response = $this->proxy->modifyRelationship( $user, 'follow' );
+        foreach( $response as $r => $v ) {
+            $this->relationships[ $user ]->$r = $v;
+        }
+        return true;
+    }
+
+    /**
+     * Approve follower
+     *
+     * @param Instagram_User|string $user Instagram_User object or Instagram_User id who should be approved for following
+     * @return boolean
+     */
+    public function approveFollowRequest( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        $this->updateRelationship( $user ); 
+        $response = $this->proxy->modifyRelationship( $user, 'approve' );
+        foreach( $response as $r => $v ) {
+            $this->relationships[ $user ]->$r = $v;
+        }
+        return true;
+    }
+
+    /**
+     * Ignore follower
+     *
+     * @param Instagram_User|string $user Instagram_User object or user id who should be ignored
+     * @return boolean
+     */
+    public function ignoreFollowRequest( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        $this->updateRelationship( $user ); 
+        $response = $this->proxy->modifyRelationship( $user, 'ignore' );
+        foreach( $response as $r => $v ) {
+            $this->relationships[ $user ]->$r = $v;
+        }
+        return true;
+    }
+
+    /**
+     * Unfollow user
+     *
+     * @param Instagram_User|string $user Instagram_User object or user id who should be unfollowed
+     * @return boolean
+     */
+    public function unFollow( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        $this->updateRelationship( $user ); 
+        $response = $this->proxy->modifyRelationship( $user, 'unfollow' );
+        foreach( $response as $r => $v ) {
+            $this->relationships[ $user ]->$r = $v;
+        }
+        return true;
+    }
+
+    /**
+     * Block user
+     *
+     * @param Instagram_User|string $user Instagram_User object or user id who should be blocked
+     * @return boolean
+     */
+    public function block( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        $this->updateRelationship( $user ); 
+        $response = $this->proxy->modifyRelationship( $user, 'block' );
+        foreach( $response as $r => $v ) {
+            $this->relationships[ $user ]->$r = $v;
+        }
+        return true;
+    }
+
+    /**
+     * Unblock user
+     *
+     * @param Instagram_User|string $user Instagram_User object or user id who should be unblocked
+     * @return boolean
+     */
+    public function unblock( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        $this->updateRelationship( $user ); 
+        $response = $this->proxy->modifyRelationship( $user, 'unblock' );
+        foreach( $response as $r => $v ) {
+            $this->relationships[ $user ]->$r = $v;
+        }
+        return true;
+    }
+
+    /**
+     * Get relationship
+     *
+     * Get the complete relationship to a user
+     *
+     * @param Instagram_User|string $user Instagram_User object or user id to get the relationship details of
+     * @return StdClass
+     */
+    public function getRelationship( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        $this->updateRelationship( $user );
+        return $this->relationships[ $user ];
+    }
+
+    /**
+     * Get follow request
+     *
+     * Get the users that have requested to follow the current user
+     *
+     * @return Instagram_Collection_UserCollection
+     */
+    public function getFollowRequests() {
+        return new Instagram_Collection_UserCollection( $this->proxy->getFollowRequests(), $this->proxy );
+    }
+
+    /**
+     * Check following status
+     *
+     * Check if hte current user is following a user
+     *
+     * @param \Instagram\User|string $user User object or user id to check the following status of
+     * @return boolean
+     */
+    public function isBlocking( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        return $this->getRelationship( $user )->incoming_status == 'blocked_by_you';
+    }
+
+    /**
+     * Check following status
+     *
+     * Check if hte current Instagram_User is following a Instagram_User
+     *
+     * @param Instagram_User|string $user Instagram_User object or user id to check the following status of
+     * @return boolean
+     */
+    public function isFollowing( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        return $this->getRelationship( $user )->outgoing_status == 'follows';
+    }
+
+    /**
+     * Check followed by status
+     *
+     * Check if the current user is followed by a user
+     *
+     * @param Instagram_User|string $user Instagram_User object or user id to check the followed by status of
+     * @return boolean
+     */
+    public function isFollowedBy( $user ) {
+        if ( $user instanceof Instagram_User ) {
+            $user = $user->getId();
+        }
+        return $this->getRelationship( $user )->incoming_status == 'followed_by';
+    }
+
+    /**
+     * Get the current user's feed
+     *
+     * This can be paginated with the next_max_id param obtained from Instagram_Collection_MediaCollection->getNext()
+     *
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_Collection_MediaCollection
+     * @access public
+     */
+    public function getFeed( array $params = null ) {
+        return new Instagram_Collection_MediaCollection( $this->proxy->getFeed( $params ), $this->proxy );
+    }
+
+    /**
+     * Get the current user's liked media
+     *
+     * This can be paginated with the next_max_like_id param obtained from Instagram_Collection_MediaCollection->getNext()
+     *
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_Collection_MediaCollection
+     * @access public
+     */
+    public function getLikedMedia( array $params = null ) {
+        return  new Instagram_Collection_LikedMediaCollection( $this->proxy->getLikedMedia( $params ), $this->proxy );
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Helper.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Helper.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Helper.php	(revision 19561)
@@ -0,0 +1,95 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Comment.php');
+include_once(INSTAGRAM_ROOT.'/CurrentUser.php');
+include_once(INSTAGRAM_ROOT.'/Media.php');
+
+
+/**
+ * Helper class
+ *
+ * Example:
+ *
+ * $tags_closure = function($m){
+ *     return sprintf( '<a href="?example=tag.php&tag=%s">%s</a>', $m[1], $m[0] );
+ * };
+ *
+ * $mentions_closure = function($m){
+ *    return sprintf( '<a href="?example=user.php&user=%s">%s</a>', $m[1], $m[0] );
+ * };
+ *
+ * echo \Instagram\Helper::parseTagsAndMentions( $media->getCaption(), $tags_closure, $mentions_closure )
+ */
+class Instagram_Helper {
+
+    /**
+     * Parse mentions in a string
+     *
+     * Finds mentions in a string (@mention) and applies a callback function each one
+     *
+     * @param string $text Text to parse
+     * @param Closure $callback Function to apply to each mention
+     * @return string Returns the text after the callback have been applied to each mention
+     * @access public
+     */
+    public static function parseMentions( $text, Closure $callback ) {
+        return preg_replace_callback( '~@(.+?)(?=\b)~', $callback, $text );
+    }
+
+    /**
+     * Parse tags in a string
+     *
+     * Finds tags in a string (#username) and applies a callback function each one
+     *
+     * @param string $text Text to parse
+     * @param Closure $callback Function to apply to each tag
+     * @return string Returns the text after the callback have been applied to each tag
+     * @access public
+     */
+    public static function parseTags( $text, Closure $callback ) {
+        return preg_replace_callback( '~#(.+?)(?=\b)~', $callback, $text );
+    }
+
+    /**
+     * Parse mentions and tags in a string
+     *
+     * Finds mentions and tags in a string (@mention, #tag) and applies a callback function each one
+     *
+     * @param string $text Text to parse
+     * @param Closure $tags_callback Function to apply to each tag
+     * @param Closure $mentions_callback Function to apply to each mention
+     * @return string Returns the text after the callbacks have been applied to tags and mentions
+     * @access public
+     */
+    public static function parseTagsAndMentions( $text, Closure $tags_callback, Closure $mentions_callback ) {
+        $text = self::parseTags( $text, $tags_callback );
+        $text = self::parseMentions( $text, $mentions_callback );
+        return $text;
+    }
+
+    /**
+     * Is the comment deletable
+     *
+     * Checks if a comment is deletable by checking if the current user posted the comment
+     * of if the comment was added to one of the current user's media
+     * 
+     * @param  Instagram_Comment $Instagram_Comment The comment
+     * @param  Instagram_Media $Instagram_Media The media the comment was added to
+     * @param  Instagram_CurrentUser $current_user Current user
+     * @access public
+     */
+    public function commentIsDeletable( Instagram_Comment $comment, Instagram_Media $media, Instagram_CurrentUser $current_user ) {
+        return
+            $comment->getUser()->getId() == $current_user->getId() ||
+            $media->getUser()->getId() == $current_user->getId();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Instagram.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Instagram.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Instagram.php	(revision 19561)
@@ -0,0 +1,278 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+defined('INSTAGRAM_ROOT') or define('INSTAGRAM_ROOT', realpath(dirname(__FILE__)));
+
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+include_once(INSTAGRAM_ROOT.'/Core/ApiException.php');
+include_once(INSTAGRAM_ROOT.'/Net/ClientInterface.php');
+include_once(INSTAGRAM_ROOT.'/Net/CurlClient.php');
+include_once(INSTAGRAM_ROOT.'/Collection/MediaSearchCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/TagCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/UserCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/MediaCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/LocationCollection.php');
+include_once(INSTAGRAM_ROOT.'/CurrentUser.php');
+include_once(INSTAGRAM_ROOT.'/User.php');
+include_once(INSTAGRAM_ROOT.'/Media.php');
+include_once(INSTAGRAM_ROOT.'/Tag.php');
+include_once(INSTAGRAM_ROOT.'/Location.php');
+
+
+/**
+ * Instagram!
+ *
+ * All objects are created through this object
+ */
+class Instagram extends Instagram_Core_BaseObjectAbstract {
+
+    /**
+     * Constructor
+     *
+     * You can supply a client, proxy, and an access token via the config array
+     *
+     * @param string $access_token Instagram access token obtained through authentication
+     * @param Instagram_Net_ClientInterface $client Client object used to connect to the API
+     * @access public
+     */
+    public function __construct( $access_token = null, Instagram_Net_ClientInterface $client = null ) {
+        $this->proxy = new Instagram_Core_Proxy( $client ? $client : new Instagram_Net_CurlClient, $access_token ? $access_token : null );
+    }
+    
+    /**
+     * Enable cache system
+     * @see Instagram_Core_Proxy->enableCache()
+     */
+    function enableCache ( $directory, $cache_expire = 600 ) {
+        $this->proxy->enableCache( $directory, $cache_expire );
+    }
+
+    /**
+     * Set the access token
+     *
+     * Most API calls require an access ID
+     * 
+     * @param string $access_token
+     * @access public
+     */
+    public function setAccessToken( $access_token ) {
+        $this->proxy->setAccessToken( $access_token );
+    }
+
+    /**
+     * Set the client ID
+     *
+     * Some API calls can be called with only a Client ID
+     * 
+     * @param string $client_id Client ID
+     * @access public
+     */
+    public function setClientID( $client_id ) {
+        $this->proxy->setClientId( $client_id );
+    }
+
+    /**
+     * Logout
+     *
+     * This doesn't actually work yet, waiting for Instagram to implement it in their API
+     *
+     * @access public
+     */
+    public function logout() {
+        $this->proxy->logout();
+    }
+
+    /**
+     * Get user
+     *
+     * Retrieve a user given his/her ID
+     *
+     * @param int $id ID of the user to retrieve
+     * @return Instagram_User
+     * @access public
+     */
+    public function getUser( $id ) {
+        $user = new User( $this->proxy->getUser( $id ), $this->proxy );
+        return $user;
+    }
+
+    /**
+     * Get user by Username
+     *
+     * Retrieve a user given their username
+     *
+     * @param string $username Username of the user to retrieve
+     * @return Instagram_User
+     * @access public
+     * @throws Instagram_ApiException
+     */
+    public function getUserByUsername( $username ) {
+        $user = $this->searchUsers( $username, array( 'count' => 1 ) )->getItem( 0 );
+        if ( $user ) {
+            return $this->getUser( $user->getId() );
+        }
+        throw new Instagram_Core_ApiException( 'username not found', 400, 'InvalidUsername' );
+    }
+
+    /**
+     * Check if a user is private
+     *
+     * @return bool
+     * @access public
+     */
+    public function isUserPrivate( $user_id ) {
+        $relationship = $this->proxy->getRelationshipToCurrentUser( $user_id );
+        return (bool)$relationship->target_user_is_private;
+    }
+
+    /**
+     * Get media
+     *
+     * Retreive a media object given it's ID
+     *
+     * @param int $id ID of the media to retrieve
+     * @return Instagram_Media
+     * @access public
+     */
+    public function getMedia( $id ) {
+        $media = new Instagram_Media( $this->proxy->getMedia( $id ), $this->proxy );
+        return $media;
+    }
+
+    /**
+     * Get Tag
+     *
+     * @param string $tag Tag to retrieve
+     * @return \Instagram\Tag
+     * @access public
+     */
+    public function getTag( $tag ) {
+        $tag = new Instagram_Tag( $this->proxy->getTag( $tag ), $this->proxy );
+        return $tag;
+    }
+
+    /**
+     * Get location
+     *
+     * Retreive a location given it's ID
+     *
+     * @param int $id ID of the location to retrieve
+     * @return Instagram_Location
+     * @access public
+     */
+    public function getLocation( $id ) {
+        $location = new Instagram_Location( $this->proxy->getLocation( $id ), $this->proxy );
+        return $location;
+    }
+
+    /**
+     * Get current user
+     *
+     * Returns the current user wrapped in a Instagram_CurrentUser object
+     *
+     * @return Instagram_CurrentUser
+     * @access public
+     */
+    public function getCurrentUser() {
+        $current_user = new Instagram_CurrentUser( $this->proxy->getCurrentUser(), $this->proxy );
+        return $current_user;
+    }
+
+    /**
+     * Get popular media
+     *
+     * Returns current popular media
+     *
+     * @return Instagram_Collection_MediaCollection
+     * @access public
+     */
+    public function getPopularMedia() {
+        $popular_media = new Instagram_Collection_MediaCollection( $this->proxy->getPopularMedia(), $this->proxy );
+        return $popular_media;
+    }
+
+    /**
+     * Search users
+     *
+     * Search the users by username
+     *
+     * @param string $query Search query
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_Collection_UserCollection
+     * @access public
+     */
+    public function searchUsers( $query, array $params = null ) {
+        $params = (array)$params;
+        $params['q'] = $query;
+        $user_collection = new Instagram_Collection_UserCollection( $this->proxy->searchUsers( $params ), $this->proxy );
+        return $user_collection;
+    }
+
+    /**
+     * Search Media
+     *
+     * Returns media that is a certain distance from a given lat/lng
+     *
+     * To specify a distance, pass the distance (in meters) in the $params
+     *
+     * Default distance is 1000m
+     *
+     * @param float $lat Latitude of the search
+     * @param float $lng Longitude of the search
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_Collection_MediaSearchCollection
+     * @access public
+     */
+    public function searchMedia( $lat, $lng, array $params = null ) {
+        $params = (array)$params;
+        $params['lat'] = (float)$lat;
+        $params['lng'] = (float)$lng;
+        $media_collection =  new Instagram_Collection_MediaSearchCollection( $this->proxy->searchMedia( $params ), $this->proxy );
+        return $media_collection;
+    }
+
+    /**
+     * Search for tags
+     *
+     * @param string $query Search query
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_Collection_TagCollection
+     * @access public
+     */
+    public function searchTags( $query, array $params = null ) {
+        $params = (array)$params;
+        $params['q'] = $query;
+        $tag_collection =  new Instagram_Collection_TagCollection( $this->proxy->searchTags( $params ), $this->proxy );
+        return $tag_collection;
+    }
+
+    /**
+     * Search Locations
+     *
+     * Returns locations that are a certain distance from a given lat/lng
+     *
+     * To specify a distance, pass the distance (in meters) in the $params
+     *
+     * Default distance is 1000m
+     *
+     * @param float $lat Latitude of the search
+     * @param float $lng Longitude of the search
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_LocationCollection
+     * @access public
+     */
+    public function searchLocations( $lat, $lng, array $params = null ) {
+        $params = (array)$params;
+        $params['lat'] = (float)$lat;
+        $params['lng'] = (float)$lng;
+        $location_collection = new Instagram_Collection_LocationCollection( $this->proxy->searchLocations( $params ), $this->proxy );
+        return $location_collection;
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Location.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Location.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Location.php	(revision 19561)
@@ -0,0 +1,98 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+include_once(INSTAGRAM_ROOT.'/Collection/MediaCollection.php');
+
+
+/**
+ * Location class
+ *
+ * Some media has a location associated to it. This location will have an ID and a name.
+ * Some media has no location associated, but has a lat/lng. These location objects will return null or '' for certain method calls
+ *
+ * @see Instagram->getCurrentUser()
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/location.php}
+ * {@link http://galengrover.com/projects/PHP-Instagram-API/Examples/?example=location.php}
+ */
+class Instagram_Location extends Instagram_Core_BaseObjectAbstract {
+
+    /**
+     * Get location media
+     *
+     * Retrieve the recent media posted to a given location
+     *
+     * This can be paginated with the next_max_id param obtained from Instagram_Collection_MediaCollection->getNext()
+     *
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_Collection_MediaCollection
+     * @access public
+     */
+    public function getMedia( array $params = null ) {
+        return new Instagram_Collection_MediaCollection( $this->Instagram_Core_Proxy->getLocationMedia( $this->getApiId(), $params ), $this->Instagram_Core_Proxy );
+    }
+
+    /**
+     * Get location ID
+     *
+     * @return string|null
+     * @access public
+     */
+    public function getId() {
+        return isset( $this->data->id ) ? $this->data->id : null;
+    }
+
+    /**
+     * Get location name
+     *
+     * @return string|null
+     * @access public
+     */
+    public function getName() {
+        return isset( $this->data->name ) ? $this->data->name : null;
+    }
+
+    /**
+     * Get location longitude
+     *
+     * Get the longitude of the location
+     *
+     * @return string|null
+     * @access public
+     */
+    public function getLat() {
+        return isset( $this->data->latitude ) && is_float( $this->data->latitude ) ? $this->data->latitude : null;
+    }
+
+    /**
+     * Get location latitude
+     *
+     * Get the latitude of the location
+     *
+     * @return string|null
+     * @access public
+     */
+    public function getLng() {
+        return isset( $this->data->longitude ) && is_float( $this->data->longitude ) ? $this->data->longitude : null;
+    }
+
+    /**
+     * Magic toString method
+     *
+     * Returns the location's name
+     *
+     * @return string
+     * @access public
+     */
+    public function __toString() {
+        return $this->getName() ? $this->getName() : '';
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Media.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Media.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Media.php	(revision 19561)
@@ -0,0 +1,266 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/BaseObjectAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Core/BaseObjectAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Collection/CommentCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/TagCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/UserCollection.php');
+include_once(INSTAGRAM_ROOT.'/Comment.php');
+include_once(INSTAGRAM_ROOT.'/User.php');
+include_once(INSTAGRAM_ROOT.'/Location.php');
+
+
+/**
+ * Media class
+ *
+ * @see Instagram->getLocation()
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/media.php}
+ * {@link http://galengrover.com/projects/PHP-Instagram-API/Examples/?example=media.php}
+ */
+class Instagram_Media extends Instagram_Core_BaseObjectAbstract {
+
+    /**
+     * User cache
+     * 
+     * @var Instagram_User
+     */
+    protected $user = null;
+
+    /**
+     * Comments cache
+     *
+     * @var Instagram_Collection_CommentCollection
+     */
+    protected $comments = null;
+
+    /**
+     * Location cache
+     *
+     * @var Instagram_Location
+     */
+    protected $location = null;
+
+    /**
+     * Tags cache
+     *
+     * @var Instagram_Collection_TagCollection
+     */
+    protected $tags = null;
+
+    /**
+     * Get the thumbnail
+     *
+     * @return string
+     * @access public
+     */
+    public function getThumbnail() {
+        return $this->data->images->thumbnail;
+    }
+
+    /**
+     * Get the standard resolution image
+     *
+     * @return string
+     * @access public
+     */
+    public function getStandardRes() {
+        return $this->data->images->standard_resolution;
+    }
+
+    /**
+     * Get the low resolution image
+     *
+     * @return string
+     * @access public
+     */
+    public function getLowRes() {
+        return $this->data->images->low_resolution;
+    }
+
+    /**
+     * Get the media caption
+     *
+     * @return string
+     * @access public
+     */
+    public function getCaption() {
+        if ( $this->data->caption ) {
+            return new Instagram_Comment( $this->data->caption );
+        }
+        return null;
+    }
+
+    /**
+     * Get the created time
+     *
+     * @param string $format {@link http://php.net/manual/en/function.date.php}
+     * @return string
+     * @access public
+     */
+    public function getCreatedTime( $format = null ) {
+        if ( $format ) {
+            $date = date( $format, $this->data->created_time );
+        }
+        else {
+            $date = $this->data->created_time;
+        }
+        return $date;
+    }
+
+    /**
+     * Get the user that posted the media
+     *
+     * @return Instagram_User
+     * @access public
+     */
+    public function getUser() {
+        if ( !$this->user ) {
+            $this->user = new Instagram_User( $this->data->user, $this->proxy );
+        }
+        return $this->user;
+    }
+
+    /**
+     * Get media comments
+     *
+     * Return all the comments associated with a media
+     *
+     * @return Instagram_CommentCollection
+     * @access public
+     */
+    public function getComments() {
+        if ( !$this->comments ) {
+            $this->comments = new Instagram_Collection_CommentCollection( $this->proxy->getMediaComments( $this->getApiId() ), $this->proxy );
+        }
+        return $this->comments;
+    }
+
+    /**
+     * Get the media filter
+     *
+     * @return string
+     * @access public
+     */
+    public function getFilter() {
+        return $this->data->filter;
+    }
+
+    /**
+     * Get the media's tags
+     *
+     * @return Instagram_Collection_TagCollection
+     * @access public
+     */
+    public function getTags() {
+        if ( !$this->tags ) {
+            $this->tags = new Instagram_Collection_TagCollection( $this->data->tags, $this->proxy );
+        }
+        return $this->tags;
+    }
+
+    /**
+     * Get the media's link
+     *
+     * @return string
+     * @access public
+     */
+    public function getLink() {
+        return $this->data->link;
+    }
+
+    /**
+     * Get the media's likes count
+     *
+     * @return int
+     * @access public
+     */
+    public function getLikesCount() {
+        return (int)$this->data->likes->count;
+    }
+
+    /**
+     * Get media likes
+     *
+     * Media objects contain the first 10 likes. You can get these likes by passing `false`
+     * to this method. Using the internal likes of a media object cause issues when liking/disliking media.
+     *
+     * @param bool $fetch_from_api Query the API or use internal
+     * @return Instagram_UserCollection
+     * @access public
+     */
+    public function getLikes( $fetch_from_api = true ) {
+        if ( !$fetch_from_api ) {
+            return new Instagram_Collection_UserCollection( $this->data->likes );
+        }
+        $user_collection = new Instagram_Collection_UserCollection( $this->proxy->getMediaLikes( $this->getApiId() ), $this->proxy );
+        $user_collection->setProxies( $this->proxy );
+        $this->likes = $user_collection;
+        return $this->likes;
+    }
+
+    /**
+     * Get location status
+     *
+     * Will return true if any location data is associated with the media
+     *
+     * @return bool
+     * @access public
+     */
+    public function hasLocation() {
+        return isset( $this->data->location->latitude ) && isset( $this->data->location->longitude );
+    }
+
+    /**
+     * Get location status
+     *
+     * Will return true if the media has a named location attached to it
+     *
+     * Some media only has lat/lng data
+     *
+     * @return bool
+     * @access public
+     */
+    public function hasNamedLocation() {
+        return isset( $this->data->location->id );
+    }
+
+    /**
+     * Get the location
+     *
+     * Returns the location associated with the media or null if no location data is available
+     *
+     * @param bool $force_fetch Don't use the cache
+     * @return Instagram_Location|null
+     * @access public
+     */
+    public function getLocation( $force_fetch = false ) {
+        if ( !$this->hasLocation() ) {
+            return null;
+        }
+        if ( !$this->location || (bool)$force_fetch ) {
+            $this->location = new Instagram_Location( $this->data->location, isset( $this->data->location->id ) ? $this->proxy : null );
+        }
+        return $this->location;
+    }
+
+    /**
+     * Magic toString method
+     *
+     * Returns the media's thumbnail url
+     *
+     * @return string
+     * @access public
+     */
+    public function __toString() {
+        return $this->getThumbnail()->url;
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Net/ApiResponse.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Net/ApiResponse.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Net/ApiResponse.php	(revision 19561)
@@ -0,0 +1,152 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+
+/**
+ * API Response
+ *
+ * Holds the API response
+ */
+class Instagram_Net_ApiResponse {
+
+    /**
+     * Response
+     *
+     * This is the response from the API
+     *
+     * @var StdClass
+     * @access protected
+     */
+    protected $response;
+
+    /**
+     * Constructor
+     *
+     * @param $raw_response Response from teh API
+     * @access public
+     */
+    public function __construct( $raw_response ){
+        $this->response = json_decode( $raw_response );
+        if ( !$this->isValidApiResponse() ) {
+            $this->response = new StdClass;
+            $this->response->meta = new StdClass;
+            $this->response->meta->error_type = 'UnknownAPiError';
+            $this->response->meta->code = 555;
+            $this->response->meta->error_message = 'Unknown error';
+        }
+    }
+
+    /**
+     * Is Valid
+     *
+     * Returns true if the API returned an error, otherwise false
+     *
+     * @return boolean
+     * @access public
+     */
+    public function isValid() {
+        return
+            $this->response instanceof StdClass &&
+            !isset( $this->response->meta->error_type ) &&
+            !isset( $this->response->error_type );
+    }
+    /**
+     * Is Valid API Response
+     *
+     * Returns true if the response was a valid response from the API, otherwise false
+     *
+     * @return boolean
+     * @access public
+     */
+    public function isValidApiResponse() {
+        return $this->response instanceof StdClass;
+    }
+
+    /**
+     * Get the response data
+     *
+     * @return mixed Return the response's data or null
+     * @access public
+     */
+    public function getData() {
+        return isset( $this->response->data ) ? $this->response->data : null;
+    }
+
+    /**
+     *  Get the raw response
+     *
+     * @return mixed Returns the response or null
+     * @access public
+     */
+    public function getRawData() {
+        return isset( $this->response ) ? $this->response : null;
+    }
+
+
+
+    /**
+     * Get the response's error message
+     *
+     * @return mixed Returns the error message or null
+     * @access public
+     */
+    public function getErrorMessage() {
+        if ( isset( $this->response->error_message ) ) {
+            return $this->response->error_message;
+        }
+        if( isset( $this->response->meta->error_message ) ) {
+            return $this->response->meta->error_message;
+        }
+        return null;
+    }
+
+    /**
+     * Get the error code
+     *
+     * @return mixed Returns the error code or null
+     * @access public
+     */
+    public function getErrorCode() {
+        if ( isset( $this->response->code ) ) {
+            return $this->response->code;
+        }
+        if( isset( $this->response->meta->code ) ) {
+            return $this->response->meta->code;
+        }
+        return null;
+    }
+
+    /**
+     * Get the error type
+     * 
+     * @return mixed Returns the error type or null
+     * @access public
+     */
+    public function getErrorType() {
+        if ( isset( $this->response->error_type ) ) {
+            return $this->response->error_type;
+        }
+        if( isset( $this->response->meta->error_type ) ) {
+            return $this->response->meta->error_type;
+        }
+        return null;
+    }
+
+    /**
+     * Magic to string method
+     *
+     * @return string Return the json encoded response
+     * @access public
+     */
+    public function __toString() {
+        return json_encode( $this->response );
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Net/ClientInterface.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Net/ClientInterface.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Net/ClientInterface.php	(revision 19561)
@@ -0,0 +1,26 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+
+/**
+ * Client Interface
+ *
+ * All clients must implement this interface
+ *
+ * The 4 http functions just need to return the raw data from the API
+ */
+interface Instagram_Net_ClientInterface {
+
+    function get( $url, array $data = null );
+    function post( $url, array $data = null );
+    function put( $url, array $data = null );
+    function delete( $url, array $data = null );
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Net/CurlClient.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Net/CurlClient.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Net/CurlClient.php	(revision 19561)
@@ -0,0 +1,124 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/ApiException.php');
+include_once(INSTAGRAM_ROOT.'/Net/ClientInterface.php');
+
+
+/**
+ * Curl Client
+ *
+ * Uses curl to access the API
+ */
+class Instagram_Net_CurlClient implements Instagram_Net_ClientInterface {
+
+    /**
+     * Curl Resource
+     *
+     * @var curl resource
+     */
+    protected $curl = null;
+
+    /**
+     * Constructor
+     *
+     * Initializes the curl object
+     */
+    function __construct(){
+        $this->initializeCurl();
+    }
+
+    /**
+     * GET
+     *
+     * @param string $url URL to send get request to
+     * @param array $data GET data
+     * @return Instagram_Net_Response
+     * @access public
+     */
+    public function get( $url, array $data = null ){
+        curl_setopt( $this->curl, CURLOPT_CUSTOMREQUEST, 'GET' );
+        curl_setopt( $this->curl, CURLOPT_URL, sprintf( "%s?%s", $url, http_build_query( $data ) ) );
+        return $this->fetch();
+    }
+
+    /**
+     * POST
+     *
+     * @param string $url URL to send post request to
+     * @param array $data POST data
+     * @return Instagram_Net_Response
+     * @access public
+     */
+    public function post( $url, array $data = null ) {
+        curl_setopt( $this->curl, CURLOPT_CUSTOMREQUEST, 'POST' );
+        curl_setopt( $this->curl, CURLOPT_URL, $url );
+        curl_setopt( $this->curl, CURLOPT_POSTFIELDS, http_build_query( $data ) );
+        return $this->fetch();
+    }
+
+    /**
+     * PUT
+     *
+     * @param string $url URL to send put request to
+     * @param array $data PUT data
+     * @return Instagram_Net_Response
+     * @access public
+     */
+    public function put( $url, array $data = null  ){
+        curl_setopt( $this->curl, CURLOPT_CUSTOMREQUEST, 'PUT' );
+    }
+
+    /**
+     * DELETE
+     *
+     * @param string $url URL to send delete request to
+     * @param array $data DELETE data
+     * @return Instagram_Net_Response
+     * @access public
+     */
+    public function delete( $url, array $data = null  ){
+        curl_setopt( $this->curl, CURLOPT_URL, sprintf( "%s?%s", $url, http_build_query( $data ) ) );
+        curl_setopt( $this->curl, CURLOPT_CUSTOMREQUEST, 'DELETE' );
+        return $this->fetch();
+    }
+
+    /**
+     * Initialize curl
+     *
+     * Sets initial parameters on the curl object
+     *
+     * @access protected
+     */
+    protected function initializeCurl() {
+        $this->curl = curl_init();
+        curl_setopt( $this->curl, CURLOPT_RETURNTRANSFER, true );
+        curl_setopt( $this->curl, CURLOPT_SSL_VERIFYPEER, false );
+    }
+
+    /**
+     * Fetch
+     *
+     * Execute the curl object
+     *
+     * @return StdClass
+     * @access protected
+     * @throws Instagram_Core_ApiException
+     */
+    protected function fetch() {
+        $raw_response = curl_exec( $this->curl );
+        $error = curl_error( $this->curl );
+        if ( $error ) {
+            throw new Instagram_Core_ApiException( $error, 666, 'CurlError' );
+        }
+        return $raw_response;
+    }
+    
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/Tag.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/Tag.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/Tag.php	(revision 19561)
@@ -0,0 +1,84 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+include_once(INSTAGRAM_ROOT.'/Core/BaseObjectAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Collection/TagMediaCollection.php');
+
+
+/**
+ * Tag class
+ *
+ * @see Instagram->getTag()
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/tag.php}
+ * {@link http://galengrover.com/projects/PHP-Instagram-API/Examples/?example=tag.php}
+ */
+class Instagram_Tag extends Instagram_Core_BaseObjectAbstract {
+
+    /**
+     * Get tag media
+     *
+     * Retrieve the recent media posted with this tag
+     *
+     * This can be paginated with the next_max_id param obtained from Instagram_Collection_MediaCollection->getNext()
+     *
+     * @param array $params Optional params to pass to the endpoint
+     * @return Instagram_Collection_MediaCollection
+     * @access public
+     */
+    public function getMedia( array $params = null ) {
+        return new Instagram_Collection_TagMediaCollection( $this->proxy->getTagMedia( $this->getApiId(), $params ), $this->proxy );
+    }
+
+    /**
+     * Get media count
+     *
+     * @return int
+     * @access public
+     */
+    public function getMediaCount() {
+        return (int)$this->data->media_count;
+    }
+
+    /**
+     * Get tag name
+     *
+     * @return string
+     * @access public
+     */
+    public function getName() {
+        return $this->data->name;
+    }
+
+    /**
+     * Get ID
+     *
+     * The ID for a tag is it's name, so return the name
+     *
+     * @return string
+     * @access public
+     */
+    public function getId() {
+        return $this->getName();
+    }
+
+    /**
+     * Magic toString method
+     *
+     * Return the tag name
+     *
+     * @return string
+     * @access public
+     */
+    public function __toString() {
+        return $this->getName();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/Instagram/User.php
===================================================================
--- extensions/instagram2piwigo/include/Instagram/User.php	(revision 19561)
+++ extensions/instagram2piwigo/include/Instagram/User.php	(revision 19561)
@@ -0,0 +1,191 @@
+<?php
+
+/**
+* Instagram PHP
+* @author Galen Grover <galenjr@gmail.com>
+* @license http://opensource.org/licenses/mit-license.php The MIT License
+*/
+
+
+include_once(INSTAGRAM_ROOT.'/Core/Proxy.php');
+include_once(INSTAGRAM_ROOT.'/Core/BaseObjectAbstract.php');
+include_once(INSTAGRAM_ROOT.'/Collection/MediaCollection.php');
+include_once(INSTAGRAM_ROOT.'/Collection/UserCollection.php');
+
+
+/**
+ * User class
+ *
+ * @see Instagram->getUser()
+ * {@link https://github.com/galen/PHP-Instagram-API/blob/master/Examples/user.php}
+ * {@link http://galengrover.com/projects/PHP-Instagram-API/Examples/?example=user.php}
+ */
+class Instagram_User extends Instagram_Core_BaseObjectAbstract {
+
+    /**
+     * Get the user's username
+     *
+     * @return string
+     * @access public
+     */
+    public function getUserName() {
+        return $this->data->username;
+    }
+
+    /**
+     * Get the user's full name
+     *
+     * @return string|null
+     * @access public
+     */
+    public function getFullName( $forced = false ) {
+        return isset( $this->data->full_name ) ? $this->data->full_name : ( $forced ? $this->data->username : null );
+    }
+
+    /**
+     * Get the user's profile picture
+     *
+     * @return string
+     * @access public
+     */
+    public function getProfilePicture() {
+        return $this->data->profile_picture;
+    }
+
+    /**
+     * Get the user's biography
+     *
+     * @return string
+     * @access public
+     */
+    public function getBio() {
+        return $this->data->bio;
+    }
+
+    /**
+     * Get the user's website
+     *
+     * @return string
+     * @access public
+     */
+    public function getWebsite() {
+        return $this->data->website;
+    }
+
+    /**
+     * Get the user's counts
+     *
+     * @return StdClass|null
+     * @access public
+     */
+    public function getCounts() {
+        if ( !$this->isCompleteUser() ) {
+            $this->updateData();
+        }
+        return isset( $this->data->counts ) ? $this->data->counts : null;
+    }
+
+    /**
+     * Get the user's following count
+     *
+     * @return int
+     * @access public
+     */
+    public function getFollowsCount() {
+        return (int)$this->getCounts()->follows;
+    }
+
+    /**
+     * Get the user's followers count
+     *
+     * @return int
+     * @access public
+     */
+    public function getFollowersCount() {
+        return (int)$this->getCounts()->followed_by;
+    }
+
+    /**
+     * Get the user's media count
+     *
+     * @return int
+     * @access public
+     */
+    public function getMediaCount() {
+        return (int)$this->getCounts()->media;
+    }
+
+    /**
+     * Update user data
+     *
+     * Sometimes user object are incomplete. For instance when getting a media object's comments
+     * the users associated with the comments won't have all their data
+     *
+     * @access public
+     */
+    public function updateData() {
+        $this->setData( $this->proxy->getUser( $this->getApiId() ) );
+    }
+
+    /**
+     * Return if the user is complete
+     *
+     * @see Instagram_User::updateData()
+     *
+     * @return bool
+     * @access protected
+     */
+    protected function isCompleteUser() {
+        return isset( $this->data->counts );
+    }
+
+    /**
+     * Get the user's media
+     *
+     * This can be paginated with the next_max_id param obtained from Instagram_Collection_MediaCollection->getNext()
+     *
+     * @return Instagram_Collection_MediaCollection
+     * @access public
+     */
+    public function getMedia( array $params = null ) {
+        return new Instagram_Collection_MediaCollection( $this->proxy->getUserMedia( $this->getApiId(), $params ), $this->proxy );
+    }
+
+    /**
+     * Get the users that the user follows
+     *
+     * This can be paginated with the next_cursor param obtained from Instagram_Collection_UserCollection->getNext()
+     *
+     * @return Instagram_Collection_UserCollection
+     * @access public
+     */
+    public function getFollows( array $params = null ) {
+        return new Instagram_Collection_UserCollection( $this->proxy->getUserFollows( $this->getApiId(), $params ), $this->proxy );
+    }
+
+    /**
+     * Get the user's that follow this user
+     *
+     * This can be paginated with the next_cursor param obtained from Instagram_Collection_UserCollection->getNext()
+     *
+     * @return Instagram_Collection_UserCollection
+     * @access public
+     */
+    public function getFollowers( array $params = null ) {
+        return new Instagram_Collection_UserCollection( $this->proxy->getUserFollowers( $this->getApiId(), $params ), $this->proxy );
+    }
+
+    /**
+     * Magic toString method
+     * 
+     * Get the user's username
+     *
+     * @return Instagram_Collection_Collection
+     * @access public
+     */
+    public function __toString() {
+        return $this->getUserName();
+    }
+
+}
+?>
Index: extensions/instagram2piwigo/include/functions.inc.php
===================================================================
--- extensions/instagram2piwigo/include/functions.inc.php	(revision 19561)
+++ extensions/instagram2piwigo/include/functions.inc.php	(revision 19561)
@@ -0,0 +1,120 @@
+<?php
+if (!defined('INSTAG_PATH')) die('Hacking attempt!');
+
+/**
+ * test if a download method is available
+ * @return: bool
+ */
+if (!function_exists('test_remote_download'))
+{
+  function test_remote_download()
+  {
+    return function_exists('curl_init') || ini_get('allow_url_fopen');
+  }
+}
+
+/**
+ * download a remote file
+ *  - needs cURL or allow_url_fopen
+ *  - take care of SSL urls
+ *
+ * @param: string source url
+ * @param: mixed destination file (if true, file content is returned)
+ */
+if (!function_exists('download_remote_file'))
+{
+  function download_remote_file($src, $dest)
+  {
+    if (empty($src))
+    {
+      return false;
+    }
+    
+    $return = ($dest === true) ? true : false;
+    
+    /* curl */
+    if (function_exists('curl_init'))
+    {
+      if (!$return)
+      {
+        $newf = fopen($dest, "wb");
+      }
+      $ch = curl_init();
+      
+      curl_setopt($ch, CURLOPT_URL, $src);
+      curl_setopt($ch, CURLOPT_HEADER, false);
+      curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-language: en"));
+      curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
+      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+      curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
+      curl_setopt($ch, CURLOPT_TIMEOUT, 30);
+      if (strpos($src, 'https://') !== false)
+      {
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+      }
+      if (!$return)
+      {
+        curl_setopt($ch, CURLOPT_FILE, $newf);
+      }
+      else
+      {
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      }
+      
+      $out = curl_exec($ch);
+      curl_close($ch);
+      
+      if ($out === false)
+      {
+        return 'file_error';
+      }
+      else if (!$return)
+      {
+        fclose($newf);
+        return true;
+      }
+      else
+      {
+        return $out;
+      }
+    }
+    /* file get content */
+    else if (ini_get('allow_url_fopen'))
+    {
+      if (strpos($src, 'https://') !== false and !extension_loaded('openssl'))
+      {
+        return false;
+      }
+      
+      $opts = array(
+        'http' => array(
+          'method' => "GET",
+          'user_agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)',
+          'header' => "Accept-language: en",
+        )
+      );
+
+      $context = stream_context_create($opts);
+      
+      if (($file = file_get_contents($src, false, $context)) === false)
+      {
+        return 'file_error';
+      }
+      
+      if (!$return)
+      {
+        file_put_contents($dest, $file);
+        return true;
+      }
+      else
+      {
+        return $file;
+      }
+    }
+    
+    return false;
+  }
+}
+
+?>
Index: extensions/instagram2piwigo/include/index.php
===================================================================
--- extensions/instagram2piwigo/include/index.php	(revision 19561)
+++ extensions/instagram2piwigo/include/index.php	(revision 19561)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/include/ws_functions.inc.php
===================================================================
--- extensions/instagram2piwigo/include/ws_functions.inc.php	(revision 19561)
+++ extensions/instagram2piwigo/include/ws_functions.inc.php	(revision 19561)
@@ -0,0 +1,120 @@
+<?php
+if (!defined('INSTAG_PATH')) die('Hacking attempt!');
+
+function instagram_add_ws_method($arr)
+{
+  $service = &$arr[0];
+  
+  $service->addMethod(
+    'pwg.images.addInstagram',
+    'ws_images_addInstagram',
+    array(
+      'id' => array(),
+      'category' => array(),
+      'fills' => array('default' =>null),
+      ),
+    'Used by Instagram2Piwigo'
+    );
+}
+
+function ws_images_addInstagram($param, &$service)
+{
+  if (!is_admin())
+  {
+    return new PwgError(403, 'Forbidden');
+  }
+  
+  global $conf;
+  $conf['Instagram2Piwigo'] = unserialize($conf['Instagram2Piwigo']);
+  
+  if ( empty($conf['Instagram2Piwigo']['api_key']) or empty($conf['Instagram2Piwigo']['secret_key']) )
+  {
+    return new PwgError(null, l10n('Please fill your API keys on the configuration tab'));
+  }
+  
+  include_once(PHPWG_ROOT_PATH . 'admin/include/functions.php');
+  include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
+  include_once(INSTAG_PATH . 'include/functions.inc.php');
+  
+  if (!function_exists('curl_init'))
+  {
+    return new PwgError(null, l10n('No download method available'));
+  }
+  
+  // init instagram API
+  if (empty($_SESSION['instagram_access_token']))
+  {
+    return new PwgError(403, l10n('API not authenticated'));
+  }
+  
+  require_once(INSTAG_PATH . 'include/Instagram/Instagram.php');
+  
+  $instagram = new Instagram($_SESSION['instagram_access_token']);
+  $instagram->enableCache(INSTAG_FS_CACHE);
+  
+  $current_user = $instagram->getCurrentUser();
+  $username = $current_user->getData()->username;
+  
+  // photos infos
+  $photo_f = $instagram->getMedia($param['id']);
+  $photo = array(
+    'id' => $photo_f->id,
+    'title' => $photo_f->getCaption(),
+    'url' => $photo_f->getStandardRes()->url,
+    'date' => $photo_f->getCreatedTime('Y-d-m H:i:s'),
+    'username' => $photo_f->getUser()->getFullName(),
+    'tags' => $photo_f->getTags()->toArray(),
+    );
+  $photo = array_merge($param, $photo);
+  
+  if (!empty($photo['title']))
+  {
+    $photo['title'] = $photo['title']->getText();
+  }
+  else
+  {
+    $photo['title'] = $photo['id'];
+  }
+  
+  $photo['path'] = INSTAG_FS_CACHE . 'instagram-'.$username.'-'.$photo['id'].'.'.get_extension($photo['url']);
+  
+  // copy file
+  if (download_remote_file($photo['url'], $photo['path']) == false)
+  {
+    return new PwgError(null, l10n('Can\'t download file'));
+  }
+  
+  // add photo
+  $photo['image_id'] = add_uploaded_file($photo['path'], basename($photo['path']), array($photo['category']));
+  
+  // do some updates
+  if (!empty($photo['fills']))
+  {
+    $photo['fills'] = rtrim($photo['fills'], ',');
+    $photo['fills'] = explode(',', $photo['fills']);
+  
+    $updates = array();
+    if (in_array('fill_name', $photo['fills']))   $updates['name'] = $photo['title'];
+    if (in_array('fill_taken', $photo['fills']))  $updates['date_creation'] = $photo['date'];
+    if (in_array('fill_author', $photo['fills'])) $updates['author'] = $photo['username'];
+    
+    if (count($updates))
+    {
+      single_update(
+        IMAGES_TABLE,
+        $updates,
+        array('id' => $photo['image_id'])
+        );
+    }
+    
+    if ( !empty($photo['tags']) and in_array('fill_tags', $photo['fills']) )
+    {
+      $raw_tags = implode(',', $photo['tags']);
+      set_tags(get_tag_ids($raw_tags), $photo['image_id']);
+    }
+  }
+  
+  return sprintf(l10n('Photo "%s" imported'), $photo['title']);
+}
+
+?>
Index: extensions/instagram2piwigo/index.php
===================================================================
--- extensions/instagram2piwigo/index.php	(revision 19561)
+++ extensions/instagram2piwigo/index.php	(revision 19561)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/cs_CZ/description.txt
===================================================================
--- extensions/instagram2piwigo/language/cs_CZ/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/cs_CZ/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Rozšíření pro import obrázků z vašeho Instagram účtu.
Index: extensions/instagram2piwigo/language/cs_CZ/index.php
===================================================================
--- extensions/instagram2piwigo/language/cs_CZ/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/cs_CZ/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/cs_CZ/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/cs_CZ/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/cs_CZ/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d alb';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d obrázků nebylo zobrazeno, protože se už nachází v databázi';
+$lang['%d pictures imported'] = '%d obrázků importováno';
+$lang['(%d photos)'] = '(%d fotek)';
+$lang['API not authenticated'] = 'API neutentifikováno';
+$lang['Begin transfer'] = 'Začít přenos';
+$lang['Fill these fields from Instagram datas'] = 'Vyplnit tato pole údaji z Flickru';
+$lang['Instagram logins'] = 'Instagram přihlašovací údaje';
+$lang['How do I get my Instagram Client ID?'] = 'Kde najdu můj Instagram API klíč?';
+$lang['Import options'] = 'Nastavení importu';
+$lang['Import'] = 'Importovat';
+$lang['List pictures of this album'] = 'Vypsat obrázky tohoto alba';
+$lang['Logged in as'] = 'Přihlášen jako';
+$lang['No download method available'] = 'Není k dispozici žádný způsob stahování';
+$lang['One picture is not displayed because already existing in the database.'] = 'Jeden obrázek není zobrazen, protože už je v databázi.';
+$lang['Open Instagram page in a new tab'] = 'Otevřít stránku Instagram v novém tabu';
+$lang['Please fill your API keys on the configuration tab'] = 'Vyplňte prosím vaše API klíče v konfigurační záložce ';
+$lang['Processing...'] = 'Zpracovávání...';
+$lang['Successfully logged in to you Instagram account'] = 'Přiglášení na účet Instagram úspěšné';
+$lang['%d elements ready for importation'] = '%d elementů připravených k importování';
+$lang['Logged out'] = 'odhlášen';
+$lang['Photo "%s" imported'] = 'Fotka "%s" importována';
+?>
Index: extensions/instagram2piwigo/language/da_DK/description.txt
===================================================================
--- extensions/instagram2piwigo/language/da_DK/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/da_DK/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Importer billeder fra din Instagram-konto
Index: extensions/instagram2piwigo/language/da_DK/index.php
===================================================================
--- extensions/instagram2piwigo/language/da_DK/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/da_DK/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/da_DK/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/da_DK/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/da_DK/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['Logged out'] = 'Logget ud';
+$lang['No download method available'] = 'Ingen downloadmetode til rådighed';
+$lang['One picture is not displayed because already existing in the database.'] = 'Et billede vises ikke, fordi det allerede findes i databasen.';
+$lang['Open Instagram page in a new tab'] = 'Åbn Instagram-side i en ny fane';
+$lang['Photo "%s" imported'] = 'Importerede fotoet "%s"';
+$lang['Please fill your API keys on the configuration tab'] = 'Angiv dine API-nøgler på opsætningsfanen';
+$lang['Processing...'] = 'Behandler ...';
+$lang['Successfully logged in to you Instagram account'] = 'Loggede på din Instagram-konto';
+$lang['%d albums'] = '%d album';
+$lang['%d elements ready for importation'] = '%d elementer klar til import';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d billeder vises ikke, fordi de allerede findes i databasen.';
+$lang['%d pictures imported'] = '%d billeder er importeret';
+$lang['(%d photos)'] = '(%d fotoer)';
+$lang['API not authenticated'] = 'API ikke godkendt';
+$lang['Begin transfer'] = 'begynd overførsel';
+$lang['Fill these fields from Instagram datas'] = 'Udfyld disse felter med Instagram-data';
+$lang['Instagram logins'] = 'Instagram-logins';
+$lang['How do I get my Instagram Client ID?'] = 'Hvordan finder jeg min Instagram API-nøgle?';
+$lang['Import'] = 'Importer';
+$lang['Import options'] = 'Importindstillinger';
+$lang['List pictures of this album'] = 'List billeder i dette album';
+$lang['Logged in as'] = 'Logget som';
+?>
Index: extensions/instagram2piwigo/language/de_DE/description.txt
===================================================================
--- extensions/instagram2piwigo/language/de_DE/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/de_DE/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Erweiterung zum Import von Bildern von deinem Instagram Konto
Index: extensions/instagram2piwigo/language/de_DE/index.php
===================================================================
--- extensions/instagram2piwigo/language/de_DE/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/de_DE/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/de_DE/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/de_DE/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/de_DE/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['Import options'] = 'Import Optionen';
+$lang['Import'] = 'Importieren';
+$lang['List pictures of this album'] = 'Bilder des Album aufführen';
+$lang['%d albums'] = '%d Alben';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d Bilder werden nicht angezeigt, existieren schon in der Datenbank';
+$lang['%d pictures imported'] = '%d Bilder importiert';
+$lang['(%d photos)'] = '(%d Bilder)';
+$lang['API not authenticated'] = 'API nicht bestätigt';
+$lang['Begin transfer'] = 'Starte transfer';
+$lang['Fill these fields from Instagram datas'] = 'Fülle diese Felder mit Instagram Daten';
+$lang['Instagram logins'] = 'Instagram Login´s';
+$lang['How do I get my Instagram Client ID?'] = 'Wie bekomme ich meinen Instagram API Schlüssel?';
+$lang['Logged in as'] = 'Login als';
+$lang['No download method available'] = 'Keine Download Methode verfügbar';
+$lang['One picture is not displayed because already existing in the database.'] = 'Bild wird nicht angezeigt, existiert schon in der Datenbank';
+$lang['Open Instagram page in a new tab'] = 'Öffne Instagram Seite in neuem Tab';
+$lang['Please fill your API keys on the configuration tab'] = 'Bitte API Schlüssel auf Konfigurations-Tab eingeben';
+$lang['Processing...'] = 'Verarbeitung...';
+$lang['Successfully logged in to you Instagram account'] = 'Erfolgreich beim Instagram Konto eingeloggt ';
+$lang['%d elements ready for importation'] = '%d Elemente fertig zum Import';
+$lang['Logged out'] = 'Aus-gelockt ';
+$lang['Photo "%s" imported'] = '"%s" Bilder importiert';
+?>
Index: extensions/instagram2piwigo/language/el_GR/description.txt
===================================================================
--- extensions/instagram2piwigo/language/el_GR/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/el_GR/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Επέκταση για την εισαγωγή φωτογραφιών από το Instagram λογαριασμό σας
Index: extensions/instagram2piwigo/language/el_GR/index.php
===================================================================
--- extensions/instagram2piwigo/language/el_GR/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/el_GR/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/el_GR/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/el_GR/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/el_GR/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d λευκώματα';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d των εικόνων δεν εμφανίζονται επειδή υπάρχουν ήδη στην βάση δεδομένων.';
+$lang['%d pictures imported'] = '%d εικόνες εισήχθησαν';
+$lang['(%d photos)'] = '(%d εικόνες)';
+$lang['API not authenticated'] = 'το κλειδί API δεν επικυρώθηκε';
+$lang['Begin transfer'] = 'Ξεκινήστε τη μεταφορά';
+$lang['Fill these fields from Instagram datas'] = 'Συμπληρώστε αυτά τα πεδία από τη βάση δεδομένων του Instagram';
+$lang['Instagram logins'] = 'Instagram συνδέσεις';
+$lang['How do I get my Instagram Client ID?'] = 'Πώς μπορώ να αποκτήσω το Instagram API κλειδί μου;';
+$lang['Import options'] = 'επιλογές εισαγωγής';
+$lang['Import'] = 'Εισαγωγή';
+$lang['List pictures of this album'] = 'Εμφάνισε φωτογραφίες αυτού του λευκώματος';
+$lang['Logged in as'] = 'Καταγράφηκε ως';
+$lang['No download method available'] = 'Δεν υπάρχει μέθοδος λήψης διαθέσιμη';
+$lang['One picture is not displayed because already existing in the database.'] = 'Μια εικόνα δεν εμφανίζεται επειδή υπάρχει ήδη στην βάση δεδομένων.';
+$lang['Open Instagram page in a new tab'] = 'ανοίξτε τη σελίδα του Instagram σε νέα καρτέλα';
+$lang['Please fill your API keys on the configuration tab'] = 'Παρακαλούμε συμπληρώστε τα κλειδιά API σας στην καρτέλα Διαμόρφωση';
+$lang['Processing...'] = 'Επεξεργασία ...';
+$lang['Successfully logged in to you Instagram account'] = 'Συνδεθήκατε επιτυχώς στο Instagram λογαριασμό σας';
+$lang['%d elements ready for importation'] = '%d στοιχεία έτοιμα για την εισαγωγή';
+$lang['Photo "%s" imported'] = 'Η Φωτογραφία "%s" έχει εισαχθεί ';
+$lang['Logged out'] = 'Αποθηκεύτηκε ';
+?>
Index: extensions/instagram2piwigo/language/en_UK/description.txt
===================================================================
--- extensions/instagram2piwigo/language/en_UK/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/en_UK/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Import pictures from your Instagram account
Index: extensions/instagram2piwigo/language/en_UK/help_api_key.html
===================================================================
--- extensions/instagram2piwigo/language/en_UK/help_api_key.html	(revision 19561)
+++ extensions/instagram2piwigo/language/en_UK/help_api_key.html	(revision 19561)
@@ -0,0 +1,11 @@
+<!-- TRANSLATORS : please don't translate the words "Developper", "Register Your Application", "Client ID" and "Client Secret" -->
+<ol>
+  <li>Go to <a href="https://instagram.com/accounts/login/?next=/accounts/edit/">Instagram</a> website and connect with your logins</li>
+  <li>Go to the <a href="http://instagram.com/developer/">Developper</a> page and click on <b>Register Your Application</b></li>
+  <li>You will be asked to your website url, your phone number (you can give a fake number) and a short description</li>
+  <li>Submit and click again on <b>Register Your Application</b></li>
+  <li>Enter a name (the name cannot contain the word <i>instagram</i>), a description and your website url again</li>
+  <li>On the field <b>OAuth redirect_uri</b>, past the abobe URL and click on <b>Register</b></li>
+  <li>Now copy the <b>Client ID</b> and the <b>Client Secret</b> to Instagram2Piwigo configuration</li>
+  <li>You're done!</li>
+</ol>
Index: extensions/instagram2piwigo/language/en_UK/index.php
===================================================================
--- extensions/instagram2piwigo/language/en_UK/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/en_UK/index.php	(revision 19561)
@@ -0,0 +1,29 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/en_UK/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/en_UK/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/en_UK/plugin.lang.php	(revision 19561)
@@ -0,0 +1,23 @@
+<?php
+$lang['Please fill your API keys on the configuration tab'] = 'Please fill your API keys on the configuration tab';
+$lang['Successfully logged in to you Instagram account'] = 'Successfully logged in to you Instagram account';
+$lang['One picture is not displayed because already existing in the database.'] = 'One picture is not displayed because already existing in the database.';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d pictures are not displayed because already existing in the database.';
+$lang['%d pictures imported'] = '%d pictures imported';
+$lang['Import'] = 'Import';
+$lang['API not authenticated'] = 'API not authenticated';
+$lang['Photo "%s" imported'] = 'Photo "%s" imported';
+$lang['Instagram logins'] = 'Instagram logins';
+$lang['How do I get my Instagram Client ID?'] = 'How do I get my Instagram Client ID?';
+$lang['Import options'] = 'Import options';
+$lang['Fill these fields from Instagram datas'] = 'Fill these fields from Instagram datas';
+$lang['Processing...'] = 'Processing...';
+$lang['(%d photos)'] = '(%d photos)';
+$lang['%d albums'] = '%d albums';
+$lang['Begin transfer'] = 'Begin transfer';
+$lang['Open Instagram page in a new tab'] = 'Open Instagram page in a new tab';
+$lang['No download method available'] = 'No download method available';
+$lang['Logged in as'] = 'Logged in as';
+$lang['Logged out'] = 'Logged out';
+$lang['List my pictures'] = 'List my pictures';
+?>
Index: extensions/instagram2piwigo/language/es_ES/description.txt
===================================================================
--- extensions/instagram2piwigo/language/es_ES/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/es_ES/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Importar imágenes desde su cuenta de Instagram
Index: extensions/instagram2piwigo/language/es_ES/index.php
===================================================================
--- extensions/instagram2piwigo/language/es_ES/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/es_ES/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/es_ES/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/es_ES/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/es_ES/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d álbumes';
+$lang['%d pictures are not displayed because already existing in the database.'] = '% d imágenes no se muestran debido a que ya existe en la base de datos.';
+$lang['%d pictures imported'] = '% d imágenes importadas';
+$lang['(%d photos)'] = '(%d fotos)';
+$lang['API not authenticated'] = 'API no autenticado';
+$lang['Begin transfer'] = 'iniciar la transferencia';
+$lang['Fill these fields from Instagram datas'] = 'Rellene estos campos de datos de Instagram ';
+$lang['Instagram logins'] = 'Inicios de sesión de Instagram';
+$lang['How do I get my Instagram Client ID?'] = '¿Cómo puedo obtener mi clave de API de Instagram?';
+$lang['Import options'] = 'Opciones para importar';
+$lang['Import'] = 'Importar';
+$lang['List pictures of this album'] = 'Enumerar imágenes de este álbum';
+$lang['Logged in as'] = 'Registrado como';
+$lang['No download method available'] = 'Ningún método disponible de descarga';
+$lang['One picture is not displayed because already existing in the database.'] = 'Una imagen no se muestra porque ya existentes en la base de datos.';
+$lang['Open Instagram page in a new tab'] = 'Abra la página de Instagram en una nueva pestaña';
+$lang['Please fill your API keys on the configuration tab'] = 'Por favor, rellene sus claves de la API en la pestaña de configuración';
+$lang['Processing...'] = 'Procesando...';
+$lang['Successfully logged in to you Instagram account'] = 'Logueado con éxito en su cuenta de Instagram';
+$lang['%d elements ready for importation'] = '%d elementos listos para importar';
+$lang['Logged out'] = 'Sesión cerrada';
+$lang['Photo "%s" imported'] = 'Foto "%s" importada';
+?>
Index: extensions/instagram2piwigo/language/fa_IR/index.php
===================================================================
--- extensions/instagram2piwigo/language/fa_IR/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/fa_IR/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/fa_IR/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/fa_IR/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/fa_IR/plugin.lang.php	(revision 19561)
@@ -0,0 +1,32 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d pictures imported'] = '%d  عکس های وارد شده';
+$lang['Processing...'] = 'در حال پردازش ...';
+$lang['%d albums'] = '%d آلبوم ها';
+$lang['(%d photos)'] = '(%d عکس ها)';
+$lang['Instagram logins'] = 'ورود به فلیکر';
+$lang['Import options'] = 'وارد کردن گزینه';
+$lang['List pictures of this album'] = 'لیست عکس ها از این البوم';
+$lang['Import'] = 'وارد کردن';
+$lang['Begin transfer'] = 'آغاز انتقال';
+?>
Index: extensions/instagram2piwigo/language/fr_FR/description.txt
===================================================================
--- extensions/instagram2piwigo/language/fr_FR/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/fr_FR/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Importez des photos depuis votre compte Instagram.
Index: extensions/instagram2piwigo/language/fr_FR/help_api_key.html
===================================================================
--- extensions/instagram2piwigo/language/fr_FR/help_api_key.html	(revision 19561)
+++ extensions/instagram2piwigo/language/fr_FR/help_api_key.html	(revision 19561)
@@ -0,0 +1,11 @@
+<!-- TRANSLATORS : please don't translate the words "Developper", "Register Your Application", "Client ID" and "Client Secret" -->
+<ol>
+  <li>Aller sur le site <a href="https://instagram.com/accounts/login/?next=/accounts/edit/">Instagram</a> et connectez-vous à votre compte</li>
+  <li>Allez sur la page <a href="http://instagram.com/developer/">Developper</a> et cliquez sur <b>Register Your Application</b></li>
+  <li>Vous devrez renseigner l'adresse de votre site, votre numéro de téléphone (vous pouvez mettre un faux) et une courte description</li>
+  <li>Validez et cliquez à nouveau sur <b>Register Your Application</b></li>
+  <li>Entrez un nom (le nom ne peut pas contenir le mot <i>instagram</i>), une description et à nouveau l'adresse de votre site</li>
+  <li>Dans le champs <b>OAuth redirect_uri</b>, copiez-collez l'URL ci-dessus et cliquez sur <b>Register</b></li>
+  <li>Maintenant copiez le <b>Client ID</b> et le <b>Client Secret</b> dans la configuration d'Instagram2Piwigo</li>
+  <li>Terminé!</li>
+</ol>
Index: extensions/instagram2piwigo/language/fr_FR/index.php
===================================================================
--- extensions/instagram2piwigo/language/fr_FR/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/fr_FR/index.php	(revision 19561)
@@ -0,0 +1,29 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/fr_FR/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/fr_FR/plugin.lang.php	(revision 19561)
@@ -0,0 +1,25 @@
+<?php
+$lang['Please fill your API keys on the configuration tab'] = 'Veuillez renseigner votre clé d\'API sur l\'écran de configuration';
+$lang['Successfully logged in to you Instagram account'] = 'Connecté à votre compte Instagram';
+$lang['One picture is not displayed because already existing in the database.'] = 'Une photo n\'est pas affichée car elle existe déjà sur la galerie';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d photo ne sont pas affichées car elles existent déjà sur la galerie';
+$lang['%d pictures imported'] = '%d photos importées';
+$lang['Import'] = 'Importation';
+$lang['API not authenticated'] = 'API non authentifiée';
+$lang['Photo "%s" imported'] = 'Photo "%s" importée';
+$lang['Instagram logins'] = 'Identifiants Instagram';
+$lang['How do I get my Instagram Client ID?'] = 'Comment obtenir ma clé d\'API ?';
+$lang['Import options'] = 'Options d\'importation';
+$lang['Fill these fields from Instagram datas'] = 'Remplir ces champs à partir des données de Instagram';
+$lang['Processing...'] = 'En cours...';
+$lang['(%d photos)'] = '(%d photos)';
+$lang['%d albums'] = '%d albums';
+$lang['List pictures of this album'] = 'Lister les photos de cet album';
+$lang['Begin transfer'] = 'Commencer le transfert';
+$lang['Open Instagram page in a new tab'] = 'Ouvrir la page Instagram dans un nouvel onglet';
+$lang['No download method available'] = 'Aucune méthode de téléchargement n\'est disponible';
+$lang['Logged in as'] = 'Indentifié en tant que';
+$lang['Logged out'] = 'Déconnecté';
+$lang['%d elements ready for importation'] = '%d elements prêts à l\'importation';
+$lang['List my pictures'] = 'Lister mes images';
+?>
Index: extensions/instagram2piwigo/language/hu_HU/description.txt
===================================================================
--- extensions/instagram2piwigo/language/hu_HU/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/hu_HU/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Képek importálása a Instagram oldaladról
Index: extensions/instagram2piwigo/language/hu_HU/index.php
===================================================================
--- extensions/instagram2piwigo/language/hu_HU/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/hu_HU/index.php	(revision 19561)
@@ -0,0 +1,29 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/hu_HU/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/hu_HU/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/hu_HU/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['One picture is not displayed because already existing in the database.'] = 'Egy kép nem látható, mert már létezik az adatbázisban.';
+$lang['Logged in as'] = 'Bejelentkzeve, mint';
+$lang['Logged out'] = 'Kijelentkezve';
+$lang['No download method available'] = 'Nincs használható letöltési módszer';
+$lang['Open Instagram page in a new tab'] = 'Instagram oldal megnyitása egy új fülben';
+$lang['Photo "%s" imported'] = '"%s" fotó importálva';
+$lang['Please fill your API keys on the configuration tab'] = 'Kérünk, add meg az API kulcsod a konfiguráció-fülön';
+$lang['Processing...'] = 'Feldolgozás folyamatban...';
+$lang['Successfully logged in to you Instagram account'] = 'Sikeresen bejelentkezve a Instagram fiókodba';
+$lang['Fill these fields from Instagram datas'] = 'Ezeket a mezőket a Instagram adatokkal töltsd fel';
+$lang['Instagram logins'] = 'Instagram bejelentkezések';
+$lang['How do I get my Instagram Client ID?'] = 'Hogy kapom meg a Instagram API kulcsomat?';
+$lang['Import'] = 'Importálás';
+$lang['Import options'] = 'Az importálás beállításai';
+$lang['List pictures of this album'] = 'Ezen album képeinek listázása';
+$lang['%d albums'] = '%d albumok';
+$lang['%d elements ready for importation'] = '%d tétel készen áll az importálásra';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d kép nem látható, mert már léteznek az adatbázisban.';
+$lang['%d pictures imported'] = '%d kép importálva';
+$lang['(%d photos)'] = '(%d fénykép)';
+$lang['API not authenticated'] = 'API nincs hitelesítve';
+$lang['Begin transfer'] = 'Átvitel indítása';
+?>
Index: extensions/instagram2piwigo/language/index.php
===================================================================
--- extensions/instagram2piwigo/language/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/index.php	(revision 19561)
@@ -0,0 +1,29 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/it_IT/description.txt
===================================================================
--- extensions/instagram2piwigo/language/it_IT/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/it_IT/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Estensione per l'importazione di foto dal vostro account Instagram
Index: extensions/instagram2piwigo/language/it_IT/index.php
===================================================================
--- extensions/instagram2piwigo/language/it_IT/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/it_IT/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/it_IT/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/it_IT/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/it_IT/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d albums';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d foto non sono visualizzate perché già presenti nella galleria';
+$lang['%d pictures imported'] = '%d immagini importate';
+$lang['(%d photos)'] = '(%d foto)';
+$lang['API not authenticated'] = 'API non autenticate';
+$lang['Begin transfer'] = 'Iniziare il trasferimento';
+$lang['Fill these fields from Instagram datas'] = 'Compila questi campi da Instagram dati';
+$lang['Instagram logins'] = 'Instagram logins';
+$lang['How do I get my Instagram Client ID?'] = 'Come posso ottenere le mie Instagram Client ID?';
+$lang['Import options'] = 'Opzioni di importazione';
+$lang['Import'] = 'Importa';
+$lang['List pictures of this album'] = 'Elenco immagini di questo album';
+$lang['Logged in as'] = 'Iscritto come';
+$lang['No download method available'] = 'Nessun metodo di download disponibile';
+$lang['One picture is not displayed because already existing in the database.'] = 'Una immagine non viene visualizzata perché già esistente nel database.';
+$lang['Open Instagram page in a new tab'] = 'Aprire la pagina Instagram in una nuova scheda';
+$lang['Please fill your API keys on the configuration tab'] = 'Si prega di compilare le chiavi API nella scheda di configurazione';
+$lang['Processing...'] = 'Elaborazione...';
+$lang['Successfully logged in to you Instagram account'] = 'Accesso al tuo account Instagram riuscito';
+$lang['%d elements ready for importation'] = '%d elementi sono pronti per essere importati';
+$lang['Photo "%s" imported'] = 'La foto "%s" è stata importata';
+$lang['Logged out'] = 'Disconnesso';
+?>
Index: extensions/instagram2piwigo/language/lv_LV/description.txt
===================================================================
--- extensions/instagram2piwigo/language/lv_LV/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/lv_LV/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Paplašinājums importētajiem attēliem no jūsu Instagram konta
Index: extensions/instagram2piwigo/language/lv_LV/index.php
===================================================================
--- extensions/instagram2piwigo/language/lv_LV/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/lv_LV/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/lv_LV/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/lv_LV/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/lv_LV/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d albūmi';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d netiek rādītas, jo datubāzē jau eksistē.';
+$lang['%d pictures imported'] = '%d attēli importēti';
+$lang['(%d photos)'] = '(%d attēlu)';
+$lang['API not authenticated'] = 'API nav autentisks';
+$lang['Begin transfer'] = 'Sākt pārsūtīšanu';
+$lang['Fill these fields from Instagram datas'] = 'Aizpildīt šos laukus ar Instagram datiem';
+$lang['Instagram logins'] = 'Instagram pieteikšanās';
+$lang['How do I get my Instagram Client ID?'] = 'Kā es varu iegūt savu Instagram API atslēgu?';
+$lang['Import options'] = 'Importēšanas iespējas';
+$lang['Import'] = 'Importēt';
+$lang['List pictures of this album'] = 'Sastādīt šā albūma attēlu sarakstu';
+$lang['Logged in as'] = 'Pieteicies kā';
+$lang['No download method available'] = 'Lejupielādes metodes nav pieejamas';
+$lang['One picture is not displayed because already existing in the database.'] = 'Attēls netika parādīts, jo datubāzē jau tāds eksistē';
+$lang['Open Instagram page in a new tab'] = 'Atvērt Instagram lapu jaunā cilnē';
+$lang['Please fill your API keys on the configuration tab'] = 'Lūdzu ieraksties savas API atslēgas konfigurācijas cilnē';
+$lang['Processing...'] = 'Apstrāde...';
+$lang['Successfully logged in to you Instagram account'] = 'Esat veiksmīgi pieteikušies savā Instagram kontā';
+$lang['Logged out'] = 'Izgājis no sistēmas';
+$lang['Photo "%s" imported'] = 'Importēts "%s" fotogrāfiju';
+$lang['%d elements ready for importation'] = '%d elementi gatavi importam';
+?>
Index: extensions/instagram2piwigo/language/nl_NL/description.txt
===================================================================
--- extensions/instagram2piwigo/language/nl_NL/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/nl_NL/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Extensie om afbeeldingen uit je Instagram account te importeren
Index: extensions/instagram2piwigo/language/nl_NL/index.php
===================================================================
--- extensions/instagram2piwigo/language/nl_NL/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/nl_NL/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/nl_NL/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/nl_NL/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/nl_NL/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d albums';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d afbeeldingen worden niet getoond omdat ze al in de database staan.';
+$lang['%d pictures imported'] = '%d afbeeldingen geïmporteerd';
+$lang['(%d photos)'] = '(%d foto\'s)';
+$lang['API not authenticated'] = 'API niet geverifieerd';
+$lang['Begin transfer'] = 'Begin overdracht';
+$lang['Fill these fields from Instagram datas'] = 'Vul deze velden met Instagram data';
+$lang['Instagram logins'] = 'Flickrs logins';
+$lang['How do I get my Instagram Client ID?'] = 'Hoe verkrijg ik mijn Instagram API sleutel?';
+$lang['Import options'] = 'Import opties';
+$lang['Import'] = 'Import';
+$lang['List pictures of this album'] = 'Maak een lijst met afbeeldingen van dit album';
+$lang['Logged in as'] = 'Ingelogd als';
+$lang['No download method available'] = 'Geen download aanpak voorhanden';
+$lang['One picture is not displayed because already existing in the database.'] = 'Een afbeelding wordt niet getoond omdat het al in de database aanwezig is.';
+$lang['Open Instagram page in a new tab'] = 'Open de Instagram pagina in een nieuwe tab';
+$lang['Please fill your API keys on the configuration tab'] = 'Vul je API sleutels in in de configuratietab';
+$lang['Processing...'] = 'Bewerken ...';
+$lang['Successfully logged in to you Instagram account'] = 'Succesvol ingelogd in Instagram ';
+$lang['%d elements ready for importation'] = '%d onderdelen klaar voor import';
+$lang['Logged out'] = 'Uitgelogd ';
+$lang['Photo "%s" imported'] = 'Foto "%d" geïmporteerd';
+?>
Index: extensions/instagram2piwigo/language/pl_PL/description.txt
===================================================================
--- extensions/instagram2piwigo/language/pl_PL/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/pl_PL/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Rozszerzenie wspierające importowanie zdjęć z Twojego konta Instagram
Index: extensions/instagram2piwigo/language/pl_PL/index.php
===================================================================
--- extensions/instagram2piwigo/language/pl_PL/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/pl_PL/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/pl_PL/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/pl_PL/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/pl_PL/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d albumy';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d zdjęcia nie są wyświetlane ponieważ znajdu';
+$lang['%d pictures imported'] = '%d zdjęć zaimportowanych';
+$lang['(%d photos)'] = '(%d zdjęć)';
+$lang['API not authenticated'] = 'Brak autentykacji API';
+$lang['Begin transfer'] = 'Rozpocznij transfer';
+$lang['Fill these fields from Instagram datas'] = 'Wypełnij te pola danymi z Instagram';
+$lang['Instagram logins'] = 'Login Instagram';
+$lang['How do I get my Instagram Client ID?'] = 'Jak mogę dostać mój klucz API z Instagram';
+$lang['Import options'] = 'Importuj opcje';
+$lang['Import'] = 'Importuj';
+$lang['List pictures of this album'] = 'Wyświetl zdjęcia z tego albumu';
+$lang['Logged in as'] = 'Zalogowany jako';
+$lang['No download method available'] = 'Niedostępna żadna metoda pobierania';
+$lang['One picture is not displayed because already existing in the database.'] = 'Jedno zdjęcie nie zostało wyświetlone ponieważ istnieje już w bazie';
+$lang['Open Instagram page in a new tab'] = 'Otwórz Instagram w nowej zakładce';
+$lang['Please fill your API keys on the configuration tab'] = 'Wypełnij klucze API w zakłdace';
+$lang['Processing...'] = 'Przetwarzanie...';
+$lang['Successfully logged in to you Instagram account'] = 'Udane logowanie do Instagram';
+$lang['%d elements ready for importation'] = '%d elementów gotowych do importu';
+$lang['Logged out'] = 'Wylogowano';
+$lang['Photo "%s" imported'] = 'Zdjęcie "%s" zaimportowane';
+?>
Index: extensions/instagram2piwigo/language/pt_BR/description.txt
===================================================================
--- extensions/instagram2piwigo/language/pt_BR/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/pt_BR/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Importe fotos de sua conta do Instagram
Index: extensions/instagram2piwigo/language/pt_BR/index.php
===================================================================
--- extensions/instagram2piwigo/language/pt_BR/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/pt_BR/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/pt_BR/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/pt_BR/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/pt_BR/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['Logged out'] = 'Deslogar';
+$lang['No download method available'] = 'Nenhum método de download disponível';
+$lang['One picture is not displayed because already existing in the database.'] = 'Uma foto não foi mostrada porque já existe no banco de dados';
+$lang['Open Instagram page in a new tab'] = 'Abre página do Instagram em uma nova aba';
+$lang['Photo "%s" imported'] = 'Foto "%s" importada';
+$lang['Please fill your API keys on the configuration tab'] = 'Por favor preencha sua chave do API do Instagram na aba de configuração';
+$lang['Processing...'] = 'Processando...';
+$lang['Successfully logged in to you Instagram account'] = 'Logado com sucesso na sua conta do Instagram';
+$lang['%d albums'] = '%d albuns';
+$lang['%d elements ready for importation'] = '%d elementos prontos para importação';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d fotos não foram mostradas porque já existem no banco de dados';
+$lang['%d pictures imported'] = '%d fotos importadas';
+$lang['(%d photos)'] = '(%d fotos)';
+$lang['API not authenticated'] = 'API não autenticada';
+$lang['Begin transfer'] = 'Inicia transferência';
+$lang['Fill these fields from Instagram datas'] = 'Preencha esses campos com dados do Instagram';
+$lang['Instagram logins'] = 'Loguin do Flick';
+$lang['How do I get my Instagram Client ID?'] = 'Como eu obtenho minha chave da API do Instagram';
+$lang['Import'] = 'Importa';
+$lang['Import options'] = 'opções de importação';
+$lang['List pictures of this album'] = 'Lista fotos nesse álbum';
+$lang['Logged in as'] = 'Logado como';
+?>
Index: extensions/instagram2piwigo/language/pt_PT/description.txt
===================================================================
--- extensions/instagram2piwigo/language/pt_PT/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/pt_PT/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Extensão para importar fotos da sua conta Instagram
Index: extensions/instagram2piwigo/language/pt_PT/index.php
===================================================================
--- extensions/instagram2piwigo/language/pt_PT/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/pt_PT/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/pt_PT/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/pt_PT/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/pt_PT/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d albuns';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d fotos não são mostradas porque já existem na base de dados';
+$lang['%d pictures imported'] = '%d fotos importadas';
+$lang['(%d photos)'] = '(%d fotos)';
+$lang['API not authenticated'] = 'API não autenticada';
+$lang['Begin transfer'] = 'Iniciar transferencia ';
+$lang['Fill these fields from Instagram datas'] = 'Completar estes campos com dados Instagram';
+$lang['Instagram logins'] = 'Entradas no Instagram';
+$lang['How do I get my Instagram Client ID?'] = 'Como obtenho a chave Instagram API';
+$lang['Import options'] = 'Opções de importação';
+$lang['Import'] = 'Importar';
+$lang['List pictures of this album'] = 'Listar fotos deste album';
+$lang['Logged in as'] = 'Entrou como';
+$lang['No download method available'] = 'Não existe qualquer metodo de descarga';
+$lang['One picture is not displayed because already existing in the database.'] = 'uma foto não é mostrada dado já existir na base de dados';
+$lang['Open Instagram page in a new tab'] = 'Abrir a página Instagram noutra folha';
+$lang['Please fill your API keys on the configuration tab'] = 'Por favor preencha as Chaves API na página configuração';
+$lang['Processing...'] = 'Processando...';
+$lang['Successfully logged in to you Instagram account'] = 'Entrou com sucesso na sua conta Instagram';
+$lang['%d elements ready for importation'] = '%d elementos prontos para a importação ';
+$lang['Logged out'] = 'Saiu';
+$lang['Photo "%s" imported'] = 'Importadas  "%s" fotos';
+?>
Index: extensions/instagram2piwigo/language/ru_RU/description.txt
===================================================================
--- extensions/instagram2piwigo/language/ru_RU/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/ru_RU/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Плагин для импорта фотографий с вашего аккаунта Instagram
Index: extensions/instagram2piwigo/language/ru_RU/index.php
===================================================================
--- extensions/instagram2piwigo/language/ru_RU/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/ru_RU/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/ru_RU/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/ru_RU/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/ru_RU/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = 'Альбомов: %d';
+$lang['%d pictures are not displayed because already existing in the database.'] = 'Не показано фотографий: %d (они уже есть в базе данных).';
+$lang['%d pictures imported'] = 'Фотографий импортировано: %d';
+$lang['(%d photos)'] = '(фотографий: %d)';
+$lang['API not authenticated'] = 'API не авторизован';
+$lang['Begin transfer'] = 'Начать передачу';
+$lang['Fill these fields from Instagram datas'] = 'Заполните эти поля из Instagram Datas';
+$lang['Instagram logins'] = 'Вход во Flikr';
+$lang['How do I get my Instagram Client ID?'] = 'Как я могу получить ключ Instagram API?';
+$lang['Import options'] = 'Параметры импорта';
+$lang['Import'] = 'Импорт';
+$lang['List pictures of this album'] = 'Список фотографий альбома';
+$lang['Logged in as'] = 'Авторизован как';
+$lang['No download method available'] = 'Нет доступного метода загрузки';
+$lang['One picture is not displayed because already existing in the database.'] = 'Некоторые картинки не отображается, так как уже существуют в базе данных.';
+$lang['Open Instagram page in a new tab'] = 'Открыть страницу Instagram в новой вкладке';
+$lang['Please fill your API keys on the configuration tab'] = 'Пожалуйста, заполните ключ API на вкладке конфигурации';
+$lang['Processing...'] = 'Обработка ...';
+$lang['Successfully logged in to you Instagram account'] = 'Вы успешно вошли в свою учетную запись';
+$lang['%d elements ready for importation'] = '%d элементов готово к импорту';
+$lang['Logged out'] = 'Выход';
+$lang['Photo "%s" imported'] = 'Фото "%s" импортировано';
+?>
Index: extensions/instagram2piwigo/language/sk_SK/description.txt
===================================================================
--- extensions/instagram2piwigo/language/sk_SK/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/sk_SK/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Doplnok pre import fotiek z Vášho Instagram konta
Index: extensions/instagram2piwigo/language/sk_SK/index.php
===================================================================
--- extensions/instagram2piwigo/language/sk_SK/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/sk_SK/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/sk_SK/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/sk_SK/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/sk_SK/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d albumov';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d fotiek nie je zobrazených ale sú v databáze';
+$lang['%d pictures imported'] = '%d fotiek importovaných';
+$lang['(%d photos)'] = '(%d fotiek)';
+$lang['API not authenticated'] = 'API nie je overené';
+$lang['Begin transfer'] = 'Začať prenos';
+$lang['Fill these fields from Instagram datas'] = 'Plniť tieto polia z Instagram dát';
+$lang['Instagram logins'] = 'Instagram prihlásenia';
+$lang['How do I get my Instagram Client ID?'] = 'Ako získam Instagram API kľúč?';
+$lang['Import options'] = 'Voľby importu';
+$lang['Import'] = 'Import';
+$lang['List pictures of this album'] = 'Zoznam fotiek tohto albumu';
+$lang['Logged in as'] = 'Prihlásený ako';
+$lang['No download method available'] = 'Nedostupná sťahovacia metóda';
+$lang['One picture is not displayed because already existing in the database.'] = 'Jedna fotka nie je zobrazená ale je v databáze.';
+$lang['Open Instagram page in a new tab'] = 'Otvoriť Instagram stránku v novom okne';
+$lang['Please fill your API keys on the configuration tab'] = 'Prosím vyplňte Vaše API kľúče v konfigurácii';
+$lang['Processing...'] = 'Spracovávam...';
+$lang['Successfully logged in to you Instagram account'] = 'Úspešne prihlásený do Vášho Instagram konta';
+$lang['%d elements ready for importation'] = '%d prvky/prvkov pripravených pre import';
+$lang['Logged out'] = 'Odhlásený';
+$lang['Photo "%s" imported'] = 'Fotka %d importovaná';
+?>
Index: extensions/instagram2piwigo/language/tr_TR/description.txt
===================================================================
--- extensions/instagram2piwigo/language/tr_TR/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/tr_TR/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Instagram heabınızdan resimleri içe aktaracağınız eklenti
Index: extensions/instagram2piwigo/language/tr_TR/index.php
===================================================================
--- extensions/instagram2piwigo/language/tr_TR/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/tr_TR/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/tr_TR/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/tr_TR/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/tr_TR/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['%d albums'] = '%d albüm';
+$lang['%d pictures are not displayed because already existing in the database.'] = 'Mevcut veri tabanında zaten bulunduklarından %d resim gösterilmedi.';
+$lang['%d pictures imported'] = '%d resim içe aktarıldı';
+$lang['(%d photos)'] = '(%d fotoğraf)';
+$lang['API not authenticated'] = 'API doğrulanmamış';
+$lang['Begin transfer'] = 'Aktarmaya başla';
+$lang['Fill these fields from Instagram datas'] = 'Bu alanları Instagram bilgilerine göre doldurun';
+$lang['Instagram logins'] = 'Instagram oturumları';
+$lang['How do I get my Instagram Client ID?'] = 'Instagram API anahtarını nasıl alabilirim ?';
+$lang['Import options'] = 'İçe aktarma seçenekleri';
+$lang['Import'] = 'İçe aktar';
+$lang['List pictures of this album'] = 'Bu albümdeki resimleri listele';
+$lang['Logged in as'] = 'Oturum açan:';
+$lang['No download method available'] = 'İndirme yöntemi mevcut değil';
+$lang['One picture is not displayed because already existing in the database.'] = 'Mevcut veri tabanında zaten bulunduğundan bir resim gösterilmedi.';
+$lang['Open Instagram page in a new tab'] = 'Instagram sayfasını yeni sekmede aç';
+$lang['Please fill your API keys on the configuration tab'] = 'Lütfen yapılandırma sayfasındaki API anahtarlarını giriniz';
+$lang['Processing...'] = 'İşleniyor...';
+$lang['Successfully logged in to you Instagram account'] = 'Instagram \'de başarılı olarak oturum açıldı.';
+$lang['%d elements ready for importation'] = 'İçe aktarmak için %d öğe hazır';
+$lang['Logged out'] = 'Oturum kapatıldı';
+$lang['Photo "%s" imported'] = '"%s" fotoğraf içe aktarıldı.';
+?>
Index: extensions/instagram2piwigo/language/uk_UA/description.txt
===================================================================
--- extensions/instagram2piwigo/language/uk_UA/description.txt	(revision 19561)
+++ extensions/instagram2piwigo/language/uk_UA/description.txt	(revision 19561)
@@ -0,0 +1,1 @@
+Розширення для імпорту зображень з облікового запису Instagram.
Index: extensions/instagram2piwigo/language/uk_UA/index.php
===================================================================
--- extensions/instagram2piwigo/language/uk_UA/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/uk_UA/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/uk_UA/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/uk_UA/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/uk_UA/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['One picture is not displayed because already existing in the database.'] = 'Одне зображення не відображається, тому що вже існує в базі даних.';
+$lang['Please fill your API keys on the configuration tab'] = 'Будь ласка, заповніть API ключі на вкладці конфігурації';
+$lang['Processing...'] = 'Обробка...';
+$lang['Successfully logged in to you Instagram account'] = 'Успішно увійшли до вашого облікового запису Instagram';
+$lang['(%d photos)'] = '(%d зображень)';
+$lang['API not authenticated'] = 'API не перевірку автентичності';
+$lang['Begin transfer'] = 'Почати передачу';
+$lang['Fill these fields from Instagram datas'] = 'Заповніть ці поля з даних Instagram';
+$lang['Instagram logins'] = 'Логіни Instagram';
+$lang['How do I get my Instagram Client ID?'] = 'Як отримати ключ Instagram API?';
+$lang['Import'] = 'Імпортувати';
+$lang['Import options'] = 'Параметри імпорту';
+$lang['List pictures of this album'] = 'Список зображень цього альбому';
+$lang['Logged in as'] = 'Залоґінений як';
+$lang['No download method available'] = 'Немає доступних методів завантаження';
+$lang['Open Instagram page in a new tab'] = 'Відкрити сторінку Instagram в новій вкладці';
+$lang['%d albums'] = '%d альбоми';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d малюнки не відображаються, оскільки вже існують в базі даних.';
+$lang['%d pictures imported'] = '%d імпортованих зображень';
+$lang['%d elements ready for importation'] = '%d елементів готові для імпортування';
+$lang['Photo "%s" imported'] = 'Зображення "%s" імпортовано';
+$lang['Logged out'] = 'Вихід';
+?>
Index: extensions/instagram2piwigo/language/zh_CN/index.php
===================================================================
--- extensions/instagram2piwigo/language/zh_CN/index.php	(revision 19561)
+++ extensions/instagram2piwigo/language/zh_CN/index.php	(revision 19561)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/instagram2piwigo/language/zh_CN/plugin.lang.php
===================================================================
--- extensions/instagram2piwigo/language/zh_CN/plugin.lang.php	(revision 19561)
+++ extensions/instagram2piwigo/language/zh_CN/plugin.lang.php	(revision 19561)
@@ -0,0 +1,45 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+$lang['Logged in as'] = '登录为';
+$lang['Logged out'] = '登出';
+$lang['List pictures of this album'] = '列出此相册中的图片';
+$lang['No download method available'] = '没有可用的下载方法';
+$lang['One picture is not displayed because already existing in the database.'] = '1张图片没有显示，因为已经存在于数据库中。';
+$lang['Open Instagram page in a new tab'] = '在新的标签页打开Instagram';
+$lang['Photo "%s" imported'] = '图片"%s"已导入';
+$lang['Please fill your API keys on the configuration tab'] = '请在配置选项卡上填写您的API keys';
+$lang['Processing...'] = '处理中...';
+$lang['Successfully logged in to you Instagram account'] = '已成功登录到您的Instagram相册';
+$lang['(%d photos)'] = '(%d张图片)';
+$lang['API not authenticated'] = 'API未通过验证';
+$lang['Begin transfer'] = '开始转换';
+$lang['Fill these fields from Instagram datas'] = '用来自Instagram的数据填写这些字段';
+$lang['Instagram logins'] = 'Flickr登录';
+$lang['How do I get my Instagram Client ID?'] = '我如何获得Instagram API key？';
+$lang['Import'] = '导入';
+$lang['Import options'] = '导入选项';
+$lang['%d albums'] = '%d个相册';
+$lang['%d elements ready for importation'] = '将要导入%d个元素';
+$lang['%d pictures are not displayed because already existing in the database.'] = '%d张图片没有显示，因为已经存在于数据库中。';
+$lang['%d pictures imported'] = '已经导入%d张图片';
+?>
Index: extensions/instagram2piwigo/main.inc.php
===================================================================
--- extensions/instagram2piwigo/main.inc.php	(revision 19561)
+++ extensions/instagram2piwigo/main.inc.php	(revision 19561)
@@ -0,0 +1,39 @@
+<?php 
+/*
+Plugin Name: Instagram2Piwigo
+Version: auto
+Description: Import pictures from your Flickr account
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=612
+Author: Mistic
+Author URI: http://www.strangeplanet.fr
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $conf;
+
+define('INSTAG_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
+define('INSTAG_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
+define('INSTAG_FS_CACHE', $conf['data_location'].'instagram_cache/');
+
+
+if (defined('IN_ADMIN'))
+{
+  add_event_handler('get_admin_plugin_menu_links', 'instagram_admin_menu');
+
+  function instagram_admin_menu($menu) 
+  {
+    array_push($menu, array(
+      'NAME' => 'Instagram2Piwigo',
+      'URL' => INSTAG_ADMIN,
+    ));
+    return $menu;
+  }
+}
+
+
+include_once(INSTAG_PATH . 'include/ws_functions.inc.php');
+
+add_event_handler('ws_add_methods', 'instagram_add_ws_method');
+
+?>
Index: extensions/instagram2piwigo/maintain.inc.php
===================================================================
--- extensions/instagram2piwigo/maintain.inc.php	(revision 19561)
+++ extensions/instagram2piwigo/maintain.inc.php	(revision 19561)
@@ -0,0 +1,75 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define(
+  'Instagram2Piwigo_default_config', 
+  serialize(array(
+    'api_key' => null,
+    'secret_key' => null,
+    ))
+  );
+
+
+function plugin_install() 
+{
+  global $conf;
+  
+  conf_update_param('Instagram2Piwigo', Instagram2Piwigo_default_config);
+  
+  mkdir($conf['data_location'].'instagram_cache/', 0755);
+}
+
+function plugin_activate()
+{
+  global $conf;
+
+  if (empty($conf['Instagram2Piwigo']))
+  {
+    conf_update_param('Instagram2Piwigo', Instagram2Piwigo_default_config);
+  }
+  
+  if (!file_exists($conf['data_location'].'instagram_cache/'))
+  {
+    mkdir($conf['data_location'].'instagram_cache/', 0755);
+  }
+}
+
+function plugin_uninstall() 
+{
+  global $conf;
+  
+  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "Instagram2Piwigo" LIMIT 1;');
+  
+  rrmdir($conf['data_location'].'instagram_cache/');
+}
+
+function rrmdir($dir)
+{
+  if (!is_dir($dir))
+  {
+    return false;
+  }
+  $dir = rtrim($dir, '/');
+  $objects = scandir($dir);
+  $return = true;
+  
+  foreach ($objects as $object)
+  {
+    if ($object !== '.' && $object !== '..')
+    {
+      $path = $dir.'/'.$object;
+      if (filetype($path) == 'dir') 
+      {
+        $return = $return && rrmdir($path); 
+      }
+      else 
+      {
+        $return = $return && @unlink($path);
+      }
+    }
+  }
+  
+  return $return && @rmdir($dir);
+} 
+
+?>
