Ticket #994: install-gettext.diff

File install-gettext.diff, 4.0 KB (added by SteveAgl, 7 years ago)
  • .php

    old new  
    134134$wpdb->query("UPDATE $wpdb->options SET option_value = '$admin_email' WHERE option_name = 'admin_email'"); 
    135135 
    136136// Now drop in some default links 
    137 $wpdb->query("INSERT INTO $wpdb->linkcategories (cat_id, cat_name) VALUES (1, 'Blogroll')"); 
     137$wpdb->query("INSERT INTO $wpdb->linkcategories (cat_id, cat_name) VALUES (1, '" . addslashes(__('Blogroll')) . "')"); 
    138138$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss) VALUES ('http://blog.carthik.net/index.php', 'Carthik', 1, 'http://blog.carthik.net/feed/');"); 
    139139$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss) VALUES ('http://blogs.linux.ie/xeer/', 'Donncha', 1, 'http://blogs.linux.ie/xeer/feed/');"); 
    140140$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss) VALUES ('http://zengun.org/weblog/', 'Michel', 1, 'http://zengun.org/weblog/feed/');"); 
     
    145145$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss) VALUES ('http://dougal.gunters.org/', 'Dougal', 1, 'http://dougal.gunters.org/feed/');"); 
    146146 
    147147// Default category 
    148 $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name) VALUES ('0', 'Uncategorized')"); 
     148$wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name) VALUES ('0', '" . addslashes(__('Uncategorized')) . "')"); 
    149149 
    150150// First post 
    151151$now = date('Y-m-d H:i:s'); 
    152152$now_gmt = gmdate('Y-m-d H:i:s'); 
    153 $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_name, post_modified, post_modified_gmt) VALUES ('1', '$now', '$now_gmt', 'Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!', 'Hello world!', '0', 'hello-world', '$now', '$now_gmt')"); 
     153$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_name, post_modified, post_modified_gmt) VALUES ('1', '$now', '$now_gmt', '" . addslashes(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!')) . "', '" . addslashes(__('Hello world!')) . "', '0', '" . addslashes(__('hello-world')) . "', '$now', '$now_gmt')"); 
    154154 
    155155$wpdb->query( "INSERT INTO $wpdb->post2cat (`rel_id`, `post_id`, `category_id`) VALUES (1, 1, 1)" ); 
    156156 
    157157// Default comment 
    158 $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content) VALUES ('1', 'Mr WordPress', '', 'http://wordpress.org', '127.0.0.1', '$now', '$now_gmt', 'Hi, this is a comment.<br />To delete a comment, just log in, and view the posts\' comments, there you will have the option to edit or delete them.')"); 
     158$wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content) VALUES ('1', '" . addslashes(__('Mr WordPress')) . "', '', 'http://wordpress.org', '127.0.0.1', '$now', '$now_gmt', '" . addslashes(__('Hi, this is a comment.<br />To delete a comment, just log in, and view the posts\' comments, there you will have the option to edit or delete them.')) . "')"); 
    159159 
    160160// Set up admin user 
    161161$random_password = substr(md5(uniqid(microtime())), 0, 6); 
    162 $wpdb->query("INSERT INTO $wpdb->users (ID, user_login, user_pass, user_nickname, user_email, user_level, user_idmode, user_registered) VALUES ( '1', 'admin', MD5('$random_password'), 'Administrator', '$admin_email', '10', 'nickname', NOW() )"); 
     162$wpdb->query("INSERT INTO $wpdb->users (ID, user_login, user_pass, user_nickname, user_email, user_level, user_idmode, user_registered) VALUES ( '1', 'admin', MD5('$random_password'), '" . addslashes(__('Administrator')) . "', '$admin_email', '10', 'nickname', NOW() )"); 
    163163 
    164164$from = 'From: '.$_POST['weblog_title'].' <wordpress@'.$_SERVER['SERVER_NAME'].'>'; 
    165165$message_headers = "$from";