Upgrade and import fixes.

git-svn-id: https://develop.svn.wordpress.org/trunk@762 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-01-12 12:12:45 +00:00
parent 68620d2c3f
commit 0b08f1365d
5 changed files with 28 additions and 57 deletions

View File

@ -15,16 +15,11 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
}
}
}
require_once('../wp-config.php');
require('upgrade_functions.php');
switch ($action) {
case "step1":
require_once('../wp-config.php');
require_once(ABSPATH.WPINC.'/template-functions.php');
require_once(ABSPATH.WPINC.'/functions.php');
require_once(ABSPATH.WPINC.'/vars.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
@ -158,7 +153,7 @@ case "step1":
here's the bugfix: */
$result = $wpdb->query("DELETE FROM $tableposts WHERE post_date=\"0000-00-00 00:00:00\"");
upgrade_all();
?>
</ul>
<strong>Done</strong>

View File

@ -6,6 +6,7 @@
require_once('../wp-config.php');
require_once(ABSPATH.WPINC.'/functions.php');
require('upgrade-functions.php');
$wpvarstoreset = array('action', 'gmpath', 'archivespath');
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
@ -252,7 +253,9 @@ textarea,input,select {
}
echo "... <b>Done</b></li>";
}
} ?>
}
upgrade_all();
?>
</ul><b>Done</b></li></ul>
<p>&nbsp;</p>
<p>Completed GM 2 b2 import !</p>

View File

@ -2,14 +2,14 @@
// For security reasons, fill in the connection details to your Textpattern database below:
$tp_database_name = 'wordpres_test';
$tp_database_username = 'wordpres_test';
$tp_database_password = 'test';
$tp_database_name = 'textpattern';
$tp_database_username = 'username';
$tp_database_password = 'password';
$tp_database_host = 'localhost';
if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config.sample.php with the proper database connection information and renamed it to wp-config.php.");
require('../wp-config.php');
require('install-helper.php');
require('upgrade-functions.php');
$step = $HTTP_GET_VARS['step'];
if (!$step) $step = 0;
@ -29,14 +29,14 @@ if (!$step) $step = 0;
padding: 0;
background-image: url(http://wordpress.org/images/wordpress.gif);
background-repeat: no-repeat;
height: 72px;
height: 60px;
border-bottom: 4px solid #333;
}
#logo a {
display: block;
text-decoration: none;
text-indent: -100em;
height: 72px;
height: 60px;
}
p {
line-height: 140%;
@ -60,7 +60,7 @@ if ($connection && $database) {
<?php
} else {
?>
<p><em>It doesn't look like your database information is correct. Please re-edit this file and double-check all the settings.</em></p>
<p><em>It doesn't look like your database information is incorrect. Please re-edit this file and double-check all the settings.</em></p>
<?php
}
break;
@ -102,9 +102,9 @@ while ($post = mysql_fetch_array($posts)) {
$post_name = sanitize_title($title);
$wpdb->query("INSERT INTO $tableposts
(post_author, post_date, post_content, post_title, post_category, post_name)
(post_author, post_date, post_content, post_title, post_category, post_name, post_status)
VALUES
('$author', '$posted', '$content', '$title', '$category', '$post_name')");
('$author', '$posted', '$content', '$title', '$category', '$post_name', 'publish')");
// Get wordpress post id
$wp_post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
@ -125,44 +125,13 @@ while ($post = mysql_fetch_array($posts)) {
}
}
?>
<p><strong>Done.</strong></p>
<p>Now let's populate the new field.</p>
<p>Working
<strong>Done.</strong></p>
<p>Now on to <a href="upgrade-072-to-073.php?step=2">step 2</a>.</p>
<?php
break;
case 2:
upgrade_all();
?>
<h1>Step 2</h1>
<p>Now we need to adjust some option data (don't worry this won't change any of your settings.) </p>
<p>Working
<p><strong>All done.</strong> Wasn&#8217;t that fun? <a href="../">Have fun</a>.</p>
<?php
// fix timezone diff range
$wpdb->query("UPDATE $tableoptionvalues SET optionvalue_max = 23 , optionvalue_min = -23 WHERE option_id = 51");
echo ' .';
flush();
// fix upload users description
$wpdb->query("UPDATE $tableoptions SET option_description = '...or you may authorize only some users. enter their logins here, separated by spaces. if you leave this variable blank, all users who have the minimum level are authorized to upload. example: \'barbara anne george\'' WHERE option_id = 37");
echo ' .';
flush();
// and file types
$wpdb->query("UPDATE $tableoptions SET option_description = 'accepted file types, separated by spaces. example: \'jpg gif png\'' WHERE option_id = 34");
echo ' .';
flush();
// add link to date format help page
$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"help/en/dateformats.help.html\">help</a> for format characters' WHERE option_id = 52");
$wpdb->query("UPDATE $tableoptions SET option_description = 'see <a href=\"help/en/dateformats.help.html\">help</a> for format characters' WHERE option_id = 53");
echo ' .';
flush();
?>
<strong>Done.</strong></p>
<p>See, that didn&#8217;t hurt a bit. All done!</p>
<?php
break;
break;
}
?>
</body>
</html>

View File

@ -1,6 +1,13 @@
<?php
// Functions to be called in install and upgrade scripts
function upgrade_all() {
upgrade_071();
upgrade_072();
upgrade_100();
upgrade_101();
}
// General
function maybe_create_table($table_name, $create_ddl) {
global $wpdb;

View File

@ -48,10 +48,7 @@ switch($step) {
break;
case 1:
upgrade_071();
upgrade_072();
upgrade_100();
upgrade_101();
upgrade_all();
?>
<h2>Step 1</h2>
<p>There's actually only one step. So if you see this, you're done. <a href="../">Have fun</a>! </p>