'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'posts_per_page' => - 1, //'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1), ); $query_images = new WP_Query($query_images_args); //var_dump($query_images); ?>
posts as $image ) { $images = wp_get_attachment_url( $image->ID ); //var_dump($images); $attribut = wp_prepare_attachment_for_js( $image->ID ); //var_dump($attribut); $photo = wp_get_attachment_metadata( $image->ID ); $exifs = $photo['image_meta']; if ((safe_array_access($exifs, 'latitude')) && (safe_array_access($exifs, 'longitude'))) { //if ((isset($exifs['latitude'])) && (isset($exifs['longitude']))) { $lat = gps($exifs['latitude'], trim($exifs['latitude_ref'])); $long = gps($exifs['longitude'], trim($exifs['longitude_ref'])); /**/ $attach = $attribut['id']; $caption = ""; $capt = $attribut['caption']; $title = $attribut['title']; $alt = $attribut['alt']; $image = $attribut['url']; $description = $attribut['description']; $thumbnail = $attribut['sizes']['thumbnail']; //$thumbnail = '' . $attribut['alt'] . ''; $thumbnailWiki = '' . $attribut['alt'] . ''; //echo $thumbnail; /* array (size=4) 'thumbnail' => array (size=4) 'height' => int 200 'width' => int 200 'url' => string 'http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-06-24_LaPleureuse-LaSauffaz_0729-200x200.jpg' (length=111) 'orientation' => string 'landscape' (length=9) */ // ?????? $gallery[] = $attach; /* if ($capt != "") $caption = $capt; elseif ($title != "") $caption = $title; */ if ($capt != "") { $caption = $capt; $requete_wiki = trim(supp_entre_parenth($capt)); } elseif ($title != "") { $caption = $title; $requete_wiki = trim(clean_photo_name($title)); } // On crée le tableau $coord qui regroupe toutes les données pour le waypoint (lat,long, titre, n° attachment, description, vignette) //array_push($coord, array(number_format($lat, 6), number_format($long, 6), $caption, $attach, $description, $thumbnail)); array_push($coord, array(number_format($lat, 6), number_format($long, 6), $caption, $attach, $description, $thumbnailWiki, $requete_wiki)); } //if } //foreach // On crée la galerie $html5 = current_theme_supports( 'html5', 'gallery' ); $html5 = false; $galerie = array( 'ids' => $gallery, 'itemtag' => $html5 ? 'figure' : 'dl', 'icontag' => $html5 ? 'div' : 'dt', 'captiontag' => $html5 ? 'figcaption' : 'dd', 'columns' => 3, 'size' => 'thumbnail', 'link' => 'file' // file - none - '' //'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1), ); $gal = mapgallery($galerie); echo $gal; ?> 0) { //echo "avant requete Wikipedia"; //var_dump($coord); /* 0 => array (size=6) 0 => string '46.012405' (length=9) 1 => string '6.758742' (length=8) 2 => string 'Cascades de la Pleureuse et de la Sauffaz' (length=41) 3 => int 70 4 => string 'Description' (length=11) 5 => string '\"cascade\"' (length=193) */ $b = array(); // Avec tous les titres, on crée la requete pour Wikipédia for ($a = 0; $a < count($coord); $a++){ $short = $coord[$a][6]; // Titre $b[] = $short; } $wiki = fmulticurl($b); //On rajoute à $coord les données récupérées sur Wikipédia if (count($coord) == count($wiki)) { for ($c = 0; $c < count($wiki); $c++){ array_push($coord[$c], $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]); } } //echo "après requete Wikipedia"; //var_dump($coord); ?>
"; ?>
int 1600 'height' => int 1067 'file' => string '2017/01/2016-06-24_LaPleureuse-LaSauffaz_0729.jpg' (length=49) 'sizes' => array (size=3) 'thumbnail' => array (size=4) 'file' => string '2016-06-24_LaPleureuse-LaSauffaz_0729-200x200.jpg' (length=49) 'width' => int 200 'height' => int 200 'mime-type' => string 'image/jpeg' (length=10) 'medium' => array (size=4) 'file' => string '2016-06-24_LaPleureuse-LaSauffaz_0729-800x534.jpg' (length=49) 'width' => int 800 'height' => int 534 'mime-type' => string 'image/jpeg' (length=10) 'large' => array (size=4) 'file' => string '2016-06-24_LaPleureuse-LaSauffaz_0729-1180x787.jpg' (length=50) 'width' => int 1180 'height' => int 787 'mime-type' => string 'image/jpeg' (length=10) 'image_meta' => array (size=16) 'aperture' => string '14' (length=2) 'credit' => string '' (length=0) 'camera' => string 'Canon EOS 5D Mark III' (length=21) 'caption' => string '' (length=0) 'created_timestamp' => string '1466758515' (length=10) 'copyright' => string '' (length=0) 'focal_length' => string '17' (length=2) 'iso' => string '100' (length=3) 'shutter_speed' => string '0.04' (length=4) 'title' => string '' (length=0) 'orientation' => string '1' (length=1) 'keywords' => array (size=5) 0 => string 'France' (length=6) 1 => string 'Haute-Savoie' (length=12) 2 => string 'Rhone-Alpes' (length=11) 3 => string 'cascade de la Pleureuse' (length=23) 4 => string 'cascade de la Sauffaz' (length=21) 'latitude' => array (size=3) 0 => string '46/1' (length=4) 1 => string '7443/10000' (length=10) 2 => string '0/1' (length=3) 'latitude_ref' => string 'N' (length=1) 'longitude' => array (size=3) 0 => string '6/1' (length=3) 1 => string '455245/10000' (length=12) 2 => string '0/1' (length=3) 'longitude_ref' => string 'E' (length=1) */ ?>