Changeset 20670 for extensions/Google2Piwigo/include/ws_functions.inc.php
- Timestamp:
- Feb 10, 2013, 10:12:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Google2Piwigo/include/ws_functions.inc.php
r19834 r20670 13 13 'pwa_album' => array(), 14 14 'category' => array(), 15 'fills' => array('default' => null),15 'fills' => array('default' => 'fill_name,fill_author,fill_tags,fill_date,fill_description'), 16 16 ), 17 17 'Used by Picasa Web Albums' … … 26 26 } 27 27 28 global $conf ;28 global $conf, $pwg_loaded_plugins; 29 29 30 30 include_once(PHPWG_ROOT_PATH . 'admin/include/functions.php'); … … 57 57 $query->setPhotoId($params['id']); 58 58 $query->setImgMax('d'); 59 $photoEntry = $picasa->getPhoto Feed($query);60 59 $photoEntry = $picasa->getPhotoEntry($query); 60 61 61 $photo = array( 62 'id' => $params['id'], 63 'url' => $photoEntry->mediaGroup->content[0]->url, 64 'title' => get_filename_wo_extension($photoEntry->mediagroup->title->text), 65 'author' => $photoEntry->mediaGroup->credit[0]->text, 66 'description' => $photoEntry->mediagroup->description->text, 67 'tags' => $photoEntry->mediagroup->keywords->text, 68 'timestamp' => substr($photoEntry->gphotoTimestamp->text, 0, -3), 62 'id' => $params['id'], 63 'url' => $photoEntry->getMediaGroup()->content[0]->getUrl(), 64 'title' => get_filename_wo_extension($photoEntry->getMediaGroup()->getTitle()->getText()), 65 'author' => $photoEntry->getMediaGroup()->credit[0]->getText(), 66 'description' => $photoEntry->getMediaGroup()->getDescription()->getText(), 67 'tags' => $photoEntry->getMediaGroup()->getKeywords()->getText(), 68 'timestamp' => substr($photoEntry->getGphotoTimestamp(), 0, -3), 69 'latlon' => null, 69 70 ); 71 70 72 $photo['path'] = PICASA_WA_CACHE . 'picasa-'.$photo['id'].'.'.get_extension($photo['url']); 71 73 72 file_put_contents('dump.txt', print_r($photo, true), FILE_APPEND); 74 if ($photoEntry->getGeoRssWhere() !== null && !empty($pwg_loaded_plugins['rv_gmaps'])) 75 { 76 $photo['latlon'] = $photoEntry->getGeoRssWhere()->getPoint()->getPos()->getText(); 77 } 73 78 74 79 // copy file … … 128 133 $updates = array(); 129 134 if (in_array('fill_name', $params['fills'])) $updates['name'] = pwg_db_real_escape_string($photo['title']); 130 if (in_array('fill_ taken', $params['fills']))$updates['date_creation'] = date('Y-m-d H:i:s', $photo['timestamp']);135 if (in_array('fill_date', $params['fills'])) $updates['date_creation'] = date('Y-m-d H:i:s', $photo['timestamp']); 131 136 if (in_array('fill_author', $params['fills'])) $updates['author'] = pwg_db_real_escape_string($photo['author']); 132 137 if (in_array('fill_description', $params['fills'])) $updates['comment'] = pwg_db_real_escape_string($photo['description']); 138 if (in_array('fill_geotag', $params['fills']) and !empty($photo['latlon']) ) 139 { 140 $latlon = explode(' ', $photo['latlon']); 141 if (count($latlon) == 2) 142 { 143 $updates['lat'] = pwg_db_real_escape_string($latlon[0]); 144 $updates['lon'] = pwg_db_real_escape_string($latlon[1]); 145 } 146 } 133 147 134 148 if (count($updates))
Note: See TracChangeset
for help on using the changeset viewer.