Upgrade and import fixes.

git-svn-id: http://svn.automattic.com/wordpress/trunk@762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-01-12 12:12:45 +00:00
parent 873de35f5d
commit faeebc5bda
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) { switch ($action) {
case "step1": 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"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
@ -158,7 +153,7 @@ case "step1":
here's the bugfix: */ here's the bugfix: */
$result = $wpdb->query("DELETE FROM $tableposts WHERE post_date=\"0000-00-00 00:00:00\""); $result = $wpdb->query("DELETE FROM $tableposts WHERE post_date=\"0000-00-00 00:00:00\"");
upgrade_all();
?> ?>
</ul> </ul>
<strong>Done</strong> <strong>Done</strong>

View File

@ -6,6 +6,7 @@
require_once('../wp-config.php'); require_once('../wp-config.php');
require_once(ABSPATH.WPINC.'/functions.php'); require_once(ABSPATH.WPINC.'/functions.php');
require('upgrade-functions.php');
$wpvarstoreset = array('action', 'gmpath', 'archivespath'); $wpvarstoreset = array('action', 'gmpath', 'archivespath');
for ($i=0; $i<count($wpvarstoreset); $i += 1) { for ($i=0; $i<count($wpvarstoreset); $i += 1) {
@ -252,7 +253,9 @@ textarea,input,select {
} }
echo "... <b>Done</b></li>"; echo "... <b>Done</b></li>";
} }
} ?> }
upgrade_all();
?>
</ul><b>Done</b></li></ul> </ul><b>Done</b></li></ul>
<p>&nbsp;</p> <p>&nbsp;</p>
<p>Completed GM 2 b2 import !</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: // For security reasons, fill in the connection details to your Textpattern database below:
$tp_database_name = 'wordpres_test'; $tp_database_name = 'textpattern';
$tp_database_username = 'wordpres_test'; $tp_database_username = 'username';
$tp_database_password = 'test'; $tp_database_password = 'password';
$tp_database_host = 'localhost'; $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."); 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('../wp-config.php');
require('install-helper.php'); require('upgrade-functions.php');
$step = $HTTP_GET_VARS['step']; $step = $HTTP_GET_VARS['step'];
if (!$step) $step = 0; if (!$step) $step = 0;
@ -29,14 +29,14 @@ if (!$step) $step = 0;
padding: 0; padding: 0;
background-image: url(http://wordpress.org/images/wordpress.gif); background-image: url(http://wordpress.org/images/wordpress.gif);
background-repeat: no-repeat; background-repeat: no-repeat;
height: 72px; height: 60px;
border-bottom: 4px solid #333; border-bottom: 4px solid #333;
} }
#logo a { #logo a {
display: block; display: block;
text-decoration: none; text-decoration: none;
text-indent: -100em; text-indent: -100em;
height: 72px; height: 60px;
} }
p { p {
line-height: 140%; line-height: 140%;
@ -60,7 +60,7 @@ if ($connection && $database) {
<?php <?php
} else { } 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 <?php
} }
break; break;
@ -102,9 +102,9 @@ while ($post = mysql_fetch_array($posts)) {
$post_name = sanitize_title($title); $post_name = sanitize_title($title);
$wpdb->query("INSERT INTO $tableposts $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 VALUES
('$author', '$posted', '$content', '$title', '$category', '$post_name')"); ('$author', '$posted', '$content', '$title', '$category', '$post_name', 'publish')");
// Get wordpress post id // Get wordpress post id
$wp_post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); $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)) {
} }
} }
?> upgrade_all();
<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:
?> ?>
<h1>Step 2</h1> <p><strong>All done.</strong> Wasn&#8217;t that fun? <a href="../">Have fun</a>.</p>
<p>Now we need to adjust some option data (don't worry this won't change any of your settings.) </p>
<p>Working
<?php <?php
// fix timezone diff range break;
$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;
} }
?> ?>
</body> </body>
</html> </html>

View File

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

View File

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