Index: /trunk/b2-include/b2functions.php
===================================================================
--- /trunk/b2-include/b2functions.php	(revision 293)
+++ /trunk/b2-include/b2functions.php	(revision 294)
@@ -512,4 +512,6 @@
 		'Title' => $post->post_title, 
 		'Category' => $post->post_category,
+		'Lat' => $post->post_lat,
+		'Lon' => $post->post_lon,
 		'post_status' => $post->post_status,
 		'comment_status' => $post->comment_status,
@@ -530,4 +532,6 @@
 		'Title' => $post->post_title,
 		'Category' => $post->post_category,
+		'Lat' => $post->post_lat,
+		'Lon' => $post->post_lon,
 		'post_status' => $post->post_status,
 		'comment_status' => $post->comment_status,
@@ -1255,3 +1259,49 @@
 }
 
+function doGeoUrlHeader($posts) {
+    global $use_default_geourl,$default_geourl_lat,$default_geourl_lon;
+    if (count($posts) == 1) {
+        // there's only one result  see if it has a geo code
+        $row = $posts[0];
+        $lat = $row->post_lat;
+        $lon = $row->post_lon;
+        $title = $row->post_title;
+        if(($lon != null) && ($lat != null) ) {
+            echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" >\n";
+            echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")),"unicode")." - ".$title."\">\n";
+            return;
+        }
+    } else {
+        if($use_default_geourl) {
+            // send the default here 
+            echo "<meta name=\"ICBM\" content=\"".$default_geourl_lat.", ".$default_geourl_lon."\" >\n";
+            echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")),"unicode")."\">\n";
+        }
+    }
+}
+
+function getRemoteFile($host,$path) {
+    $fp = fsockopen($host, 80, &$errno, &$errstr);
+    if ($fp) {
+        fputs($fp,"GET $path HTTP/1.0\r\nHost: $host\r\n\r\n");
+        while ($line = fgets($fp, 4096)) {
+            $lines[] = $line;
+        }
+        fclose($fp);
+        return $lines;
+    } else {
+        return false;
+    }
+}
+
+function pingGeoURL($blog_ID) {
+    global $blodotgsping_url;
+
+    $ourUrl = $blodotgsping_url."/index.php?p=".$blog_ID;
+    $host="geourl.org";
+    $path="/ping/?p=".$ourUrl;
+    getRemoteFile($host,$path); 
+}
+
+
 ?>
Index: /trunk/b2-include/b2template.functions.php
===================================================================
--- /trunk/b2-include/b2template.functions.php	(revision 293)
+++ /trunk/b2-include/b2template.functions.php	(revision 294)
@@ -230,4 +230,10 @@
 /***** Date/Time tags *****/
 
