Change folder

This commit is contained in:
2017-02-11 16:39:57 +01:00
parent 3b26d798a9
commit c7cb1d7a02
3 changed files with 109 additions and 85 deletions

View File

@@ -454,21 +454,19 @@ function zenphoto_handler($atts, $content=null) {
$selector = dess_setting('dess_lightbox_select'); $selector = dess_setting('dess_lightbox_select');
$zenphoto_url = dess_setting('dess_zenphoto'); $zenphoto_url = dess_setting('dess_zenphoto');
$size = dess_setting('dess_zp_size'); $size = dess_setting('dess_zp_size');
/*
$host = (($_SERVER['HTTPS'] != "") ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . '/zenphoto/';
if (substr_count($zenphoto_url2, "https") == 1) {
$zenphoto_url = (($_SERVER['HTTPS'] != "") ? substr_replace($zenphoto_url2, 'https', 0, 4) : $zenphoto_url2);
}
$zenphoto_url = $host;
*/
$album = ! empty( $atts['album'] ) ? $atts['album'] : ''; $album = ! empty( $atts['album'] ) ? $atts['album'] : '';
$album = filter_var($album, FILTER_SANITIZE_STRING); $album = filter_var($album, FILTER_SANITIZE_STRING);
$image = ! empty( $atts['image'] ) ? $atts['image'] : ''; $image = ! empty( $atts['image'] ) ? $atts['image'] : '';
$image = filter_var($image, FILTER_SANITIZE_STRING); $image = filter_var($image, FILTER_SANITIZE_STRING);
$size = 610; $caption = ! empty( $atts['caption'] ) ? $atts['caption'] : '';
$caption = filter_var($caption, FILTER_SANITIZE_STRING);
$rnd = rand (1000, 9999);
//$size = 610;
$folder = false; $folder = false;
$zenphoto_img = ""; $zenphoto_img = "";
@@ -512,53 +510,46 @@ function zenphoto_handler($atts, $content=null) {
$image = $img_album; $image = $img_album;
$folder = true; $folder = true;
} }
/*
if (isset($atts['folder'])) {
if ($atts['folder'] == "true") $folder = true;
}
*/
$img = substr($image, 0, strlen($image) - 4); $img = substr($image, 0, strlen($image) - 4);
$filename = $zenphoto_url . 'cache/' . $album . '/' . urlencode($img) . '_' . $size . '_watermark.jpg'; $filename = $_SERVER["DOCUMENT_ROOT"] . '/zenphoto/' . 'cache/' . $album . '/' . urlencode($img) . '_' . $size . '_watermark.jpg';
$zp_size = getimagesize(htmlentities($filename)); $zp_size = getimagesize(htmlentities($filename));
//if ($folder == false) $zenphoto_link = '<a rel="lightbox" href="' . $zenphoto_url . 'albums/' . $atts['album'] . '/' . $atts['image'] . '">'; $zenphoto_img = (($caption != "") ? '<div id="zp_' . $rnd . '" style="width: ' . ($zp_size[0] + 10) . 'px" class="wp-caption aligncenter">' : '');
//if ($folder == false) $zenphoto_link = '<a href="' . $zenphoto_url . 'albums/' . $atts['album'] . '/' . $atts['image'] . '" class="entry-content">';
if ($folder == false) $zenphoto_link = '<a href="' . $zenphoto_url . 'albums/' . $album . '/' . $image . '" class="' . $selector . '">'; if ($folder == false) $zenphoto_link = '<a href="' . $zenphoto_url . 'albums/' . $album . '/' . $image . '" class="' . $selector . '">';
else $zenphoto_link = '<a href="' . $zenphoto_url . $album . '">'; else $zenphoto_link = '<a href="' . $zenphoto_url . $album . '">';
$zenphoto_img .= $zenphoto_link; $zenphoto_img .= $zenphoto_link;
/*
$zenphoto_img .= '<picture data-picture data-alt=""> $zenphoto_img .= '<picture data-picture data-alt="">
<!--[if IE 9]><video style="display: none;"><![endif]--> <!--[if IE 9]><video style="display: none;"><![endif]-->
<source class="image_standard" srcset="' . $zenphoto_url . 'cache/' . $album . '/' . $img . '_' . $size . '_watermark.jpg, ' . $zenphoto_url . 'cache/' . $album . '/' . $img . '_' . ($size * 2) . '_watermark.jpg 2x"> <source class="image_standard" srcset="' . $zenphoto_url . 'cache/' . $album . '/' . $img . '_' . $size . '_watermark.jpg, ' . $zenphoto_url . 'cache/' . $album . '/' . $img . '_FULL' . '_watermark.jpg 2x">
<source class="image_medium" srcset="" media="(max-width: 767px)"> <source class="image_medium" srcset="" media="(max-width: 767px)">
<source class="image_small" srcset="" media="(max-width: 767px)"> <source class="image_small" srcset="" media="(max-width: 767px)">
<!--[if IE 9]></video><![endif]--> <!--[if IE 9]></video><![endif]-->
<img class="aligncenter" srcset="' . $zenphoto_url . 'cache/' . $album . '/' . $img . '_' . $size . '_watermark.jpg" ' . $zp_size[3] . 'alt="' . $img . '" /> <img class="aligncenter" srcset="' . $zenphoto_url . 'cache/' . $album . '/' . $img . '_' . $size . '_watermark.jpg" ' . $zp_size[3] . 'alt="' . $img . '" />
</picture>'; </picture>';
*/
$zenphoto_img .= '<img class="';
$zenphoto_img .= (($caption == "") ? 'aligncenter size-medium"' : '"');
$zenphoto_img .= 'srcset="' . $zenphoto_url . 'cache/' . $album . '/' . $img . ' _' . $size . '_watermark.jpg, ' . $zenphoto_url . 'albums/' . $album . '/'. $image . ' 2x" alt="…" />';
$zenphoto_img .= '</a>'; $zenphoto_img .= '</a>';
/* $zenphoto_img .= (($caption != "") ? '<p class="wp-caption-text">' . $caption . '</p></div>' : '');
$a = $atts['image'];
$b = zp_query_exif($a); // ligne 808
if ($b['image_meta']['description'] != "") {
$caption = "";
$caption .= '<p class="wp-caption-text aligncenter" style="width:' . $zp_size[0] . 'px">';
$caption .= $b['image_meta']['description'] . '</p>';
$zenphoto_img .= $caption;
}
*/
return $zenphoto_img; return $zenphoto_img;
} }
add_shortcode( 'zenphoto', 'zenphoto_handler' ); add_shortcode( 'zenphoto', 'zenphoto_handler' );
/*
zp_query: récupère les exifs depuis la bdd zenphoto
*/
function zp_query_exif($zpimage) { function zp_query_exif($zpimage) {
$exif = array(); $exif = array();
require('../Connections/cnx.php'); require('../Connections/cnx.php');
@@ -572,14 +563,12 @@ function zp_query_exif($zpimage) {
$excquery .= "`EXIFGPSLatitude`, `EXIFGPSLatitudeRef`, `EXIFGPSLongitude`, `EXIFGPSLongitudeRef`, `EXIFGPSAltitude`, `EXIFGPSAltitudeRef`, "; $excquery .= "`EXIFGPSLatitude`, `EXIFGPSLatitudeRef`, `EXIFGPSLongitude`, `EXIFGPSLongitudeRef`, `EXIFGPSAltitude`, `EXIFGPSAltitudeRef`, ";
$excquery .= "`desc`, `title`, `EXIFLensType`, `EXIFLensInfo`, `EXIFOrientation`, `credit`, `copyright`, `id` "; $excquery .= "`desc`, `title`, `EXIFLensType`, `EXIFLensInfo`, `EXIFOrientation`, `credit`, `copyright`, `id` ";
$excquery .= "FROM `" . $zp_prefix . "images` WHERE `filename` = \"$zpimage\""; $excquery .= "FROM `" . $zp_prefix . "images` WHERE `filename` = \"$zpimage\"";
//echo $excquery;
if ($result = $mysqli->query($excquery)) { if ($result = $mysqli->query($excquery)) {
$exif = $result->fetch_row(); $exif = $result->fetch_row();
$result->close(); $result->close();
} }
//preprint($exif);
/* /*
Array Array
( (
@@ -712,11 +701,10 @@ function add_class_lightbox($content) {
$selector = dess_setting('dess_lightbox_select'); $selector = dess_setting('dess_lightbox_select');
//$selector = "gallery";
//Check the page for link images direct to image (no trailing attributes) //Check the page for link images direct to image (no trailing attributes)
$string = '/<a href="(.*?).(jpg|jpeg|png|gif|bmp|ico)"><img(.*?)class="(.*?)wp-image-(.*?)" \/><\/a>/i'; $string = '/<a href="(.*?).(jpg|jpeg|png|gif|bmp|ico)"><img(.*?)class="(.*?)wp-image-(.*?)" \/><\/a>/i';
preg_match_all( $string, $content, $matches, PREG_SET_ORDER); preg_match_all( $string, $content, $matches, PREG_SET_ORDER);
//preprint($matches);
//Check which attachment is referenced //Check which attachment is referenced
foreach ($matches as $val) { foreach ($matches as $val) {
$slimbox_caption = ''; $slimbox_caption = '';
@@ -726,17 +714,14 @@ function add_class_lightbox($content) {
//Replace the instance with the lightbox and title(caption) references. Won't fail if caption is empty. //Replace the instance with the lightbox and title(caption) references. Won't fail if caption is empty.
$string = '<a href="' . $val[1] . '.' . $val[2] . '"><img' . $val[3] . 'class="' . $val[4] . 'wp-image-' . $val[5] . '" /></a>'; $string = '<a href="' . $val[1] . '.' . $val[2] . '"><img' . $val[3] . 'class="' . $val[4] . 'wp-image-' . $val[5] . '" /></a>';
//echo "string" . "<br>" . $string;
//$replace = '<a href="' . $val[1] . '.' . $val[2] . '" class="gallery" title="' . $slimbox_caption . '"><img' . $val[3] . 'class="' . $val[4] . 'wp-image-' . $val[5] . '" /></a>';
$replace = '<a href="' . $val[1] . '.' . $val[2] . '" class="' . $selector . '" ' . (($slimbox_caption != "") ? 'title="' . $slimbox_caption . '"' : '') .'><img' . $val[3] . 'class="' . $val[4] . 'wp-image-' . $val[5] . '" /></a>'; $replace = '<a href="' . $val[1] . '.' . $val[2] . '" class="' . $selector . '" ' . (($slimbox_caption != "") ? 'title="' . $slimbox_caption . '"' : '') .'><img' . $val[3] . 'class="' . $val[4] . 'wp-image-' . $val[5] . '" /></a>';
//echo "replace" . "<br>" . $replace;
$content = str_replace( $string, $replace, $content); $content = str_replace( $string, $replace, $content);
} }
return $content; return $content;
} }
//add_filter('the_content', 'add_class_lightbox', 2); add_filter('the_content', 'add_class_lightbox', 2);
if ( ! function_exists( 'creator_post_nav' ) ) : if ( ! function_exists( 'creator_post_nav' ) ) :
@@ -848,12 +833,19 @@ function addexif ($content) {
$display_exif = dess_setting('dess_display_exif'); $display_exif = dess_setting('dess_display_exif');
$display_gps = dess_setting('dess_display_gps'); $display_gps = dess_setting('dess_display_gps');
/*
# Avec ini_set (suffixage automatique avec un timestamp) :
ini_set('xdebug.trace_output_dir', dirname(__FILE__));
ini_set('xdebug.trace_output_name', 'xdebug_trace_%u');
xdebug_start_trace(null, XDEBUG_TRACE_COMPUTERIZED);
# Fichier unique :
xdebug_start_trace('/Users/bruno/Sites', XDEBUG_TRACE_COMPUTERIZED);
*/
if ($display_exif == true) { if ($display_exif == true) {
$matches3 = array(); $matches3 = array();
//$coord = array();
// Le caption // Le caption
//$pattern = '/<p .*?class="wp-caption-text">(.*?)<\/p>/'; //$pattern = '/<p .*?class="wp-caption-text">(.*?)<\/p>/';
@@ -866,15 +858,15 @@ function addexif ($content) {
//$pattern = '/<div id=\"?([^\"]*)\"?[^>]*>(.*?)\<\/div>/'; //$pattern = '/<div id=\"?([^\"]*)\"?[^>]*>(.*?)\<\/div>/';
// `1049` // `1049`
$pattern = '/<div id=\"attachment_?([^\"]*)\"?[^>]*>(.*?)\<\/div>/'; //$pattern = '/<div id=[^>]*>(.*?)\<\/div>/';
$pattern = '/<div id=\"(zp|attachment)_?([^\"]*)\"?[^>]*>(.*?)\<\/div>/';
//$pattern = '/<div id=\"attachment_?([^\"]*)\"?[^>]*>(.*?)\<\/div>/';
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER); preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);
var_dump($matches);
/* /*
echo "matches[0][0]"; //<div id="attachment_1049">...</div> echo "matches[0][0]"; //<div id="attachment_1049">...</div>
echo $matches[0][0];
echo "matches[0][1]"; // 1114 echo "matches[0][1]"; // 1114
echo $matches[0][1];
echo "matches[0][2]"; // <a href>...</a> echo "matches[0][2]"; // <a href>...</a>
echo $matches[0][2];
*/ */
// Pour tous les DIV (attachment) on cherche les <A HREF> // Pour tous les DIV (attachment) on cherche les <A HREF>
@@ -893,12 +885,18 @@ function addexif ($content) {
echo "matches2[0][2]"; // <img src="http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-1180x787.jpg" alt="Vautour dans le brouillard de Rémuzat" width="1180" height="787" class="size-large wp-image-1114" srcset="http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-1180x787.jpg 1180w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-200x133.jpg 200w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-800x534.jpg 800w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-1180x787@2x.jpg 2360w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-200x133@2x.jpg 400w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-800x534@2x.jpg 1600w" sizes="(max-width: 1180px) 100vw, 1180px"> echo "matches2[0][2]"; // <img src="http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-1180x787.jpg" alt="Vautour dans le brouillard de Rémuzat" width="1180" height="787" class="size-large wp-image-1114" srcset="http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-1180x787.jpg 1180w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-200x133.jpg 200w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-800x534.jpg 800w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-1180x787@2x.jpg 2360w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-200x133@2x.jpg 400w, http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-12-01_VautourFauve_8789-800x534@2x.jpg 1600w" sizes="(max-width: 1180px) 100vw, 1180px">
echo $matches2[0][2]; echo $matches2[0][2];
*/ */
//echo "count(matches2): " . count($matches2) . "<br>";
$court = $matches2[0][1]; $court = $matches2[0][1];
$meta = creator_get_exif( $court ); if (substr_count($court, "wordpress") > 0) $meta = creator_get_exif( $court );
//preprint($meta); elseif (substr_count($court, "zenphoto") > 0) {
echo $court;
$img = explode("/", $court);
$zp_image = end($img);
$zp_album = prev($img);
$meta = zp_query_exif( $zp_image );
}
$exif_array = img_wp_exif( $meta ); $exif_array = img_wp_exif( $meta );
$exifs = "<div class='image-exif'>" . $exif_array[0] . (($display_gps == true) ? $exif_array[2] : '') . "</div>"; $exifs = "<div class='image-exif'>" . $exif_array[0] . (($display_gps == true) ? $exif_array[2] : '') . "</div>";
$content = str_replace($matches[$i][0], $matches[$i][0] . $exifs, $content); $content = str_replace($matches[$i][0], $matches[$i][0] . $exifs, $content);
@@ -916,6 +914,7 @@ function addexif ($content) {
$pattern2 = '/<a\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU'; $pattern2 = '/<a\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU';
preg_match_all($pattern2, $content , $matches4, PREG_SET_ORDER); preg_match_all($pattern2, $content , $matches4, PREG_SET_ORDER);
var_dump($matches4);
for ($i = 0; $i <= (count($matches4) - 1); $i++) { for ($i = 0; $i <= (count($matches4) - 1); $i++) {
$ancien = $matches4[$i][0]; $ancien = $matches4[$i][0];
@@ -923,7 +922,6 @@ function addexif ($content) {
// si source wordpress // si source wordpress
if (substr_count($ancien, "wordpress") > 0) { if (substr_count($ancien, "wordpress") > 0) {
//echo "ancien: " . htmlentities($ancien) . "<br>";
/* /*
$patternWP = '#wp-image-[0-9]{1,4}#'; $patternWP = '#wp-image-[0-9]{1,4}#';
if (preg_match($patternWP, $ancien, $matches5) === 1) { if (preg_match($patternWP, $ancien, $matches5) === 1) {
@@ -932,13 +930,9 @@ function addexif ($content) {
// si $court est déjà dans $matches3 (si l'image est déjà dans un DIV) // si $court est déjà dans $matches3 (si l'image est déjà dans un DIV)
if (in_multiarray($court, $matches3) == false) { if (in_multiarray($court, $matches3) == false) {
//echo "<b>ancien: </b>" . htmlentities($ancien) . "<br>";
//echo "<b>court: </b>" . htmlentities($court) . "<br>";
$meta = creator_get_exif( $court ); $meta = creator_get_exif( $court );
$exif_array = img_wp_exif( $meta ); $exif_array = img_wp_exif( $meta );
$exifs = "<div class='image-exif'>" . $exif_array[0] . (($display_gps == true) ? $exif_array[2] : '') . "</div>"; $exifs = "<div class='image-exif'>" . $exif_array[0] . (($display_gps == true) ? $exif_array[2] : '') . "</div>";
$content = str_replace($matches4[$i][0], $matches4[$i][0] . $exifs, $content); $content = str_replace($matches4[$i][0], $matches4[$i][0] . $exifs, $content);
if (($meta['longitude'] != "") && ($meta['latitude'] != "")) { if (($meta['longitude'] != "") && ($meta['latitude'] != "")) {
@@ -953,7 +947,10 @@ function addexif ($content) {
// si source zenphoto // si source zenphoto
elseif ((substr_count($ancien, 'zenphoto') != 0) and (substr_count($ancien, '<img') != 0)){ elseif ((substr_count($ancien, 'zenphoto') != 0) and (substr_count($ancien, '<img') != 0)){
echo "<b>zenphoto</b>" . "<br>"; // bug: si 2x la même image, les exifs sont affichés 2x
// si $court est déjà dans $matches3 (si l'image est déjà dans un DIV)
if (in_multiarray($court, $matches3) == false) {
$patternZP = '/<a\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU'; $patternZP = '/<a\s[^>]*href=\"([^\"]*)\"[^>]*>(.*)<\/a>/siU';
preg_match($patternZP, $ancien , $matches2); preg_match($patternZP, $ancien , $matches2);
@@ -964,24 +961,26 @@ function addexif ($content) {
$meta = zp_query_exif( $zp_image ); $meta = zp_query_exif( $zp_image );
$exif_array = img_wp_exif( $meta ); $exif_array = img_wp_exif( $meta );
$exifs = "<div class='image-exif'>" . $exif_array[0] . (($display_gps == true) ? $exif_array[2] : '') . "</div>"; $exifs = "<div class='image-exif rouge'>" . $exif_array[0] . (($display_gps == true) ? $exif_array[2] : '') . "</div>";
$content = str_replace($matches4[$i][0], $matches4[$i][0] . $exifs, $content); $content = str_replace($matches4[$i][0], $matches4[$i][0] . $exifs, $content);
$exifs = "";
if (($meta['longitude'] != "") && ($meta['latitude'] != "")) { if (($meta['longitude'] != "") && ($meta['latitude'] != "")) {
if ($meta['caption'] != "") $fichier = $meta['caption']; if ($meta['caption'] != "") $fichier = $meta['caption'];
else if ($meta['title'] != "") $fichier = $meta['title']; else if ($meta['title'] != "") $fichier = $meta['title'];
else $fichier = end(explode("/", $court)); else $fichier = end(explode("/", $court));
array_push($coord, array($meta['latitude'], $meta['longitude'], $fichier)); array_push($coord, array($meta['latitude'], $meta['longitude'], $fichier));
} }
} // if in_multiarray
} // else zenphoto } // else zenphoto
// Autres sources que WP et ZP // Autres sources que WP et ZP
elseif (substr_count($ancien, 'jpg') > 0) { elseif (substr_count($ancien, 'jpg') > 0) {
echo $ancien; echo "court2: " . $court . "<br>";
$meta = creator_get_exif( $court ); $meta = creator_get_exif( $court );
//$flk_size = getimagesize(htmlentities($filename3));
/* /*
Flicker (portrait): Flicker (portrait):
<a href="https://flic.kr/p/Cn2dTd"><img src="https://farm2.staticflickr.com/1704/23866728514_76a72305a9_c.jpg" portrait /></a> <a href="https://flic.kr/p/Cn2dTd"><img src="https://farm2.staticflickr.com/1704/23866728514_76a72305a9_c.jpg" portrait /></a>
@@ -1008,15 +1007,10 @@ function addexif ($content) {
//$anc = str_replace("/></a>", "class='aligncenter' /></a>", $ancien) . "\r\n"; //$anc = str_replace("/></a>", "class='aligncenter' /></a>", $ancien) . "\r\n";
} // else } // else
$exif = "";
} // for } // for
//preprint ($coord);
return $content; return $content;
} }
@@ -1114,6 +1108,7 @@ function creator_get_exif( $file ) {
return false; return false;
} }
*/ */
//echo "file: " . $file . "<br>";
list( , , $sourceImageType ) = getimagesize( $file ); list( , , $sourceImageType ) = getimagesize( $file );
@@ -1629,6 +1624,17 @@ function childtheme_customize_register( $wp_customize ) {
'section' => 'settings_section', 'section' => 'settings_section',
'type' => 'text', 'type' => 'text',
))); )));
$wp_customize->add_setting('dess_zp_size', array(
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'sanitize_callback' => 'dess_sanitize_html',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'dess_zp_size', array(
'settings' => 'dess_zp_size',
'label' => __('Zenphoto image size (px)','CreatorThemeRes-child'),
'section' => 'settings_section',
'type' => 'text',
)));
$wp_customize->add_setting('dess_social_size', array( $wp_customize->add_setting('dess_social_size', array(
'capability' => 'edit_theme_options', 'capability' => 'edit_theme_options',
'type' => 'theme_mod', 'type' => 'theme_mod',

View File

@@ -20,7 +20,12 @@ get_header();
<?php <?php
$coord = array(); $coord = array();
xdebug_start_trace(null,XDEBUG_TRACE_HTML);
the_content(); the_content();
xdebug_stop_trace();
?> ?>
<?php //$content = apply_filters('the_content', get_the_content()); <?php //$content = apply_filters('the_content', get_the_content());
@@ -65,6 +70,7 @@ get_header();
var bounds = new google.maps.LatLngBounds(); var bounds = new google.maps.LatLngBounds();
var markers = new Array();
var iconCounter = 0; var iconCounter = 0;
for (i = 0; i < locations.length; i++) { for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({ marker = new google.maps.Marker({
@@ -73,6 +79,8 @@ get_header();
icon: icons[iconCounter] icon: icons[iconCounter]
}); });
/*markers.push(marker);*/
bounds.extend(marker.position); bounds.extend(marker.position);
google.maps.event.addListener(marker, 'click', (function (marker, i) { google.maps.event.addListener(marker, 'click', (function (marker, i) {
@@ -91,6 +99,12 @@ get_header();
infowindow.open(map, marker); infowindow.open(map, marker);
} }
})(marker, i)); })(marker, i));
iconCounter++;
if (iconCounter >= iconsLength) {
iconCounter = 0;
}
} }
map.fitBounds(bounds); map.fitBounds(bounds);

View File

@@ -154,6 +154,7 @@ input.search-field {
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
text-align: center; text-align: center;
margin-bottom: 32px;
} }
.exif-data { .exif-data {
@@ -176,6 +177,9 @@ input.search-field {
/* Single */ /* Single */
.zenphoto {
margin-bottom: 16px;
}
.wp-caption { .wp-caption {
margin-top: 24px !important; margin-top: 24px !important;
margin-bottom: 8px !important; margin-bottom: 8px !important;