From 2b6ce7642cc6069aa59cf1b2ad0db7bcb0bd0c6d Mon Sep 17 00:00:00 2001
From: saxmatt This file seeks to upgrade you to the latest version of WordPress. If you are upgrading from any version other than .72, you should run the previous upgrade files to get everything up to date before running this. If you’re all ready, let's go! If it isn’t there already, let’s add a field new to this version. Done. Now let's populate the new field. Working
+ get_results("SELECT ID, post_title, post_name FROM $tableposts");
+
+foreach($posts as $post) {
+ if ('' == $post->post_name) {
+ $newtitle = sanitize_title($post->post_title);
+ $wpdb->query("UPDATE $tableposts SET post_name = '$newtitle' WHERE ID = $post->ID");
+ }
+ echo ' .';
+ flush();
+}
+
+if (!$wpdb->get_var("SELECT option_name FROM $tableoptions WHERE option_name = 'permalink_structure'")) { // If it's not already there
+ $wpdb->query("INSERT INTO `$tableoptions`
+ (`option_id`, `blog_id`, `option_name`, `option_can_override`, `option_type`, `option_value`, `option_width`, `option_height`, `option_description`, `option_admin_level`)
+ VALUES
+ ('', '0', 'permalink_structure', 'Y', '3', '', '20', '8', 'How the permalinks for your site are constructed. See permalink options page for necessary mod_rewrite rules and more information.', '8');");
+ }
+?>
+ Done with the name game. Now a little option action. Now on to step 2. Now we need to adjust some option data (don't worry this won't change any of your settings.) Working
+hide_errors(); // Turn this off for dev and we should probably just fix the queries anyway
+ // 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 php date format. this could be to a wordpress.org page in the future
+ $wpdb->query("UPDATE $tableoptions SET option_description = 'see help for format characters' WHERE option_id = 52");
+ $wpdb->query("UPDATE $tableoptions SET option_description = 'see help for format characters' WHERE option_id = 53");
+ echo ' .';
+ flush();
+?>
+ Done with the options updates. Now for a bit of comment action Comment spammers should now watch out for you. See, that didn’t hurt a bit (again). Now on to the final step. This is the final step, and the most exciting. We’re going to make it so each post can now have multiple categories. Hold on tight.WordPress
+
+Step 1
+Step 2
+ Step 3
+
New category table already created. Skipping.
'; +?> +Now we need to transfer all your old categories into the new table.
+Working... +get_results("SELECT ID, post_category FROM $tableposts"); + +foreach ($allposts as $post) { + // Check to see if it's already been imported + $cat = $wpdb->get_row("SELECT * FROM $tablepost2cat WHERE post_id = $post->ID AND category_id = $post->post_category"); + if (!$cat) { // If there's no result + $wpdb->query(" + INSERT INTO $tablepost2cat + (post_id, category_id) + VALUES + ($post->ID, $post->post_category) + "); + echo '. '; + flush(); + } +} + +// Going to leave the post table category field in for now. We can remove it in a future version. +?> + All done!
+You are ready to rock ’n roll. Go crazy.
+ + +