+function the_date_xml() {
+    global $post;
+    echo mysql2date("Y-m-d",$post->post_date);
+    //echo ""+$post->post_date;
+}
+
 function the_date($d='', $before='', $after='', $echo = true) {
 	global $id, $post, $day, $previousday, $dateformat, $newday;
@@ -288,4 +294,116 @@
 /***** // Date/Time tags *****/
 
+/**** // Geo Tags ****/
+function get_Lat() {
+    global $post;
+    return $post->post_lat;
+}
+
+function get_Lon() {
+    global $post;
+    return $post->post_lon;
+}
+
+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 LANGUAGE=\"JavaScript\">
+
+<!-- This script and many more are available free online at -->
+<!-- The JavaScript Source!! http://javascript.internet.com -->
+
+<!-- Begin
+function formHandler(form) {
+  var URL = form.site.options[form.site.selectedIndex].value;
+  if(URL != \".\") {
+    popup = window.open(URL,\"MenuPopup\");
+  }
+}
+// End -->
+</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","Acme Mapper"),
+                   array("http://geourl.org/near/?lat=".get_Lat()."&lon=".get_Lon()."&dist=500","GeoUrls near here"),
+                   array("http://www.geocaching.com/seek/nearest.aspx?origin_lat=".get_Lat()."&origin_long=".get_Lon()."&dist=5","Geocaches Near Nere"),
+                   array("http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude=".get_Lat()."&longitude=".get_Lon(),"Mapquest map of this spot"),
+                   array("http://www.sidebit.com/ProjectGeoURLMap.php?lat=".get_Lat()."&lon=".get_Lon(),"SideBit URL Map of this spot"),
+                   array("http://confluence.org/confluence.php?lat=".get_Lat()."&lon=".get_Lon(),"Confluence.org near here"),
+                   array("http://www.topozone.com/map.asp?lat=".get_Lat()."&lon=".get_Lon(),"Topozone near here"),
+                   array("http://www.findu.com/cgi-bin/near.cgi?lat=".get_Lat()."&lon=".get_Lon(),"FindU near here"),
+                   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","Maptech near here")
+                  );
+    echo "<form name=form><select name=site SIZE=1 onchange=\"formHandler(this.form);\" >\n";
+    echo "<option value=\".\">Sites referencing ".get_Lat()." x ".get_Lon()."\n";
+    foreach($sites as $site) {
+        echo "<option value=\"".$site[0]."\">".$site[1]."\n";
+    }
+    echo "</select></form>";
+}
+
+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();
+}
 
 
Index: /trunk/b2mail.php
===================================================================
--- /trunk/b2mail.php	(revision 293)
+++ /trunk/b2mail.php	(revision 294)
@@ -157,4 +157,5 @@
 		$blah = explode("\n", $content);
 		$firstline = $blah[0];
+		$secondline = $blah[1];
 
 		if ($use_phoneemail) {
@@ -175,4 +176,22 @@
 		}
 
+        $flat = 999.0;
+        $flon = 999.0;
+        $secondlineParts = explode(':',$secondline);
+        if(strncmp($secondlineParts[0],"POS",3)==0) {
+            echo "Found POS:<br>\n";
+            //echo "Second parts is:".$secondlineParts[1];
+            // the second line is the postion listing line
+            $secLineParts = explode(',',$secondlineParts[1]);
+            $flatStr = $secLineParts[0];
+            $flonStr = $secLineParts[1];
+            //echo "String are ".$flatStr.$flonStr; 
+            $flat = floatval($secLineParts[0]);
+            $flon = floatval($secLineParts[1]);
+            //echo "values are ".$flat." and ".$flon;
+            // ok remove that position... we should not have it in the final output
+            $content = str_replace($secondline,'',$content);
+        }
+
 		$blah = explode(':', $userpassstring);
 		$user_login = $blah[0];
@@ -210,5 +229,9 @@
 				$post_title = addslashes(trim($post_title));
 				$content = addslashes(trim($content));
-				$sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category)";
+                if($flat > 500) {
+                    $sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category)";
+                } else {
+                    $sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category, post_lat, post_lon) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category, $flat, $flon)";
+                }
 				$result = $wpdb->query($sql);
 				$post_ID = $wpdb->insert_id;
@@ -219,5 +242,10 @@
 
 				$blog_ID = 1;
-				rss_update($blog_ID);
+				if($flat < 500) {
+					pingGeoUrl($post_ID);	
+				}
+                // HACK HACK HACK this next line is commented out because I don't know what the word-press replacement
+                // is.  right now it's undefined and does not work				
+				//rss_update($blog_ID);
 				pingWeblogs($blog_ID);
 				pingCafelog($cafelogID, $post_title, $post_ID);
Index: /trunk/index.php
===================================================================
--- /trunk/index.php	(revision 293)
+++ /trunk/index.php	(revision 294)
@@ -1,6 +1,7 @@
-<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1;
+<?php /* Don't remove these lines, they call the b2 function files ! */
+$blog=1;
 require_once('blog.header.php');
 require_once($abspath.'wp-links/links.php');
-// not on by default require_once($abspath.'wp-links/links.weblogs.com.php');
+// not on by default: require_once($abspath.'wp-links/links.weblogs.com.php');
     
 ?>
