Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Updating Custom Post Meta Issue 1

By: a guest on May 24th, 2012  |  syntax: None  |  size: 1.76 KB  |  views: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function heymap_post_class_meta_box($post) {
  2.        
  3.         echo '<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>'. "\n";
  4.         echo '<script type="text/javascript" src="'.heyKARTE_PLUGIN_URL.'/hey-map.js"></script>' . "\n";
  5.         if(is_numeric(get_post_meta($post->ID, 'heymap-position-lon', true )) && is_numeric(get_post_meta($post->ID, 'heymap-position-lat', true ))) $markerSet = true;
  6.         wp_nonce_field( basename( __FILE__ ), 'heymap_post_class_nonce' ); ?>
  7.  
  8.         <p>
  9.         <div id="heymap" style="height:300px;"></div>
  10.         Aktuelle Markerposition (L√§nge, Breite): <strong id="heymap_show_current_position"><?php if($markerSet) echo get_post_meta($post->ID, 'heymap-position-lon', true ).', '.get_post_meta($post->ID, 'heymap-position-lat', true ); else echo 'keine Position gesetzt'; ?></strong><br />
  11.                 <input type="hidden" name="heymap-position-lon" id="heymap-position-lon" value="<?php echo get_post_meta($post->ID, 'heymap-position-lon', true ); ?>" />
  12.                 <input type="hidden" name="heymap-position-lat" id="heymap-position-lat" value="<?php echo get_post_meta($post->ID, 'heymap-position-lat', true ); ?>" />
  13.         </p>
  14. <?php
  15.         echo '<script type="text/javascript">if(document.getElementById("heymap")) heymap_init('.get_option('heymap-lon-center').','.get_option('heymap-lat-center').','.get_option('heymap-zoom').','.get_option('heymap-minzoom').',"'.get_option('heymap-type').'",'.get_option('heymap-lat-northeast').','.get_option('heymap-lon-northeast').','.get_option('heymap-lat-southwest').','.get_option('heymap-lon-southwest').'); </script>';
  16.         if($markerSet) echo '<script type="text/javascript"> placeCurrentMarker(map,'.get_post_meta($post->ID, 'heymap-position-lon', true ).','.get_post_meta($post->ID, 'heymap-position-lat', true ).'); </script>';
  17.  
  18. }