Geo
This commit is contained in:
105
single.php
105
single.php
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
get_header();
|
||||
//include('exifer/exif.php');
|
||||
?>
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
@@ -7,29 +8,108 @@ get_header();
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<article class="post_box" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1><?php the_title(); ?></h1>
|
||||
|
||||
|
||||
<?php //echo get_stylesheet_directory_uri();
|
||||
//$a = include(get_stylesheet_directory_uri() . '/exifer/exif.php');
|
||||
//echo "a: " . $a;
|
||||
?>
|
||||
<div class="entry-meta">
|
||||
<?php creator_entry_meta(); ?>
|
||||
<?php if (dess_setting('dess_display_meta') == true) creator_entry_meta(); ?>
|
||||
<?php //edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<?php the_content(); ?>
|
||||
|
||||
<?php
|
||||
$coord = array();
|
||||
the_content();
|
||||
?>
|
||||
|
||||
<?php //$content = apply_filters('the_content', get_the_content());
|
||||
//echo $content;
|
||||
|
||||
//preprint ($coord);
|
||||
|
||||
echo '<div id="map" style="display: ' . ((count($coord) > 0) ? "block" : "none") . ';"></div>';
|
||||
?>
|
||||
|
||||
<?php //wp_read_image_metadata( $file );
|
||||
$my_data = wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) );
|
||||
<script>
|
||||
function initMap() {
|
||||
var locations = [
|
||||
<?php
|
||||
$j = (count($coord) - 1);
|
||||
for ($i = 0; $i <= $j; $i++) {
|
||||
//echo "['<h4>" . $coord[$i][2] . "</h4>', " . $coord[$i][0] . ", " . $coord[$i][1] . "]" . (($i<$j) ? "," : "")."\r\n";
|
||||
echo "['<span class\"infowindow\">" . $coord[$i][2] . "</span>', " . $coord[$i][0] . ", " . $coord[$i][1] . "]" . (($i<$j) ? "," : "")."\r\n";
|
||||
}
|
||||
?>
|
||||
];
|
||||
|
||||
echo $my_data['image_meta']['credit'];
|
||||
?>
|
||||
// Setup the different icons and shadows
|
||||
var iconURLPrefix = 'https://maps.google.com/mapfiles/ms/icons/';
|
||||
|
||||
var icons = [
|
||||
iconURLPrefix + 'red-dot.png',
|
||||
iconURLPrefix + 'green-dot.png',
|
||||
iconURLPrefix + 'blue-dot.png',
|
||||
iconURLPrefix + 'orange-dot.png',
|
||||
iconURLPrefix + 'purple-dot.png',
|
||||
iconURLPrefix + 'pink-dot.png',
|
||||
iconURLPrefix + 'yellow-dot.png'
|
||||
]
|
||||
var iconsLength = icons.length;
|
||||
|
||||
<h3>EXIF Data</h3>
|
||||
<?php pa_the_post_thumbnail_exif_data(); ?>
|
||||
window.map = new google.maps.Map(document.getElementById('map'), {
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
});
|
||||
|
||||
<?php
|
||||
var infowindow = new google.maps.InfoWindow();
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
var iconCounter = 0;
|
||||
for (i = 0; i < locations.length; i++) {
|
||||
marker = new google.maps.Marker({
|
||||
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
|
||||
map: map,
|
||||
icon: icons[iconCounter]
|
||||
});
|
||||
|
||||
bounds.extend(marker.position);
|
||||
|
||||
google.maps.event.addListener(marker, 'click', (function (marker, i) {
|
||||
return function () {
|
||||
/*
|
||||
var contentString = '<div id="content">'+
|
||||
'<div id="siteNotice">'+
|
||||
'</div>'+
|
||||
'<h1 id="firstHeading" class="firstHeading">' + locations[i][0] + '</h1>'+
|
||||
'<div id="bodyContent">'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
infowindow.setContent(contentString);
|
||||
*/
|
||||
infowindow.setContent(locations[i][0]);
|
||||
infowindow.open(map, marker);
|
||||
}
|
||||
})(marker, i));
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
var listener = google.maps.event.addListener(map, "idle", function () {
|
||||
map.setZoom(8);
|
||||
google.maps.event.removeListener(listener);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
wp_link_pages(array(
|
||||
'before' => '<div class="link_pages">'.__('Pages', 'creator'),
|
||||
'after' => '</div>',
|
||||
@@ -37,8 +117,7 @@ get_header();
|
||||
'link_after' => '</span>'
|
||||
));
|
||||
?>
|
||||
<?php //the_tags( '<div class="post_tags">Tags: ', ', ', '</div>' ); ?>
|
||||
<?php the_tags( '<div class="post_tags">' . __('Tags: ', 'CreatorThemeRes-child'), ', ', '</div>' ); ?>
|
||||
<?php if (dess_setting('dess_display_meta') == false) the_tags( '<div class="post_tags">' . __('Tags: ', 'CreatorThemeRes-child'), ', ', '</div>' ); ?>
|
||||
</article>
|
||||
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user