@@ -14,4 +15,7 @@
 	<meta name="generator" content="WordPress .7" /> <!-- leave this for stats -->
 
+	<?php if(get_settings('use_geo_positions')) {
+		doGeoUrlHeader($posts);
+	} ?>
 	<style type="text/css" media="screen">
 		@import url( <?php echo $siteurl; ?>/layout2b.css );
@@ -22,5 +26,9 @@
 	<link rel="alternate" type="text/xml" title="RSS" href="<?php bloginfo('rss2_url'); ?>" />
 	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
+    <?php get_archives('monthly', '', 'link'); ?>
 	<?php // comments_popup_script(); // off by default ?>
+	<?php if(get_settings('use_geo_positions')) {
+		print_PopUpScript();
+	} ?>
 </head>
 
@@ -30,11 +38,17 @@
 
 <div id="content">
-
 <?php if ($posts) { foreach ($posts as $post) { start_b2(); ?>
 <?php the_date('','<h2>','</h2>'); ?>
 
  <h3 class="storytitle" id="post-<?php the_ID(); ?>">
-  <a href="<?php permalink_link() ?>" rel="bookmark"><?php the_title(); ?></a> 
-  <span class="meta"><a href="?cat=<?php the_category_ID() ?>" title="Category: <?php the_category() ?>">[<?php the_category() ?>]</a> &#8212; <?php the_author() ?> @ <?php the_time() ?>
+  <a href="<?php permalink_link() ?>" rel="bookmark"><?php the_title(); ?></a>
+  <span class="meta"><a href="?cat=<?php the_category_ID() ?>" title="Category: <?php the_category() ?>">[<?php the_category() ?>]</a> &#8212; <?php the_author() ?> @ <?php the_time() ?><br />
+<?php
+    if(get_settings('use_geo_positions')) {
+        if((get_Lon() != null) && (get_Lon() < 360) &&(get_Lon() > -360)) {  ?>
+    from: &nbsp;<?php print_Lat(); echo " x "; print_Lon(); echo "&nbsp;&nbsp;"; print_UrlPopNav(); ?>
+<?php
+        }
+    } ?>
   </span>
  </h3>
@@ -53,5 +67,5 @@
 <?php include('b2comments.php'); ?>
 
-<?php } } // end foreach, end if any posts ?> 
+<?php } } // end foreach, end if any posts ?>
 
 </div>
Index: /trunk/wp-admin/b2edit.form.php
===================================================================
--- /trunk/wp-admin/b2edit.form.php	(revision 293)
+++ /trunk/wp-admin/b2edit.form.php	(revision 294)
@@ -172,4 +172,13 @@
 ?>
 <textarea rows="<?php echo $rows; ?>" cols="40" style="width:100%" name="content" tabindex="4" wrap="virtual" id="content"><?php echo $content ?></textarea><br />
+<?php
+  if (get_settings('use_geo_positions')) {
+?>
+<label for="post_latf">Lat:</label><input size="8" type="text" value="<?php echo $edited_lat; ?>" name="post_latf">&nbsp;
+<label for="post_lonf">Lon:</label><input size="8" type="text" value="<?php echo $edited_lon; ?>" name="post_lonf">&nbsp; <A href="http://www.geourl.org/resources.html" target="_blank" >click for Geo Info</A>
+<br>
+<?
+  }
+?>
 
 <?php echo $form_pingback ?>
Index: /trunk/wp-admin/b2edit.php
===================================================================
--- /trunk/wp-admin/b2edit.php	(revision 293)
+++ /trunk/wp-admin/b2edit.php	(revision 294)
@@ -12,5 +12,5 @@
     }
     return $array;
