Files
creator-child/single.php
2017-02-11 16:39:57 +01:00

180 lines
5.0 KiB
PHP
Executable File

<?php
get_header();
//include('exifer/exif.php');
?>
<div class="content">
<div class="container">
<div class="post_content">
<?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 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
$coord = array();
xdebug_start_trace(null,XDEBUG_TRACE_HTML);
the_content();
xdebug_stop_trace();
?>
<?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>';
?>
<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";
}
?>
];
// 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;
window.map = new google.maps.Map(document.getElementById('map'), {
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var bounds = new google.maps.LatLngBounds();
var markers = new Array();
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]
});
/*markers.push(marker);*/
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));
iconCounter++;
if (iconCounter >= iconsLength) {
iconCounter = 0;
}
}
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>',
'link_before' => '<span>',
'link_after' => '</span>'
));
?>
<?php if (dess_setting('dess_display_meta') == false) the_tags( '<div class="post_tags">' . __('Tags: ', 'CreatorThemeRes-child'), ', ', '</div>' ); ?>
</article>
<?php
if (current_user_can('edit_post')) {
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit post<span class="screen-reader-text"> "%s"</span>', 'CreatorThemeRes-child' ),
get_the_title()
),
'<span class="edit-link">',
'</span>'
);
}
?>
<?php creator_post_nav(); ?>
<div class="clear"></div>
<?php if ( comments_open() || '0' != get_comments_number() ) : ?>
<div class="home_blog_box">
<button id="togle">
<?php
_e('Display','CreatorThemeRes-child');
comments_number(esc_html__(' 0 Comment','CreatorThemeRes-child'), esc_html__(' 1 Comment','CreatorThemeRes-child'), '% '.esc_html__(' Comments','CreatorThemeRes-child') );
?>
</button>
<div class="comments_cont">
<?php
// If comments are open or we have at least one comment, load up the comment template
comments_template( '', true );
?>
</div>
</div>
<?php endif;
endwhile;
?>
</div>
</div>
</div>
<?php
get_footer();
?>