>

', ']]>', $content); // retina 2x if (function_exists( ' wr2x_init' ) ) $pattern = '/]* src=\"([^\"]*)\"[^>]*>/Ui'; // sans retina else $pattern = '/]*src=\"?([^\"]*)\"?([^>]*alt=\"?([^\"]*)\"?)?[^>]*>/Ui'; preg_match_all($pattern, $content , $matches, PREG_SET_ORDER); //$x = count($matches); //echo "matches wp: " . $x; //$pattern2 = '/]* srcset=\"([^\"]*)\"[^>]*>/Ui'; $pattern2 = '/]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU'; //$pattern2 = '/]* src=\"([^\"]*)\"[^>]*>/Ui'; preg_match_all($pattern2, $content , $matches, PREG_SET_ORDER); //preprint($matches); /* echo "matches2 zp: " . (count($matches) - $x); for ($i = 0; $i <= (count($matches) - 1); $i++) { //echo "" . $i . $matches[$i][0] . "
"; echo "" . $i . $matches[$i][1] . "
-----------------------------------------------
"; } echo "--------------------------------------------";*/ $coord = array(); $j = 0; $portrait = false; $new_img = ""; for ($i = 0; $i <= (count($matches) - 1); $i++) { $ancien = $matches[$i][0]; //echo $ancien; if (substr_count($ancien, 'wordpress') != 0) { $patternWP = '#wp-image-[0-9]{1,4}#'; if (preg_match($patternWP, $ancien, $matches2) === 1) { $attachment = substr($matches2[0],9); //$new_img = $ancien . '' . "\r\n" . '
Voir les Exifs
'."\r\n"; //echo "ancien wp: " . $ancien; //echo $ancien; //$ancien2 = str_replace("rel=\"", "rel=\"lightbox ", $ancien); $ancien2 = str_replace("Voir les Exifs
'."\r\n"; $new_img .= '
'."\r\n"; $new_img .= '
    '."\r\n"; $metadata = wp_get_attachment_metadata($attachment); list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment, $i); if ($gm_lat != "") { $coord[$j][0] = $gm_lat; $coord[$j][1] = $gm_lng; $coord[$j][2] = $title_marker; $j++; } $new_img .= $exif_list; $new_img .= '
'."\r\n"; } } // elseif (substr_count($ancien, 'zenphoto') != 0) { elseif ((substr_count($ancien, 'zenphoto') != 0) and (substr_count($ancien, ' $coord[2] => Titre (court) * locations[1] => $coord[4] => Description (long) locations[2] => $coord[0] => Latitude * locations[3] => $coord[1] => Longitude * locations[4] => $coord[5] => locations[5] => $coord[8] => Texte Wikipedia locations[6] => $coord[9] => Liens vers Wikipedia $coord[3] => attachment $coord[6] => requete wiki -> $coord[7] => <- requete wiki */ //$new_img = $ancien . '
' . "\r\n"; $new_img = $ancien . "\r\n"; // $caption .= '

'; $new_img .= ($title_marker != "") ? ('

' . $title_marker . '

') : "" . "\r\n"; //$new_img .= '

' . $title_marker . '

' . "\r\n"; $new_img .= '
Voir les Exifs
'."\r\n"; $new_img .= '
'."\r\n"; $new_img .= '
'."\r\n"; } else { // Autres sources que WP et ZP // //echo $ancien; if (substr_count($ancien, " portrait") != 0) { $ancien2 = str_replace(" portrait", " ", $ancien); $portrait = true; } else { $portrait = false; } //$anc = str_replace("/>", "class='aligncenter' style='width: " . (($portrait === false) ? "610" : "408") . "px;' />", $ancien); //$new_img = $anc . "\r\n"; } $content = str_replace($ancien, $new_img, $content); //echo $content; } echo $content; //var_dump($coord); ?> 0) ? "block" : "none") . ';">
'; //var_dump($coord); if (count($coord) > 0) { $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 /* Flickr: 2016-01-07_Renard_2905 WP: ZP: */ $b[] = $short; } var_dump($b); //echo "coord avant requete Wikipedia"; //var_dump($coord); $wiki = fmulticurl($b); //var_dump($wiki); //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++){ // [0] 1ere réponse, la plus pertinante //array_push($coord[$c], $lettrine, $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]); // Requete - Texte Wikipedia - Url Wikipedia array_push($coord[$c], $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]); //array_push($coord[$c], $wiki[$c][2][0], $wiki[$c][3][0]); } } //echo "coord après requete Wikipedia"; //var_dump($coord); ?>
"; ?>
'' ) ); ?>

', '' ); ?>