-} 
+}
 
 if (!get_magic_quotes_gpc()) {
@@ -41,5 +41,5 @@
 
 			$standalone = 1;
-			require_once('b2header.php');	
+			require_once('b2header.php');
 
 			$post_pingback = intval($HTTP_POST_VARS['post_pingback']);
@@ -50,4 +50,12 @@
 			$post_title = addslashes($HTTP_POST_VARS['post_title']);
 			$post_category = intval($HTTP_POST_VARS['post_category']);
+			if(get_settings('use_geo_positions')) {
+				$latstr = $HTTP_POST_VARS['post_latf'];
+				$lonstr = $HTTP_POST_VARS['post_lonf'];
+				if((strlen($latstr) > 2) && (strlen($lonstr) > 2 ) ) {
+					$post_latf = floatval($HTTP_POST_VARS['post_latf']);
+					$post_lonf = floatval($HTTP_POST_VARS['post_lonf']);
+				}
+			}
 			$post_status = $HTTP_POST_VARS['post_status'];
 			$comment_status = $HTTP_POST_VARS['comment_status'];
@@ -74,10 +82,19 @@
         }
 
-        $result = $wpdb->query("
-		  INSERT INTO $tableposts 
-		  	(ID, post_author, post_date, post_content, post_title, post_category, post_excerpt,  post_status, comment_status, ping_status, post_password)
-		  VALUES
-		  	('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password')
-		  ");
+        if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
+		$postquery ="INSERT INTO $tableposts
+                (ID, post_author, post_date, post_content, post_title, post_category, post_lat, post_lon, post_excerpt,  post_status, comment_status, ping_status, post_password)
+                VALUES
+                ('0','$user_ID','$now','$content','$post_title','$post_category',$post_latf,$post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password')
+                ";
+        } else {
+		$postquery ="INSERT INTO $tableposts
+                (ID, post_author, post_date, post_content, post_title, post_category,  post_excerpt,  post_status, comment_status, ping_status, post_password)
+                VALUES
+                ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password')
+                ";
+        }
+        $postquery =
+        $result = $wpdb->query($postquery);
 
         $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
@@ -86,10 +103,13 @@
                 sleep($sleep_after_edit);
         }
