Changeset 294
- Timestamp:
- 08/05/2003 10:44:38 PM (23 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 10 edited
-
b2-include/b2functions.php (modified) (3 diffs)
-
b2-include/b2template.functions.php (modified) (2 diffs)
-
b2mail.php (modified) (4 diffs)
-
index.php (modified) (5 diffs)
-
wp-admin/b2edit.form.php (modified) (1 diff)
-
wp-admin/b2edit.php (modified) (12 diffs)
-
wp-admin/optionhandler.php (modified) (1 diff)
-
wp-admin/upgrade-071-to-072.php (modified) (5 diffs)
-
wp-admin/wp-install-helper.php (modified) (4 diffs)
-
wp-admin/wp-install.php (modified) (3 diffs)
-
wp-locations.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/b2-include/b2functions.php
r284 r294 512 512 'Title' => $post->post_title, 513 513 'Category' => $post->post_category, 514 'Lat' => $post->post_lat, 515 'Lon' => $post->post_lon, 514 516 'post_status' => $post->post_status, 515 517 'comment_status' => $post->comment_status, … … 530 532 'Title' => $post->post_title, 531 533 'Category' => $post->post_category, 534 'Lat' => $post->post_lat, 535 'Lon' => $post->post_lon, 532 536 'post_status' => $post->post_status, 533 537 'comment_status' => $post->comment_status, … … 1255 1259 } 1256 1260 1261 function doGeoUrlHeader($posts) { 1262 global $use_default_geourl,$default_geourl_lat,$default_geourl_lon; 1263 if (count($posts) == 1) { 1264 // there's only one result see if it has a geo code 1265 $row = $posts[0]; 1266 $lat = $row->post_lat; 1267 $lon = $row->post_lon; 1268 $title = $row->post_title; 1269 if(($lon != null) && ($lat != null) ) { 1270 echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" >\n"; 1271 echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")),"unicode")." - ".$title."\">\n"; 1272 return; 1273 } 1274 } else { 1275 if($use_default_geourl) { 1276 // send the default here 1277 echo "<meta name=\"ICBM\" content=\"".$default_geourl_lat.", ".$default_geourl_lon."\" >\n"; 1278 echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")),"unicode")."\">\n"; 1279 } 1280 } 1281 } 1282 1283 function getRemoteFile($host,$path) { 1284 $fp = fsockopen($host, 80, &$errno, &$errstr); 1285 if ($fp) { 1286 fputs($fp,"GET $path HTTP/1.0\r\nHost: $host\r\n\r\n"); 1287 while ($line = fgets($fp, 4096)) { 1288 $lines[] = $line; 1289 } 1290 fclose($fp); 1291 return $lines; 1292 } else { 1293 return false; 1294 } 1295 } 1296 1297 function pingGeoURL($blog_ID) { 1298 global $blodotgsping_url; 1299 1300 $ourUrl = $blodotgsping_url."/index.php?p=".$blog_ID; 1301 $host="geourl.org"; 1302 $path="/ping/?p=".$ourUrl; 1303 getRemoteFile($host,$path); 1304 } 1305 1306 1257 1307 ?> -
trunk/b2-include/b2template.functions.php
r293 r294 230 230 /***** Date/Time tags *****/ 231 231 232 function the_date_xml() { 233 global $post; 234 echo mysql2date("Y-m-d",$post->post_date); 235 //echo ""+$post->post_date; 236 } 237 232 238 function the_date($d='', $before='', $after='', $echo = true) { 233 239 global $id, $post, $day, $previousday, $dateformat, $newday; … … 288 294 /***** // Date/Time tags *****/ 289 295 296 /**** // Geo Tags ****/ 297 function get_Lat() { 298 global $post; 299 return $post->post_lat; 300 } 301 302 function get_Lon() { 303 global $post; 304 return $post->post_lon; 305 } 306 307 function print_Lat() { 308 if(get_settings('use_geo_positions')) { 309 if(get_Lat() > 0) { 310 echo "".get_Lat()."N"; 311 } else { 312 echo "".get_Lat()."S"; 313 } 314 } 315 } 316 317 function print_Lon() { 318 global $id, $postdata; 319 if(get_settings('use_geo_positions')) { 320 if(get_Lon() < 0) { 321 $temp = get_Lon() * -1; 322 echo "".$temp."W"; 323 } else { 324 echo "".get_Lon()."E"; 325 } 326 } 327 } 328 329 function print_PopUpScript() { 330 echo " 331 <SCRIPT LANGUAGE=\"JavaScript\"> 332 333 <!-- This script and many more are available free online at --> 334 <!-- The JavaScript Source!! http://javascript.internet.com --> 335 336 <!-- Begin 337 function formHandler(form) { 338 var URL = form.site.options[form.site.selectedIndex].value; 339 if(URL != \".\") { 340 popup = window.open(URL,\"MenuPopup\"); 341 } 342 } 343 // End --> 344 </script> "; 345 } 346 347 function print_UrlPopNav() { 348 $sites = array( 349 array("http://www.acme.com/mapper/?lat=".get_Lat()."&long=".get_Lon()."&scale=11&theme=Image&width=3&height=2&dot=Yes","Acme Mapper"), 350 array("http://geourl.org/near/?lat=".get_Lat()."&lon=".get_Lon()."&dist=500","GeoUrls near here"), 351 array("http://www.geocaching.com/seek/nearest.aspx?origin_lat=".get_Lat()."&origin_long=".get_Lon()."&dist=5","Geocaches Near Nere"), 352 array("http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude=".get_Lat()."&longitude=".get_Lon(),"Mapquest map of this spot"), 353 array("http://www.sidebit.com/ProjectGeoURLMap.php?lat=".get_Lat()."&lon=".get_Lon(),"SideBit URL Map of this spot"), 354 array("http://confluence.org/confluence.php?lat=".get_Lat()."&lon=".get_Lon(),"Confluence.org near here"), 355 array("http://www.topozone.com/map.asp?lat=".get_Lat()."&lon=".get_Lon(),"Topozone near here"), 356 array("http://www.findu.com/cgi-bin/near.cgi?lat=".get_Lat()."&lon=".get_Lon(),"FindU near here"), 357 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") 358 ); 359 echo "<form name=form><select name=site SIZE=1 onchange=\"formHandler(this.form);\" >\n"; 360 echo "<option value=\".\">Sites referencing ".get_Lat()." x ".get_Lon()."\n"; 361 foreach($sites as $site) { 362 echo "<option value=\"".$site[0]."\">".$site[1]."\n"; 363 } 364 echo "</select></form>"; 365 } 366 367 function longitude_invalid() { 368 if (get_Lon() == null) return true; 369 if (get_Lon() > 360) return true; 370 if (get_Lon() < -360) return true; 371 } 372 373 function print_AcmeMap_Url() { 374 if (!get_settings('use_geo_positions')) return; 375 if (longitude_invalid()) return; 376 echo "http://www.acme.com/mapper/?lat=".get_Lat()."&long=".get_Lon()."&scale=11&theme=Image&width=3&height=2&dot=Yes"; 377 } 378 379 function print_GeoURL_Url() { 380 if (!get_settings('use_geo_positions')) return; 381 if (longitude_invalid()) return; 382 echo "http://geourl.org/near/?lat=".get_Lat()."&lon=".get_Lon()."&dist=500"; 383 } 384 385 function print_GeoCache_Url() { 386 if (!get_settings('use_geo_positions')) return; 387 if (longitude_invalid()) return; 388 echo "http://www.geocaching.com/seek/nearest.aspx?origin_lat=".get_Lat()."&origin_long=".get_Lon()."&dist=5"; 389 } 390 391 function print_MapQuest_Url() { 392 if (!get_settings('use_geo_positions')) return; 393 if (longitude_invalid()) return; 394 echo "http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude=".get_Lat()."&longitude=".get_Lon(); 395 } 396 397 function print_SideBit_Url() { 398 if (!get_settings('use_geo_positions')) return; 399 if (longitude_invalid()) return; 400 echo "http://www.sidebit.com/ProjectGeoURLMap.php?lat=".get_Lat()."&lon=".get_Lon(); 401 } 402 403 function print_DegreeConfluence_Url() { 404 if (!get_settings('use_geo_positions')) return; 405 if (longitude_invalid()) return; 406 echo "http://confluence.org/confluence.php?lat=".get_Lat()."&lon=".get_Lon(); 407 } 290 408 291 409 -
trunk/b2mail.php
r255 r294 157 157 $blah = explode("\n", $content); 158 158 $firstline = $blah[0]; 159 $secondline = $blah[1]; 159 160 160 161 if ($use_phoneemail) { … … 175 176 } 176 177 178 $flat = 999.0; 179 $flon = 999.0; 180 $secondlineParts = explode(':',$secondline); 181 if(strncmp($secondlineParts[0],"POS",3)==0) { 182 echo "Found POS:<br>\n"; 183 //echo "Second parts is:".$secondlineParts[1]; 184 // the second line is the postion listing line 185 $secLineParts = explode(',',$secondlineParts[1]); 186 $flatStr = $secLineParts[0]; 187 $flonStr = $secLineParts[1]; 188 //echo "String are ".$flatStr.$flonStr; 189 $flat = floatval($secLineParts[0]); 190 $flon = floatval($secLineParts[1]); 191 //echo "values are ".$flat." and ".$flon; 192 // ok remove that position... we should not have it in the final output 193 $content = str_replace($secondline,'',$content); 194 } 195 177 196 $blah = explode(':', $userpassstring); 178 197 $user_login = $blah[0]; … … 210 229 $post_title = addslashes(trim($post_title)); 211 230 $content = addslashes(trim($content)); 212 $sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category)"; 231 if($flat > 500) { 232 $sql = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ($post_author, '$post_date', '$content', '$post_title', $post_category)"; 233 } else { 234 $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)"; 235 } 213 236 $result = $wpdb->query($sql); 214 237 $post_ID = $wpdb->insert_id; … … 219 242 220 243 $blog_ID = 1; 221 rss_update($blog_ID); 244 if($flat < 500) { 245 pingGeoUrl($post_ID); 246 } 247 // HACK HACK HACK this next line is commented out because I don't know what the word-press replacement 248 // is. right now it's undefined and does not work 249 //rss_update($blog_ID); 222 250 pingWeblogs($blog_ID); 223 251 pingCafelog($cafelogID, $post_title, $post_ID); -
trunk/index.php
r266 r294 1 <?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; 1 <?php /* Don't remove these lines, they call the b2 function files ! */ 2 $blog=1; 2 3 require_once('blog.header.php'); 3 4 require_once($abspath.'wp-links/links.php'); 4 // not on by default require_once($abspath.'wp-links/links.weblogs.com.php');5 // not on by default: require_once($abspath.'wp-links/links.weblogs.com.php'); 5 6 6 7 ?> … … 14 15 <meta name="generator" content="WordPress .7" /> <!-- leave this for stats --> 15 16 17 <?php if(get_settings('use_geo_positions')) { 18 doGeoUrlHeader($posts); 19 } ?> 16 20 <style type="text/css" media="screen"> 17 21 @import url( <?php echo $siteurl; ?>/layout2b.css ); … … 22 26 <link rel="alternate" type="text/xml" title="RSS" href="<?php bloginfo('rss2_url'); ?>" /> 23 27 <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 28 <?php get_archives('monthly', '', 'link'); ?> 24 29 <?php // comments_popup_script(); // off by default ?> 30 <?php if(get_settings('use_geo_positions')) { 31 print_PopUpScript(); 32 } ?> 25 33 </head> 26 34 … … 30 38 31 39 <div id="content"> 32 33 40 <?php if ($posts) { foreach ($posts as $post) { start_b2(); ?> 34 41 <?php the_date('','<h2>','</h2>'); ?> 35 42 36 43 <h3 class="storytitle" id="post-<?php the_ID(); ?>"> 37 <a href="<?php permalink_link() ?>" rel="bookmark"><?php the_title(); ?></a> 38 <span class="meta"><a href="?cat=<?php the_category_ID() ?>" title="Category: <?php the_category() ?>">[<?php the_category() ?>]</a> — <?php the_author() ?> @ <?php the_time() ?> 44 <a href="<?php permalink_link() ?>" rel="bookmark"><?php the_title(); ?></a> 45 <span class="meta"><a href="?cat=<?php the_category_ID() ?>" title="Category: <?php the_category() ?>">[<?php the_category() ?>]</a> — <?php the_author() ?> @ <?php the_time() ?><br /> 46 <?php 47 if(get_settings('use_geo_positions')) { 48 if((get_Lon() != null) && (get_Lon() < 360) &&(get_Lon() > -360)) { ?> 49 from: <?php print_Lat(); echo " x "; print_Lon(); echo " "; print_UrlPopNav(); ?> 50 <?php 51 } 52 } ?> 39 53 </span> 40 54 </h3> … … 53 67 <?php include('b2comments.php'); ?> 54 68 55 <?php } } // end foreach, end if any posts ?> 69 <?php } } // end foreach, end if any posts ?> 56 70 57 71 </div> -
trunk/wp-admin/b2edit.form.php
r289 r294 172 172 ?> 173 173 <textarea rows="<?php echo $rows; ?>" cols="40" style="width:100%" name="content" tabindex="4" wrap="virtual" id="content"><?php echo $content ?></textarea><br /> 174 <?php 175 if (get_settings('use_geo_positions')) { 176 ?> 177 <label for="post_latf">Lat:</label><input size="8" type="text" value="<?php echo $edited_lat; ?>" name="post_latf"> 178 <label for="post_lonf">Lon:</label><input size="8" type="text" value="<?php echo $edited_lon; ?>" name="post_lonf"> <A href="http://www.geourl.org/resources.html" target="_blank" >click for Geo Info</A> 179 <br> 180 <? 181 } 182 ?> 174 183 175 184 <?php echo $form_pingback ?> -
trunk/wp-admin/b2edit.php
r243 r294 12 12 } 13 13 return $array; 14 } 14 } 15 15 16 16 if (!get_magic_quotes_gpc()) { … … 41 41 42 42 $standalone = 1; 43 require_once('b2header.php'); 43 require_once('b2header.php'); 44 44 45 45 $post_pingback = intval($HTTP_POST_VARS['post_pingback']); … … 50 50 $post_title = addslashes($HTTP_POST_VARS['post_title']); 51 51 $post_category = intval($HTTP_POST_VARS['post_category']); 52 if(get_settings('use_geo_positions')) { 53 $latstr = $HTTP_POST_VARS['post_latf']; 54 $lonstr = $HTTP_POST_VARS['post_lonf']; 55 if((strlen($latstr) > 2) && (strlen($lonstr) > 2 ) ) { 56 $post_latf = floatval($HTTP_POST_VARS['post_latf']); 57 $post_lonf = floatval($HTTP_POST_VARS['post_lonf']); 58 } 59 } 52 60 $post_status = $HTTP_POST_VARS['post_status']; 53 61 $comment_status = $HTTP_POST_VARS['comment_status']; … … 74 82 } 75 83 76 $result = $wpdb->query(" 77 INSERT INTO $tableposts 78 (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt, post_status, comment_status, ping_status, post_password) 79 VALUES 80 ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password') 81 "); 84 if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { 85 $postquery ="INSERT INTO $tableposts 86 (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) 87 VALUES 88 ('0','$user_ID','$now','$content','$post_title','$post_category',$post_latf,$post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password') 89 "; 90 } else { 91 $postquery ="INSERT INTO $tableposts 92 (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt, post_status, comment_status, ping_status, post_password) 93 VALUES 94 ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password') 95 "; 96 } 97 $postquery = 98 $result = $wpdb->query($postquery); 82 99 83 100 $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); … … 86 103 sleep($sleep_after_edit); 87 104 } 88 105 89 106 if ($post_status == 'publish') { 107 if((get_settings('use_geo_positions')) && ($post_latf != null) && ($post_lonf != null)) { 108 pingGeoUrl($post_ID); 109 } 90 110 pingWeblogs($blog_ID); 91 111 pingCafelog($cafelogID, $post_title, $post_ID); 92 112 pingBlogs($blog_ID); 93 113 94 114 if ($post_pingback) { 95 115 pingback($content, $post_ID); … … 137 157 if ($user_level < $authordata->user_level) 138 158 die ('You don’t have the right to edit <strong>'.$authordata[1].'</strong>’s posts.'); 139 159 140 160 $content = $postdata['Content']; 141 161 $content = format_to_edit($content); 162 $edited_lat = $postdata["Lat"]; 163 $edited_lon = $postdata["Lon"]; 142 164 $excerpt = $postdata['Excerpt']; 143 165 $excerpt = format_to_edit($excerpt); … … 165 187 $standalone = 1; 166 188 require_once('./b2header.php'); 167 189 168 190 if ($user_level == 0) 169 191 die ('Cheatin’ uh?'); … … 180 202 $excerpt = format_to_post($excerpt); 181 203 $post_title = addslashes($HTTP_POST_VARS['post_title']); 204 if(get_settings('use_geo_positions')) { 205 $latf = floatval($HTTP_POST_VARS["post_latf"]); 206 $lonf = floatval($HTTP_POST_VARS["post_lonf"]); 207 $latlonaddition = ""; 208 if( ($latf != null) && ($latf <= 90 ) && ($latf >= -90) && ($lonf != null) && ($lonf <= 360) && ($lonf >= -360) ) { 209 pingGeoUrl($post_ID); 210 $latlonaddition = " post_lat=".$latf.", post_lon =".$lonf.", "; 211 } else { 212 $latlonaddition = " post_lat=null, post_lon=null, "; 213 } 214 } 182 215 $post_status = $HTTP_POST_VARS['post_status']; 183 216 $prev_status = $HTTP_POST_VARS['prev_status']; … … 203 236 204 237 $result = $wpdb->query(" 205 UPDATE $tableposts SET 206 post_content = '$content', 207 post_excerpt = '$excerpt', 208 post_title = '$post_title', 209 post_category = '$post_category'".$datemodif.", 210 post_status = '$post_status',211 comment_status = '$comment_status',212 ping_status = '$ping_status',213 p ost_password = '$post_password'214 WHERE ID = $post_ID215 ");238 UPDATE $tableposts SET 239 post_content = '$content', 240 post_excerpt = '$excerpt', 241 post_title = '$post_title', 242 post_category = '$post_category'".$datemodif.", 243 ".$latlonaddition." 244 post_status = '$post_status', 245 comment_status = '$comment_status', 246 ping_status = '$ping_status', 247 post_password = '$post_password' 248 WHERE ID = $post_ID "); 216 249 217 250 if (isset($sleep_after_edit) && $sleep_after_edit > 0) { … … 224 257 pingCafelog($cafelogID, $post_title, $post_ID); 225 258 pingBlogs($blog_ID); 226 259 227 260 if ($post_pingback) { 228 261 pingback($content, $post_ID); … … 258 291 if ($user_level < $authordata->user_level) 259 292 die ('You don’t have the right to delete <strong>'.$authordata[1].'</strong>’s posts.'); 293 294 // send geoURL ping to "erase" from their DB 295 $query = "SELECT post_lat from $tableposts WHERE ID=$post"; 296 $rows = $wpdb->query($query); 297 $myrow = $rows[0]; 298 $latf = $myrow->post_lat; 299 if($latf != null ) { 300 pingGeoUrl($post); 301 } 260 302 261 303 $result = $wpdb->query("DELETE FROM $tableposts WHERE ID=$post"); … … 349 391 350 392 $result = $wpdb->query(" 351 UPDATE $tablecomments SET 352 comment_content = '$content', 353 comment_author = '$newcomment_author', 354 comment_author_email = '$newcomment_author_email', 355 comment_author_url = '$newcomment_author_url'".$datemodif." 393 UPDATE $tablecomments SET 394 comment_content = '$content', 395 comment_author = '$newcomment_author', 396 comment_author_email = '$newcomment_author_email', 397 comment_author_url = '$newcomment_author_url'".$datemodif." 356 398 WHERE comment_ID = $comment_ID" 357 399 ); -
trunk/wp-admin/optionhandler.php
r223 r294 16 16 case 1: // integer 17 17 case 3: // string 18 case 8: // float 18 19 case 6: // range -- treat same as integer for now! 19 20 if (($option_result->option_type == 1) || ($option_result->option_type == 1)) { -
trunk/wp-admin/upgrade-071-to-072.php
r290 r294 44 44 45 45 case 0: 46 { 46 47 ?> 47 48 <p>Welcome to WordPress. You're already part of the family so this should be familiar … … 70 71 you’re all ready, <a href="<?php echo $thisfile;?>?step=1">let's go</a>! </p> 71 72 <?php 72 break; 73 break; 74 } 73 75 74 76 case 1: 77 { 75 78 ?> 76 79 <h1>Step 1</h1> … … 202 205 <?php 203 206 } 204 break; 205 case 2: 207 break; 208 } // end case 1 209 210 case 2: 211 { 206 212 ?> 207 213 <h1>Step 2</h1> 214 <p>There are some changes we need to make to the post table, we'll do those next.</p> 215 <?php 216 $error_count = 0; 217 $tablename = $tableposts; 218 219 $ddl = "ALTER TABLE $tableposts ADD COLUMN post_lon float "; 220 maybe_add_column($tablename, 'post_lon', $ddl); 221 if (check_column($tablename, 'post_lon', 'float')) { 222 $res .= $tablename . ' - ok <br />'."\n"; 223 } else { 224 $res .= 'There was a problem with ' . $tablename . '<br />'."\n"; 225 ++$error_count; 226 } 227 228 $ddl = "ALTER TABLE $tableposts ADD COLUMN post_lat float "; 229 maybe_add_column($tablename, 'post_lat', $ddl); 230 if (check_column($tablename, 'post_lat', 'float')) { 231 $res .= $tablename . ' - ok <br />'."\n"; 232 } else { 233 $res .= 'There was a problem with ' . $tablename . '<br />'."\n"; 234 ++$error_count; 235 } 236 237 238 if ($error_count > 0) { 239 echo("<p>$res</p>"); 240 ?> 241 <p>Hmmm... there was some kind of error. If you cannot figure out 242 see from the output above how to correct the problems please 243 visit our <a href="http://wordpress.org/support/">support 244 forums</a> and report your problem.</p> 245 <?php 246 } else { 247 ?> 248 <p>OK, another step completed. Let's move on to <a href="<?php echo $thisfile;?>?step=3">step 3</a>.</p> 249 <?php 250 } 251 break; 252 } // end case 2 253 254 case 3: 255 { 256 ?> 257 <h1>Step 3</h1> 208 258 <p>There are a few new database tables with this version, so lets get those out of 209 259 the way.</p> … … 524 574 525 575 ?> 576 <?php 577 $geo_option_data = array( 578 // data for geo settings 579 "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)", 580 "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)", 581 "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)", 582 "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)", 583 584 "INSERT INTO $tableoptiongroups (group_id, group_name, group_desc) VALUES(9,'Geo Options', 'Settings which control the posting and display of Geo Options')", 585 586 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,84,1)", 587 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,85,1)", 588 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,86,1)", 589 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,87,1)", 590 ); 591 592 foreach ($geo_option_data as $query) { 593 $q = $wpdb->query($query); 594 } 595 ?> 596 597 <p>Geo option data inserted okay.</p> 598 526 599 527 600 <p>Good, the option data was inserted okay.</p> … … 742 815 <?php 743 816 } // end else no b2config 744 break; 817 break; 818 } // end case 3 745 819 } 746 820 ?> -
trunk/wp-admin/wp-install-helper.php
r280 r294 1 1 <?php 2 2 require_once('../wp-config.php'); 3 $debug = 0; 3 4 4 5 /** … … 33 34 */ 34 35 function maybe_add_column($table_name, $column_name, $create_ddl) { 35 global $wpdb ;36 global $wpdb, $debug; 36 37 foreach ($wpdb->get_col("DESC $table_name",0) as $column ) { 38 if ($debug) echo("checking $column == $column_name<br />"); 37 39 if ($column == $column_name) { 38 40 return true; … … 91 93 */ 92 94 function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) { 93 global $wpdb ;95 global $wpdb, $debug; 94 96 $diffs = 0; 95 97 $results = $wpdb->get_results("DESC $table_name"); 96 98 97 99 foreach ($results as $row ) { 98 //print_r($row);100 if ($debug > 1) print_r($row); 99 101 if ($row->Field == $col_name) { 100 102 // got our column, check the params 101 //echo ("checking $row->Type against $col_type\n");103 if ($debug) echo ("checking $row->Type against $col_type\n"); 102 104 if (($col_type != null) && ($row->Type != $col_type)) { 103 105 ++$diffs; … … 116 118 } 117 119 if ($diffs > 0) { 118 //echo ("diffs = $diffs returning false\n");120 if ($debug) echo ("diffs = $diffs returning false\n"); 119 121 return false; 120 122 } -
trunk/wp-admin/wp-install.php
r290 r294 193 193 post_category int(4) NOT NULL default '0', 194 194 post_excerpt text NOT NULL, 195 post_lat float, 196 post_lon float, 195 197 post_status enum('publish','draft','private') NOT NULL default 'publish', 196 198 comment_status enum('open','closed') NOT NULL default 'open', … … 359 361 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (6, 'range')", 360 362 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (7, 'sqlselect')", 363 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (8, 'float')", 364 361 365 //base options from b2cofig 362 366 "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 623 <p>Links option data inserted okay.</p> 620 624 625 <?php 626 $geo_option_data = array( 627 // data for geo settings 628 "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)", 629 "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)", 630 "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)", 631 "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)", 632 633 "INSERT INTO $tableoptiongroups (group_id, group_name, group_desc) VALUES(9,'Geo Options',Settings which control the posting and display of Geo Options')", 634 635 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,84,1)", 636 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,85,1)", 637 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,86,1)", 638 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(9,87,1)", 639 640 ); 641 642 foreach ($geo_option_data as $query) { 643 $q = $wpdb->query($query); 644 } 645 ?> 646 647 <p>Geo option data inserted okay.</p> 648 649 621 650 <p>OK. We're nearly done now. We just need to ask you a couple of things:</p> 622 651 <form action="wp-install.php?step=3" method="post">
Note: See TracChangeset
for help on using the changeset viewer.