Changeset 20670
- Timestamp:
- Feb 10, 2013, 10:12:00 PM (11 years ago)
- Location:
- extensions/Google2Piwigo
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Google2Piwigo/admin/import.php
r20645 r20670 23 23 { 24 24 $_SESSION['gdata_auth_token'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']); 25 $_GET['action'] = 'log ued';25 $_GET['action'] = 'logged'; 26 26 } 27 27 … … 47 47 { 48 48 $login_url = Zend_Gdata_AuthSub::getAuthSubTokenUri( 49 get_absolute_root_url() .PICASA_WA_ADMIN . '-import',49 get_absolute_root_url() . PICASA_WA_ADMIN . '-import', 50 50 'https://picasaweb.google.com/data', 51 51 false, true … … 60 60 61 61 // message after login 62 case 'log ued':63 { 64 $_SESSION['page_infos'][] = l10n('Successfully log ued to you Google account');62 case 'logged': 63 { 64 $_SESSION['page_infos'][] = l10n('Successfully logged to you Google account'); 65 65 redirect(PICASA_WA_ADMIN . '-import'); 66 66 break; … … 85 85 { 86 86 $template->assign(array( 87 'logout_url' => PICASA_WA_ADMIN . '-import&action=logout', 87 'username' => $picasa->getUserEntry( $picasa->newUserQuery() )->getGphotoNickname()->getText(), 88 'logout_url' => PICASA_WA_ADMIN . '-import&action=logout', 88 89 'list_albums_url' => PICASA_WA_ADMIN . '-import&action=list_albums', 89 'import_all_url' => PICASA_WA_ADMIN . '-import&action=list_all',90 'import_all_url' => PICASA_WA_ADMIN . '-import&action=list_all', 90 91 )); 91 92 break; … … 102 103 { 103 104 array_push($albums, array( 104 'title' => $userEntry->title->text,105 'title' => $userEntry->title->text, 105 106 'description' => $userEntry->mediaGroup->description->text, 106 'photos' => $userEntry->gphotoNumPhotos->text,107 'U_LIST' => PICASA_WA_ADMIN . '-import&action=list_photos&album=' .$userEntry->gphotoId->text,107 'photos' => $userEntry->gphotoNumPhotos->text, 108 'U_LIST' => PICASA_WA_ADMIN . '-import&action=list_photos&album=' . $userEntry->gphotoId->text, 108 109 )); 109 110 } … … 139 140 { 140 141 array_push($all_photos, array( 141 'id' => $albumEntry->getGphotoId()->getText(),142 'name' => $albumEntry->mediaGroup->title->text,142 'id' => $albumEntry->getGphotoId()->getText(), 143 'name' => $albumEntry->mediaGroup->title->text, 143 144 'thumb' => $albumEntry->mediaGroup->thumbnail[1]->url, 144 'src' => $albumEntry->mediaGroup->content[0]->url,145 'url' => $albumEntry->link[2]->href,145 'src' => $albumEntry->mediaGroup->content[0]->url, 146 'url' => $albumEntry->link[2]->href, 146 147 )); 147 148 } … … 169 170 if ($duplicates>0) 170 171 { 171 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)); 172 array_push($page['infos'], l10n_dec( 173 'One picture is not displayed because already existing in the database.', 174 '%d pictures are not displayed because already existing in the database.', 175 $duplicates 176 )); 172 177 } 173 178 … … 177 182 178 183 $template->assign(array( 179 'nb_thumbs_set' => count($all_photos),184 'nb_thumbs_set' => count($all_photos), 180 185 'nb_thumbs_page' => count($page_photos), 181 'thumbnails' => $page_photos,182 'all_elements' => $all_elements,183 'album' => $_GET['album'],184 'F_ACTION' => PICASA_WA_ADMIN.'-import&action=import_set',185 'U_DISPLAY' => $self_url,186 'thumbnails' => $page_photos, 187 'all_elements' => $all_elements, 188 'album' => $_GET['album'], 189 'F_ACTION' => PICASA_WA_ADMIN.'-import&action=import_set', 190 'U_DISPLAY' => $self_url, 186 191 )); 187 192 … … 257 262 if ($duplicates>0) 258 263 { 259 array_push($page['infos'], l10n_dec('%d picture is not displayed because already existing in the database.', '%d pictures are not displayed because already existing in the database.', $duplicates)); 260 } 261 262 $template->assign(array( 263 'nb_elements' => count($all_photos), 264 array_push($page['infos'], l10n_dec( 265 '%d picture is not displayed because already existing in the database.', 266 '%d pictures are not displayed because already existing in the database.', 267 $duplicates 268 )); 269 } 270 271 $template->assign(array( 272 'nb_elements' => count($all_photos), 264 273 'all_elements' => json_encode($all_photos), 265 'F_ACTION' => PICASA_WA_ADMIN . '-import&action=import_set',274 'F_ACTION' => PICASA_WA_ADMIN . '-import&action=import_set', 266 275 )); 267 276 … … 287 296 288 297 289 $template->assign('ACTION', $_GET['action']); 290 291 $template->set_filename('picasa_web_albums', dirname(__FILE__) . '/template/import.tpl'); 298 $template->assign(array( 299 'ACTION' => $_GET['action'], 300 'GMAPS_LOADED' => !empty($pwg_loaded_plugins['rv_gmaps']), 301 )); 302 303 $template->set_filename('picasa_web_albums', realpath(PICASA_WA_PATH . '/admin/template/import.tpl')); 292 304 293 305 ?> -
extensions/Google2Piwigo/admin/template/import.list_all.tpl
r17475 r20670 120 120 <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|@translate}</label> 121 121 <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|@translate}</label> 122 <label><input type="checkbox" name="fill_ taken" checked="checked"> {'Creation date'|@translate}</label>122 <label><input type="checkbox" name="fill_date" checked="checked"> {'Creation date'|@translate}</label> 123 123 <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|@translate}</label> 124 {if $GMAPS_LOADED}<label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label>{/if} 124 125 </p> 125 126 -
extensions/Google2Piwigo/admin/template/import.list_photos.tpl
r17475 r20670 418 418 <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'|@translate}</label> 419 419 <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|@translate}</label> 420 {if $GMAPS_LOADED}<label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label>{/if} 420 421 </p> 421 422 -
extensions/Google2Piwigo/admin/template/import.tpl
r20645 r20670 35 35 36 36 <p> 37 <b>{'Logged in as'|@translate}</b> : {$username}<br><br> 37 38 <input type="submit" data="{$logout_url}" value="{'Logout'|@translate}"> 38 39 </p> -
extensions/Google2Piwigo/include/functions.inc.php
r17475 r20670 22 22 * @param: mixed destination file (if true, file content is returned) 23 23 */ 24 function picasa_wa_download_remote_file($src, $dest )24 function picasa_wa_download_remote_file($src, $dest, $headers=array()) 25 25 { 26 26 if (empty($src)) … … 30 30 31 31 $return = ($dest === true) ? true : false; 32 33 array_push($headers, 'Accept-language: en'); 32 34 33 35 /* curl */ … … 42 44 curl_setopt($ch, CURLOPT_URL, $src); 43 45 curl_setopt($ch, CURLOPT_HEADER, false); 44 curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-language: en"));46 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 45 47 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'); 46 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);47 curl_setopt($ch, CURLOPT_MAXREDIRS, 1);48 48 curl_setopt($ch, CURLOPT_TIMEOUT, 30); 49 if (!ini_get('safe_mode')) 50 { 51 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 52 curl_setopt($ch, CURLOPT_MAXREDIRS, 1); 53 } 49 54 if (strpos($src, 'https://') !== false) 50 55 { … … 87 92 'method' => "GET", 88 93 'user_agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', 89 'header' => "Accept-language: en",94 'header' => implode("\r\n", $headers), 90 95 ) 91 96 ); -
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)) -
extensions/Google2Piwigo/language/cs_CZ/plugin.lang.php
r17475 r20670 38 38 $lang['Processing...'] = 'Zpracovávání...'; 39 39 $lang['Reproduce Google albums'] = 'Vytvořit Google alba'; 40 $lang['Logged in as'] = 'Přihlášen jako'; 40 41 ?> -
extensions/Google2Piwigo/language/de_DE/plugin.lang.php
r17475 r20670 37 37 $lang['Processing...'] = 'Verarbeitung...'; 38 38 $lang['Reproduce Google albums'] = 'Google Album abbilden'; 39 $lang['Successfully log ued to you Google account'] = 'Erfolgreich beim Google Konto eingeloggt ';39 $lang['Successfully logged to you Google account'] = 'Erfolgreich beim Google Konto eingeloggt '; 40 40 $lang['%d elements ready for importation'] = '%d Elemente fertig zum Import'; 41 $lang['Logged in as'] = 'Login als'; 41 42 ?> -
extensions/Google2Piwigo/language/el_GR/plugin.lang.php
r17475 r20670 37 37 $lang['Processing...'] = 'Επεξεργασία ...'; 38 38 $lang['Reproduce Google albums'] = 'Αναπαραγωγή λευκώματος Google '; 39 $lang['Successfully log ued to you Google account'] = 'Συνδεθήκατε επιτυχώς στο Google λογαριασμό σας';39 $lang['Successfully logged to you Google account'] = 'Συνδεθήκατε επιτυχώς στο Google λογαριασμό σας'; 40 40 $lang['%d elements ready for importation'] = '%d στοιχεία έτοιμα για την εισαγωγή'; 41 41 ?> -
extensions/Google2Piwigo/language/en_UK/help.lang.html
r20645 r20670 3 3 <li>Write your domain name without the subdomain in the field (eg: <i>mydomain.com</i>, not <i>gallery.mydomain.com</i>) and click on <b>Add domain</b>.</li> 4 4 <li>Click on <b>Manage [mydomain.com]</b> and agree with the ToS.</li> 5 <li>Write your domain name WITH the subdomain (even if it is <i>www</i>) and <i>http://</i> prefix in the first field and save.</li>5 <li>Write your domain name WITH the subdomain (even if it is <i>www</i>) and the <i>http://</i> prefix in the first field and save.</li> 6 6 <ol> -
extensions/Google2Piwigo/language/en_UK/plugin.lang.php
r20662 r20670 1 1 <?php 2 2 3 $lang['Successfully log ued to you Google account'] = 'Successfully logged in to yourGoogle account';3 $lang['Successfully logged to you Google account'] = 'Successfully logged to you Google account'; 4 4 $lang['One picture is not displayed because already existing in the database.'] = 'One picture is not displayed because already existing in the database.'; 5 5 $lang['%d pictures are not displayed because already existing in the database.'] = '%d pictures are not displayed because already existing in the database.'; … … 22 22 $lang['Logged out'] = 'Logged out'; 23 23 $lang['%d elements ready for importation'] = '%d elements ready for importation'; 24 $lang['Geolocalization'] = 'Geolocalization'; 25 $lang['Logged in as'] = 'Logged in as'; 24 26 25 27 ?> -
extensions/Google2Piwigo/language/es_ES/plugin.lang.php
r17475 r20670 38 38 $lang['Processing...'] = 'Procesando...'; 39 39 $lang['Reproduce Google albums'] = 'Reproducir álbumes de Google'; 40 $lang['Successfully log ued to you Google account'] = 'Logueado con éxito en su cuenta de Google';40 $lang['Successfully logged to you Google account'] = 'Logueado con éxito en su cuenta de Google'; 41 41 $lang['%d elements ready for importation'] = '%d elementos listos para importar'; 42 $lang['Logged in as'] = 'Registrado como'; 42 43 ?> -
extensions/Google2Piwigo/language/fr_FR/plugin.lang.php
r18912 r20670 1 1 <?php 2 2 3 $lang['Successfully log ued to you Google account'] = 'Connecté à votre compte Google';3 $lang['Successfully logged to you Google account'] = 'Connecté à votre compte Google'; 4 4 $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'; 5 5 $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'; … … 22 22 $lang['Logged out'] = 'Déconnecté'; 23 23 $lang['%d elements ready for importation'] = '%d elements prêts à l\'importation'; 24 $lang['Logged in as'] = 'Indentifié en tant que'; 25 $lang['Geolocalization'] = 'Géolocalisation'; 24 26 25 27 ?> -
extensions/Google2Piwigo/language/it_IT/plugin.lang.php
r17475 r20670 37 37 $lang['Processing...'] = 'Elaborazione...'; 38 38 $lang['Reproduce Google albums'] = 'Riproduci gli album Google'; 39 $lang['Successfully logued to you Google account'] = 'Accesso al tuo account Google riuscito'; 39 $lang['Successfully logged to you Google account'] = 'Accesso al tuo account Google riuscito'; 40 $lang['Logged in as'] = 'Iscritto come'; 40 41 ?> -
extensions/Google2Piwigo/language/lv_LV/plugin.lang.php
r17475 r20670 38 38 $lang['Processing...'] = 'Apstrāde...'; 39 39 $lang['Reproduce Google albums'] = 'Reproducēt Google albūmus'; 40 $lang['Successfully logued to you Google account'] = 'Esat veiksmīgi pieteikušies savā Google kontā'; 40 $lang['Successfully logged to you Google account'] = 'Esat veiksmīgi pieteikušies savā Google kontā'; 41 $lang['Logged in as'] = 'Pieteicies kā'; 41 42 ?> -
extensions/Google2Piwigo/language/nl_NL/plugin.lang.php
r17475 r20670 38 38 $lang['Processing...'] = 'Bewerken ...'; 39 39 $lang['Reproduce Google albums'] = 'Reproduceer Google albums'; 40 $lang['Successfully logued to you Google account'] = 'Succesvol ingelogd in Google '; 40 $lang['Successfully logged to you Google account'] = 'Succesvol ingelogd in Google '; 41 $lang['Logged in as'] = 'Ingelogd als'; 41 42 ?> -
extensions/Google2Piwigo/language/pl_PL/plugin.lang.php
r20646 r20670 37 37 $lang['Processing...'] = 'Przetwarzanie...'; 38 38 $lang['Reproduce Google albums'] = 'Odbuduj albumy Google'; 39 $lang['Successfully logued to you Google account'] = 'Udane logowanie do Google'; 39 $lang['Successfully logged to you Google account'] = 'Udane logowanie do Google'; 40 $lang['Logged in as'] = 'Zalogowany jako'; 40 41 $lang['%d elements ready for importation'] = '%d elementów gotowych do importu'; 41 42 $lang['API not authenticated'] = 'API nieuwierzytelnione'; -
extensions/Google2Piwigo/language/pt_PT/plugin.lang.php
r17475 r20670 38 38 $lang['Processing...'] = 'Processando...'; 39 39 $lang['Reproduce Google albums'] = 'Reproduzir albuns Google'; 40 $lang['Successfully log ued to you Google account'] = 'Entrou com sucesso na sua conta Google';40 $lang['Successfully logged to you Google account'] = 'Entrou com sucesso na sua conta Google'; 41 41 $lang['%d elements ready for importation'] = '%d elementos prontos para a importação '; 42 $lang['Logged in as'] = 'Entrou como'; 42 43 ?> -
extensions/Google2Piwigo/language/ru_RU/plugin.lang.php
r17475 r20670 37 37 $lang['Processing...'] = 'Обработка ...'; 38 38 $lang['Reproduce Google albums'] = 'Воспроизведение альбомов Google'; 39 $lang['Successfully log ued to you Google account'] = 'Вы успешно вошли в свою учетную запись';39 $lang['Successfully logged to you Google account'] = 'Вы успешно вошли в свою учетную запись'; 40 40 ?> -
extensions/Google2Piwigo/language/sk_SK/plugin.lang.php
r17475 r20670 38 38 $lang['Processing...'] = 'Spracovávam...'; 39 39 $lang['Reproduce Google albums'] = 'Reprodukovať Google albumy'; 40 $lang['Successfully logued to you Google account'] = 'Úspešne prihlásený do Vášho Google konta'; 40 $lang['Successfully logged to you Google account'] = 'Úspešne prihlásený do Vášho Google konta'; 41 $lang['Logged in as'] = 'Prihlásený ako'; 41 42 ?> -
extensions/Google2Piwigo/language/tr_TR/plugin.lang.php
r17475 r20670 37 37 $lang['Processing...'] = 'İşleniyor...'; 38 38 $lang['Reproduce Google albums'] = 'Google albümlerini yeniden üret'; 39 $lang['Successfully logued to you Google account'] = 'Google \'de başarılı olarak oturum açıldı.'; 39 $lang['Successfully logged to you Google account'] = 'Google \'de başarılı olarak oturum açıldı.'; 40 $lang['Logged in as'] = 'Oturum açan:'; 40 41 ?> -
extensions/Google2Piwigo/language/uk_UA/plugin.lang.php
r17475 r20670 24 24 $lang['Processing...'] = 'Обробка...'; 25 25 $lang['Reproduce Google albums'] = 'Відтворити Google альбоми'; 26 $lang['Successfully log ued to you Google account'] = 'Успішно увійшли до вашого облікового запису Google';26 $lang['Successfully logged to you Google account'] = 'Успішно увійшли до вашого облікового запису Google'; 27 27 $lang['(%d photos)'] = '(%d зображень)'; 28 28 $lang['Begin transfer'] = 'Почати передачу';
Note: See TracChangeset
for help on using the changeset viewer.