-        
+
         if ($post_status == 'publish') {
+            if((get_settings('use_geo_positions')) && ($post_latf != null) && ($post_lonf != null)) {
+                pingGeoUrl($post_ID);
+            }
             pingWeblogs($blog_ID);
             pingCafelog($cafelogID, $post_title, $post_ID);
             pingBlogs($blog_ID);
-        
+
             if ($post_pingback) {
                 pingback($content, $post_ID);
@@ -137,7 +157,9 @@
 			if ($user_level < $authordata->user_level)
 				die ('You don&#8217;t have the right to edit <strong>'.$authordata[1].'</strong>&#8217;s posts.');
-			
+
 			$content = $postdata['Content'];
 			$content = format_to_edit($content);
+			$edited_lat = $postdata["Lat"];
+			$edited_lon = $postdata["Lon"];
 			$excerpt = $postdata['Excerpt'];
 			$excerpt = format_to_edit($excerpt);
@@ -165,5 +187,5 @@
         $standalone = 1;
         require_once('./b2header.php');
-        
+
         if ($user_level == 0)
             die ('Cheatin&#8217; uh?');
@@ -180,4 +202,15 @@
 			$excerpt = format_to_post($excerpt);
 			$post_title = addslashes($HTTP_POST_VARS['post_title']);
+			if(get_settings('use_geo_positions')) {
+				$latf = floatval($HTTP_POST_VARS["post_latf"]);
+        			$lonf = floatval($HTTP_POST_VARS["post_lonf"]);
+        			$latlonaddition = "";
+        			if( ($latf != null) && ($latf <= 90 ) && ($latf >= -90) && ($lonf != null) && ($lonf <= 360) && ($lonf >= -360) ) {
+                			pingGeoUrl($post_ID);
+					$latlonaddition = " post_lat=".$latf.", post_lon =".$lonf.", ";
+        			} else {
+					$latlonaddition = " post_lat=null, post_lon=null, ";
+				}
+			}
 			$post_status = $HTTP_POST_VARS['post_status'];
 			$prev_status = $HTTP_POST_VARS['prev_status'];
@@ -203,15 +236,15 @@
 
         $result = $wpdb->query("
-			UPDATE $tableposts SET 
-				post_content = '$content', 
-				post_excerpt = '$excerpt', 
-				post_title = '$post_title', 
-				post_category = '$post_category'".$datemodif.", 
-				post_status = '$post_status', 
-				comment_status = '$comment_status', 
-				ping_status = '$ping_status', 
-				post_password = '$post_password' 
-			WHERE ID = $post_ID
-");
+			UPDATE $tableposts SET
+				post_content = '$content',
+				post_excerpt = '$excerpt',
+				post_title = '$post_title',
+				post_category = '$post_category'".$datemodif.",
+				".$latlonaddition."
+				post_status = '$post_status',
+				comment_status = '$comment_status',
+				ping_status = '$ping_status',
+				post_password = '$post_password'
+			WHERE ID = $post_ID ");
 
         if (isset($sleep_after_edit) && $sleep_after_edit > 0) {
@@ -224,5 +257,5 @@
             pingCafelog($cafelogID, $post_title, $post_ID);
             pingBlogs($blog_ID);
-        
+
             if ($post_pingback) {
                 pingback($content, $post_ID);
@@ -258,4 +291,13 @@
         if ($user_level < $authordata->user_level)
             die ('You don&#8217;t have the right to delete <strong>'.$authordata[1].'</strong>&#8217;s posts.');
+
+        // send geoURL ping to "erase" from their DB
+        $query = "SELECT post_lat from $tableposts WHERE ID=$post";
+        $rows = $wpdb->query($query); 
+        $myrow = $rows[0];
+        $latf = $myrow->post_lat;
+        if($latf != null ) {
+            pingGeoUrl($post);
+        }
 
         $result = $wpdb->query("DELETE FROM $tableposts WHERE ID=$post");
@@ -349,9 +391,9 @@
 
         $result = $wpdb->query("
-			UPDATE $tablecomments SET 
-				comment_content = '$content', 
-				comment_author = '$newcomment_author', 
-				comment_author_email = '$newcomment_author_email', 
-				comment_author_url = '$newcomment_author_url'".$datemodif." 
+			UPDATE $tablecomments SET
+				comment_content = '$content',
+				comment_author = '$newcomment_author',
+				comment_author_email = '$newcomment_author_email',
+				comment_author_url = '$newcomment_author_url'".$datemodif."
 			WHERE comment_ID = $comment_ID"
 			);
Index: /trunk/wp-admin/optionhandler.php
===================================================================
--- /trunk/wp-admin/optionhandler.php	(revision 293)
+++ /trunk/wp-admin/optionhandler.php	(revision 294)
@@ -16,4 +16,5 @@
         case 1: // integer
         case 3: // string
+        case 8: // float
         case 6:  // range -- treat same as integer for now!
             if (($option_result->option_type == 1) || ($option_result->option_type == 1)) {
Index: /trunk/wp-admin/upgrade-071-to-072.php
===================================================================
--- /trunk/wp-admin/upgrade-071-to-072.php	(revision 293)
+++ /trunk/wp-admin/upgrade-071-to-072.php	(revision 294)
@@ -44,4 +44,5 @@
 
 	case 0:
+    {
 ?>
 <p>Welcome to WordPress. You're already part of the family so this should be familiar 
@@ -70,7 +71,9 @@
   you&#8217;re all ready, <a href="<?php echo $thisfile;?>?step=1">let's go</a>! </p>
 <?php
-	break;
+        break;
+    }
 
     case 1:
+    {
 ?>
 <h1>Step 1</h1>
@@ -202,8 +205,55 @@
 <?php
 }
-    break;
-	case 2:
+        break;
+    } // end case 1
+
+    case 2:
+    {
 ?>
 <h1>Step 2</h1>
+<p>There are some changes we need to make to the post table, we'll do those next.</p>
+<?php
+$error_count = 0;
+$tablename = $tableposts;
+
+$ddl = "ALTER TABLE $tableposts ADD COLUMN post_lon float ";
+maybe_add_column($tablename, 'post_lon', $ddl);
+if (check_column($tablename, 'post_lon', 'float')) {
+    $res .= $tablename . ' - ok <br />'."\n";
+} else {
+    $res .= 'There was a problem with ' . $tablename . '<br />'."\n";
+    ++$error_count;
+}
+
+$ddl = "ALTER TABLE $tableposts ADD COLUMN post_lat float ";
+maybe_add_column($tablename, 'post_lat', $ddl);
+if (check_column($tablename, 'post_lat', 'float')) {
+    $res .= $tablename . ' - ok <br />'."\n";
+} else {
+    $res .= 'There was a problem with ' . $tablename . '<br />'."\n";
+    ++$error_count;
+}
+
+
+if ($error_count > 0) {
+    echo("<p>$res</p>");
+?>
+<p>Hmmm... there was some kind of error. If you cannot figure out
+   see from the output above how to correct the problems please
+   visit our <a href="http://wordpress.org/support/">support
+   forums</a> and report your problem.</p>
+<?php
+} else {
+?>
+<p>OK, another step completed. Let's move on to <a href="<?php echo $thisfile;?>?step=3">step 3</a>.</p>
+<?php
+}
+        break;
+    } // end case 2
+    
+	case 3:
+    {
+?>
+<h1>Step 3</h1>
 <p>There are a few new database tables with this version, so lets get those out of 
   the way.</p>
@@ -524,4 +574,27 @@
 
 ?>
+<?php
+$geo_option_data = array(
+// data for geo settings
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(84,'use_geo_positions', 2, '1', 'Turns on the geo url features of WordPress', 8, 20)",
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(85,'use_default_geourl', 2, '1','enables placement of default GeoURL ICBM location even when no other specified', 8, 20)",
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(86,'default_geourl_lat ', 8, 0.0, 'The default Latitude ICBM value - <a href=\"http://www.geourl.org/resources.html\" target=\"_blank\">see here</a>', 8, 20)",
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(87,'default_geourl_lon', 8, 0.0, 'The default Longitude ICBM value', 8, 20)",
+
+"INSERT INTO $tableoptiongroups (group_id, group_name, group_desc) VALUES(9,'Geo Options', 'Settings which control the posting and display of Geo Options')",
+
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,84,1)",
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,85,1)",
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,86,1)",
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,87,1)",
+);
+
+foreach ($geo_option_data as $query) {
+    $q = $wpdb->query($query);
+}
+?>
+
+<p>Geo option data inserted okay.</p>
+
 
 <p>Good, the option data was inserted okay.</p>
@@ -742,5 +815,6 @@
 <?php
     } // end else no b2config
-	break;
+        break;
+    } // end case 3
 }
 ?>
