Changeset 17476 for extensions/flickr2piwigo/admin/import.php
- Timestamp:
- Aug 8, 2012, 1:55:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/flickr2piwigo/admin/import.php
r17313 r17476 3 3 4 4 set_time_limit(600); 5 6 include_once(PICASA_WA_PATH . 'include/functions.inc.php'); 5 7 6 8 // check API parameters and connect to flickr … … 10 12 $_GET['action'] = 'error'; 11 13 } 12 else if ( ! function_exists('curl_init') and !ini_get('allow_url_fopen') )14 else if ( !test_remote_download() ) 13 15 { 14 16 array_push($page['errors'], l10n('No download method available')); … … 154 156 ;'; 155 157 $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); 157 159 158 160 // remove existing photos … … 199 201 FROM '.CATEGORIES_TABLE.' 200 202 ;'; 201 display_select_cat_wrapper($query, array(), 'associate_options');202 203 display_select_cat_wrapper($query, array(), 'category_parent_options'); 203 204 … … 223 224 224 225 $all_photos = array(); 225 foreach ($all_albums as &$album)226 foreach ($all_albums as $album) 226 227 { 227 228 $album_photos = $flickr->photosets_getPhotos($album['id'], NULL, NULL, 500, NULL, 'photos'); 228 229 $album_photos = $album_photos['photoset']['photo']; 229 230 230 foreach ($album_photos as &$photo)231 foreach ($album_photos as $photo) 231 232 { 232 233 $all_photos[ $photo['id'] ][] = $album['title']; 233 234 } 234 unset($photo); 235 } 236 unset($album); 235 } 237 236 238 237 // get existing photos … … 243 242 ;'; 244 243 $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); 246 245 247 246 // remove existing photos … … 281 280 FROM '.CATEGORIES_TABLE.' 282 281 ;'; 283 display_select_cat_wrapper($query, array(), 'associate_options', true);284 282 display_select_cat_wrapper($query, array(), 'category_parent_options'); 285 283 break;
Note: See TracChangeset
for help on using the changeset viewer.