' . _x( '←', 'Previous post link', 'twentyten' ) . ' %title' ); ?>
' . _x( '→', 'Next post link', 'twentyten' ) . '' ); ?>
>
', ']]>', $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]['lat'] = $gm_lat;
$coord[$j]['lng'] = $gm_lng;
$coord[$j]['mark'] = $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, '
![]()
]* srcset=\"([^\"]*)\"[^>]*>/Ui';
$patternZP = '/
]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU';
preg_match($patternZP, $ancien , $matches2);
$img = explode("/", $matches2[1]);
$zp_image = end($img);
$zp_album = prev($img);
//echo $zp_image;
$meta = zp_query($zp_image);
//preprint($meta);
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExifZP($meta);
if ($gm_lat != "") {
$coord[$j]['lat'] = $gm_lat;
$coord[$j]['lng'] = $gm_lng;
$coord[$j]['mark'] = str_replace("'", "\'", $title_marker);
$j++;
}
//$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";
$new_img .= $exif_list;
$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;
//preprint($coord);
?>
0) ? "block" : "none") . ';">
';
?>
'' . __( 'Pages:', 'twentyten' ), 'after' => '
' ) ); ?>
' . _x( '←', 'Previous post link', 'twentyten' ) . ' %title' ); ?>
' . _x( '→', 'Next post link', 'twentyten' ) . '' ); ?>