2004-01-27 04:58:01 -05:00
|
|
|
<?php
|
|
|
|
function get_Lat() {
|
|
|
|
global $post;
|
2004-04-25 22:34:07 -04:00
|
|
|
|
|
|
|
if ($post->post_lat != '') {
|
|
|
|
return $post->post_lat;
|
|
|
|
} else if(get_settings('use_default_geourl')) {
|
|
|
|
return get_settings('default_geourl_lat');
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
2004-01-27 04:58:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function get_Lon() {
|
|
|
|
global $post;
|
2004-04-25 22:34:07 -04:00
|
|
|
|
|
|
|
if ($post->post_lon != '') {
|
|
|
|
return $post->post_lon;
|
|
|
|
} else if(get_settings('use_default_geourl')) {
|
|
|
|
return get_settings('default_geourl_lon');
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
2004-01-27 04:58:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function print_Lat() {
|
|
|
|
if(get_settings('use_geo_positions')) {
|
|
|
|
if(get_Lat() > 0) {
|
|
|
|
echo "".get_Lat()."N";
|
|
|
|
} else {
|
|
|
|
echo "".get_Lat()."S";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_Lon() {
|
|
|
|
global $id, $postdata;
|
|
|
|
if(get_settings('use_geo_positions')) {
|
|
|
|
if(get_Lon() < 0) {
|
|
|
|
$temp = get_Lon() * -1;
|
|
|
|
echo "".$temp."W";
|
|
|
|
} else {
|
|
|
|
echo "".get_Lon()."E";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_PopUpScript() {
|
|
|
|
echo "
|
|
|
|
<script type='text/javascript'>
|
|
|
|
<!-- This script and many more are available free online at -->
|
|
|
|
<!-- The JavaScript Source!! http://javascript.internet.com -->
|
|
|
|
function formHandler(form) {
|
|
|
|
var URL = form.site.options[form.site.selectedIndex].value;
|
|
|
|
if(URL != \".\") {
|
|
|
|
popup = window.open(URL,\"MenuPopup\");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script> ";
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_UrlPopNav() {
|
|
|
|
$sites = array(
|
|
|
|
array('http://www.acme.com/mapper/?lat='.get_Lat().'&long='.get_Lon().'&scale=11&theme=Image&width=3&height=2&dot=Yes',
|
2004-04-17 11:56:23 -04:00
|
|
|
__('Acme Mapper')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://geourl.org/near/?lat='.get_Lat().'&lon='.get_Lon().'&dist=500',
|
2004-04-17 11:56:23 -04:00
|
|
|
__('GeoURLs near here')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://www.geocaching.com/seek/nearest.aspx?origin_lat='.get_Lat().'&origin_long='.get_Lon().'&dist=5',
|
2004-04-17 11:56:23 -04:00
|
|
|
__('Geocaches near here')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude='.get_Lat().'&longitude='.get_Lon(),
|
2004-04-17 11:56:23 -04:00
|
|
|
__('Mapquest map of this spot')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://www.sidebit.com/ProjectGeoURLMap.php?lat='.get_Lat().'&lon='.get_Lon(),
|
2004-04-17 11:56:23 -04:00
|
|
|
__('SideBit URL Map of this spot')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://confluence.org/confluence.php?lat='.get_Lat().'&lon='.get_Lon(),
|
2004-04-17 11:56:23 -04:00
|
|
|
__('Confluence.org near here')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://www.topozone.com/map.asp?lat='.get_Lat().'&lon='.get_Lon(),
|
2004-04-17 11:56:23 -04:00
|
|
|
__('Topozone near here')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://www.findu.com/cgi-bin/near.cgi?lat='.get_Lat().'&lon='.get_Lon(),
|
2004-04-17 11:56:23 -04:00
|
|
|
__('FindU near here')),
|
2004-01-27 04:58:01 -05:00
|
|
|
array('http://mapserver.maptech.com/api/espn/index.cfm?lat='.get_Lat().'&lon='.get_Lon().'&scale=100000&zoom=50&type=1&icon=0&&scriptfile=http://mapserver.maptech.com/api/espn/index.cfm',
|
2004-04-17 11:56:23 -04:00
|
|
|
__('Maptech near here'))
|
2004-01-27 04:58:01 -05:00
|
|
|
);
|
|
|
|
echo '<form action=""><div>
|
|
|
|
<select name="site" size="1" onchange="formHandler(this.form);" >'."\n";
|
2004-04-17 11:56:23 -04:00
|
|
|
echo '<option value=".">' . sprintf(__("Sites referencing %s x %s"), get_Lat(), get_Lon()) . "</option>\n";
|
2004-01-27 04:58:01 -05:00
|
|
|
foreach($sites as $site) {
|
|
|
|
echo "\t".'<option value="'.$site[0].'">'.$site[1]."</option>\n";
|
|
|
|
}
|
|
|
|
echo '</select></div>
|
|
|
|
</form>'."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
function longitude_invalid() {
|
|
|
|
if (get_Lon() == null) return true;
|
|
|
|
if (get_Lon() > 360) return true;
|
|
|
|
if (get_Lon() < -360) return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_AcmeMap_Url() {
|
|
|
|
if (!get_settings('use_geo_positions')) return;
|
|
|
|
if (longitude_invalid()) return;
|
|
|
|
echo "http://www.acme.com/mapper/?lat=".get_Lat()."&long=".get_Lon()."&scale=11&theme=Image&width=3&height=2&dot=Yes";
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_GeoURL_Url() {
|
|
|
|
if (!get_settings('use_geo_positions')) return;
|
|
|
|
if (longitude_invalid()) return;
|
|
|
|
echo "http://geourl.org/near/?lat=".get_Lat()."&lon=".get_Lon()."&dist=500";
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_GeoCache_Url() {
|
|
|
|
if (!get_settings('use_geo_positions')) return;
|
|
|
|
if (longitude_invalid()) return;
|
|
|
|
echo "http://www.geocaching.com/seek/nearest.aspx?origin_lat=".get_Lat()."&origin_long=".get_Lon()."&dist=5";
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_MapQuest_Url() {
|
|
|
|
if (!get_settings('use_geo_positions')) return;
|
|
|
|
|
|
|
|
if (longitude_invalid()) return;
|
|
|
|
echo "http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude=".get_Lat()."&longitude=".get_Lon();
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_SideBit_Url() {
|
|
|
|
if (!get_settings('use_geo_positions')) return;
|
|
|
|
if (longitude_invalid()) return;
|
|
|
|
echo "http://www.sidebit.com/ProjectGeoURLMap.php?lat=".get_Lat()."&lon=".get_Lon();
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_DegreeConfluence_Url() {
|
|
|
|
if (!get_settings('use_geo_positions')) return;
|
|
|
|
if (longitude_invalid()) return;
|
|
|
|
echo "http://confluence.org/confluence.php?lat=".get_Lat()."&lon=".get_Lon();
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|