Index: src/lib/wp-includes/registration-functions.php
===================================================================
--- src/lib/wp-includes/registration-functions.php (revision 925)
+++ src/lib/wp-includes/registration-functions.php (working copy)
@@ -165,6 +165,12 @@
}
function lyceum_create_blog_from_username($username, $blog_name=false){
+ //
+ //if (! $blog_name) {
+ // $blog_name = $username;
+ //}
+ //
+
global $wpdb;
$userid = $wpdb->get_var("SELECT `ID` FROM $wpdb->users WHERE `user_login` = '$username'");
return lyceum_create_blog($userid, $blog_name);
@@ -203,21 +209,27 @@
update_option('default_link_category', $linkcatid);
$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_owner) VALUES ('http://ibiblio.org/ibiblog', 'Ibiblio Blog', '$linkcatid', 'http://www.ibiblio.org/ibiblog/feed/', '$userid');");
+ // ASHEESH NOTE: Always create default category
// Default category
$wpdb->query("INSERT INTO $wpdb->categories (blog, cat_name, category_nicename, category_count) VALUES ('$blog', '".$wpdb->escape(__('Uncategorized'))."', '".sanitize_title(__('Uncategorized'))."', '1')");
$catid=$wpdb->insert_id;
update_option('default_category', $catid);
- // First post
- $now = date('Y-m-d H:i:s');
- $now_gmt = gmdate('Y-m-d H:i:s');
- $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_name, post_modified, post_modified_gmt, comment_count) VALUES ($userid, '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '".$wpdb->escape(__('Hello world!'))."', '".$wpdb->escape(__('hello-world'))."', '$now', '$now_gmt', '1')");
- $postid=$wpdb->insert_id;
- $wpdb->query( "INSERT INTO $wpdb->post2cat (`post_id`, `category_id`) VALUES ($postid, $catid)" );
+ // ASHEESH NOTE: Here's a switch to turn off and on the first post
+ $do_first_post = 0;
+ if ($do_first_post) {
+ // First post
+ $now = date('Y-m-d H:i:s');
+ $now_gmt = gmdate('Y-m-d H:i:s');
+
+ $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_name, post_modified, post_modified_gmt, comment_count) VALUES ($userid, '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '".$wpdb->escape(__('Hello world!'))."', '".$wpdb->escape(__('hello-world'))."', '$now', '$now_gmt', '1')");
+ $postid=$wpdb->insert_id;
+ $wpdb->query( "INSERT INTO $wpdb->post2cat (`post_id`, `category_id`) VALUES ($postid, $catid)" );
+
+ // Default comment
+ $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('$postid', '".$wpdb->escape(__('Mr WordPress'))."', '', 'http://wordpress.org', '$now', '$now_gmt', '".$wpdb->escape(__('Hi, this is a comment.
To delete a comment, just log in, and view the posts\' comments, there you will have the option to edit or delete them.'))."')");
+ }
- // Default comment
- $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('$postid', '".$wpdb->escape(__('Mr WordPress'))."', '', 'http://wordpress.org', '$now', '$now_gmt', '".$wpdb->escape(__('Hi, this is a comment.
To delete a comment, just log in, and view the posts\' comments, there you will have the option to edit or delete them.'))."')");
-
// First Page
$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_name, post_modified, post_modified_gmt, post_status, page_blog) VALUES ($userid, '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '".$wpdb->escape(__('About'))."', '".$wpdb->escape(__('about'))."', '$now', '$now_gmt', 'static', '$blog')");
$pageid=$wpdb->insert_id;