Index: /trunk/wp-admin/wp-install-helper.php
===================================================================
--- /trunk/wp-admin/wp-install-helper.php	(revision 293)
+++ /trunk/wp-admin/wp-install-helper.php	(revision 294)
@@ -1,4 +1,5 @@
 <?php
 require_once('../wp-config.php');
+$debug = 0;
 
 /**
@@ -33,6 +34,7 @@
  */
 function maybe_add_column($table_name, $column_name, $create_ddl) {
-    global $wpdb;
+    global $wpdb, $debug;
     foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
+        if ($debug) echo("checking $column == $column_name<br />");
         if ($column == $column_name) {
             return true;
@@ -91,13 +93,13 @@
  */
 function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) {
-    global $wpdb;
+    global $wpdb, $debug;
     $diffs = 0;
     $results = $wpdb->get_results("DESC $table_name");
     
     foreach ($results as $row ) {
-        //print_r($row);
+        if ($debug > 1) print_r($row);
         if ($row->Field == $col_name) {
             // got our column, check the params
-            //echo ("checking $row->Type against $col_type\n");
+            if ($debug) echo ("checking $row->Type against $col_type\n");
             if (($col_type != null) && ($row->Type != $col_type)) {
                 ++$diffs;
@@ -116,5 +118,5 @@
             }
             if ($diffs > 0) {
-                //echo ("diffs = $diffs returning false\n");
+                if ($debug) echo ("diffs = $diffs returning false\n");
                 return false;
             }
Index: /trunk/wp-admin/wp-install.php
===================================================================
--- /trunk/wp-admin/wp-install.php	(revision 293)
+++ /trunk/wp-admin/wp-install.php	(revision 294)
@@ -193,4 +193,6 @@
   post_category int(4) NOT NULL default '0',
   post_excerpt text NOT NULL,
+  post_lat float,
+  post_lon float,
   post_status enum('publish','draft','private') NOT NULL default 'publish',
   comment_status enum('open','closed') NOT NULL default 'open',
@@ -359,4 +361,6 @@
 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (6, 'range')",
 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (7, 'sqlselect')",
+"INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (8, 'float')",
+
 //base options from b2cofig
 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(1,'siteurl', 3, 'http://example.com', 'siteurl is your blog\'s URL: for example, \'http://example.com/wordpress\' (no trailing slash !)', 8, 30)",
@@ -619,4 +623,29 @@
 <p>Links option data inserted okay.</p>
 
+<?php
+$geo_option_data = array(
+// data for geo settings
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(84,'use_geo_positions', 2, '1', 'Turns on the geo url features of WordPress', 8, 20)",
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(85,'use_default_geourl', 2, '1','enables placement of default GeoURL ICBM location even when no other specified', 8, 20)",
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(86,'default_geourl_lat ', 8, 0.0, 'The default Latitude ICBM value - <a href=\"http://www.geourl.org/resources.html\" target=\"_blank\">see here</a>', 8, 20)",
+"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(87,'default_geourl_lon', 8, 0.0, 'The default Longitude ICBM value', 8, 20)",
+
+"INSERT INTO $tableoptiongroups (group_id, group_name, group_desc) VALUES(9,'Geo Options',Settings which control the posting and display of Geo Options')",
+
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,84,1)",
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,85,1)",
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,86,1)",
+"INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,87,1)",
+
+);
+
+foreach ($geo_option_data as $query) {
+    $q = $wpdb->query($query);
+}
+?>
+
+<p>Geo option data inserted okay.</p>
+
+
 <p>OK. We're nearly done now. We just need to ask you a couple of things:</p>
 <form action="wp-install.php?step=3" method="post">
Index: /trunk/wp-locations.php
===================================================================
--- /trunk/wp-locations.php	(revision 294)
+++ /trunk/wp-locations.php	(revision 294)
@@ -0,0 +1,37 @@
+<?php $blog = 1; // enter your blog's ID
+header('Content-type: text/xml');
+include('blog.header.php');
+?><?php echo "<?xml version=\"1.0\"?".">\n"; ?>
+<travels>
+<?php
+$start = count($posts)-1;
+for ($i = $start; $i >= 0; $i--) {
+    $post = $posts[$i];
+    start_b2();
+    if ((get_Lon() != null) && (get_Lon > -360) && (get_Lon() < 360 )) {
+?>
+    <location arrival="<?php the_date_xml() ?>">
+        <name><?php the_title_rss() ?></name>
+        <latitude><?php print_Lat() ?></latitude>
+        <longitude><?php print_Lon() ?></longitude>
+<?php
+        if ($rss_use_excerpt) {
+?>
+        <note><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?>
+        </note>
+<?php
+        } else { // use content
+?>
+        <note><?php the_excerpt_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></note>
+<?php
+        } // end else use content
+?>
+        <url><?php permalink_single_rss() ?></url>
+    </location>
+<?php
+    } // end if lon valid
+?>
+<?php
+} // end loop
+?>
+</travels>
