Ignore:
Timestamp:
Aug 8, 2012, 1:55:06 PM (12 years ago)
Author:
mistic100
Message:

some code corrections

File:
1 edited

Legend:

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

    r17313 r17476  
    33
    44set_time_limit(600);
     5
     6include_once(PICASA_WA_PATH . 'include/functions.inc.php');
    57
    68// check API parameters and connect to flickr
     
    1012  $_GET['action'] = 'error';
    1113}
    12 else if ( !function_exists('curl_init') and !ini_get('allow_url_fopen') )
     14else if ( !test_remote_download() )
    1315{
    1416  array_push($page['errors'], l10n('No download method available'));
     
    154156;';
    155157    $existing_photos = simple_hash_from_query($query, 'id', 'file');
    156     $existing_photos = array_map(create_function('$p', '$p=preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p); return $p;'), $existing_photos);
     158    $existing_photos = array_map(create_function('$p', 'return preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p);'), $existing_photos);
    157159   
    158160    // remove existing photos
     
    199201  FROM '.CATEGORIES_TABLE.'
    200202;';
    201     display_select_cat_wrapper($query, array(), 'associate_options');
    202203    display_select_cat_wrapper($query, array(), 'category_parent_options');
    203204   
     
    223224   
    224225    $all_photos = array();
    225     foreach ($all_albums as &$album)
     226    foreach ($all_albums as $album)
    226227    {
    227228      $album_photos = $flickr->photosets_getPhotos($album['id'], NULL, NULL, 500, NULL, 'photos');
    228229      $album_photos = $album_photos['photoset']['photo'];
    229230     
    230       foreach ($album_photos as &$photo)
     231      foreach ($album_photos as $photo)
    231232      {
    232233        $all_photos[ $photo['id'] ][] = $album['title'];
    233234      }
    234       unset($photo);
    235     }
    236     unset($album);
     235    }
    237236   
    238237    // get existing photos
     
    243242;';
    244243    $existing_photos = simple_hash_from_query($query, 'id', 'file');
    245     $existing_photos = array_map(create_function('$p', '$p=preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p); return $p;'), $existing_photos);
     244    $existing_photos = array_map(create_function('$p', 'return preg_replace("#^'.$flickr_prefix.'([0-9]+)\.([a-z]{3,4})$#i", "$1", $p);'), $existing_photos);
    246245   
    247246    // remove existing photos
     
    281280  FROM '.CATEGORIES_TABLE.'
    282281;';
    283     display_select_cat_wrapper($query, array(), 'associate_options', true);
    284282    display_select_cat_wrapper($query, array(), 'category_parent_options');
    285283    break;
Note: See TracChangeset for help on using the changeset viewer.