XPressME Integration Kit

Trac


Ignore:
Timestamp:
Nov 19, 2013, 9:47:43 PM (11 years ago)
Author:
toemon
Message:

MySQL5.5 TYPE=MyISAM エラー バグ修正 fix #429

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/include/oninstall.php

    r835 r852  
    4747        global $wpdb,$wp_rewrite, $wp_queries, $table_prefix, $wp_db_version, $wp_roles, $wp_query,$wp_embed; 
    4848        global $xoops_config; 
    49                  
     49 
    5050        define("WP_INSTALLING", true); 
    5151        define('WP_FIRST_INSTALL', true); // For WPMU2.8 
    52          
     52 
    5353        $site_url= XOOPS_URL."/modules/".$mydirname; 
    5454        $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 
    5555        $path = $mydirpath . '/'; 
    5656        $site_name = ucfirst($mydirname) . ' ' . _MI_XP2_NAME; 
    57          
     57 
    5858// permission and wordpress files check 
    5959        require_once ($path . 'include/pre_check.php'); 
     
    6666                return false; 
    6767        } 
    68          
     68 
    6969// install WordPress 
    7070        if (file_exists($path . 'wp-load.php')) { 
     
    7777        make_db_current_silent(); 
    7878        $ret[] = "The data base of wordpress was made by prefix $table_prefix.<br />"; 
    79          
     79 
    8080        $option_desc = __('WordPress web address'); 
    81         $wpdb->query("INSERT INTO $wpdb->options (blog_id, option_name,option_value, autoload) VALUES ('0', 'siteurl','$site_url', 'yes')");     
     81        $wpdb->query("INSERT INTO $wpdb->options (blog_id, option_name,option_value, autoload) VALUES ('0', 'siteurl','$site_url', 'yes')"); 
    8282        $wpdb->query("INSERT INTO $wpdb->options (blog_id, option_name,option_value, autoload) VALUES ('0', 'home','$site_url', 'yes')"); 
    8383 
    8484        populate_options(); 
    8585        populate_roles(); 
    86          
     86 
    8787// create XPressME table 
    8888        $xp_prefix = preg_replace('/wordpress/','wp',$mydirname); 
     
    104104        dbDelta($views_queries); 
    105105        $ret[] = "$views_table table of XPressME was made.<br />"; 
    106          
     106 
    107107        $d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ; 
    108108        $views_queries ="CREATE TABLE $d3forum_link ( 
     
    116116        dbDelta($views_queries); 
    117117        $ret[] = "$d3forum_link table of XPressME was made.<br />"; 
    118          
     118 
    119119        $group_role = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_group_role' ; 
    120120        $views_queries ="CREATE TABLE $group_role ( 
     
    130130        dbDelta($views_queries); 
    131131        $ret[] = "$group_role table of XPressME was made.<br />"; 
    132          
     132 
    133133        $notify_reserve = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_notify_reserve' ; 
    134134        $queries ="CREATE TABLE $notify_reserve ( 
     
    143143                omit_user_id varchar(20) NOT NULL default '' , 
    144144                KEY notify_reserve_id (notify_reserve_id) 
    145                 )TYPE=MyISAM"; 
     145                )$charset_collate;"; 
    146146        dbDelta($queries); 
    147147        $ret[] = "$notify_reserve table of XPressME was made.<br />"; 
     
    149149        $sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')"; 
    150150        $wpdb->query($sql); 
    151          
     151 
    152152// make templates 
    153153        include_once XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/include/xpress_templates_make.php' ; 
    154154        $t_mess = xpress_templates_make($mid,$mydirname); 
    155          
     155 
    156156// Admin User Data write 
    157157        // Change uid field 
     
    160160        $email = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("email"):'foo@exsample.com'; 
    161161        $pass_md5 = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("pass"):''; 
    162          
     162 
    163163        add_filter('sanitize_user', "sanitize_user_multibyte" ,10,3); 
    164          
     164 
    165165        if (!function_exists('username_exists')){ 
    166166                require_once($mydirpath . '/wp-includes/registration-functions.php'); 
     
    177177        $user->set_role('administrator'); 
    178178        'User ' . $user_name . ' of the administrator was made.'; 
    179         // over write xoops md5 password  
     179        // over write xoops md5 password 
    180180        $sql = "UPDATE $wpdb->users SET user_pass ='$pass_md5' WHERE ID = $user_id"; 
    181181        $wpdb->query($sql); 
    182182        $ret[] = 'The password of XOOPS was copied.<br />'; 
    183          
    184          
     183 
     184 
    185185// Set Default data 
    186         // make WordPress Default data   
     186        // make WordPress Default data 
    187187        if (function_exists('wp_install_defaults')){ 
    188188                wp_install_defaults($user_id); 
     
    190190                wp_install_old_defaults($user_id); 
    191191        } 
    192          
     192 
    193193        $ret[] = 'The first sample post & comment was written.<br />'; 
    194          
     194 
    195195        // Rewrite Option for Xpress 
    196196        $xoops_config_tbl = XOOPS_DB_PREFIX . '_config' ; 
    197197        $sql = "SELECT conf_value FROM  $xoops_config_tbl WHERE `conf_name` = 'default_TZ'"; 
    198198        $xoops_default_TZ = $wpdb->get_var($sql); 
    199         update_option('gmt_offset', $xoops_default_TZ);  
     199        update_option('gmt_offset', $xoops_default_TZ); 
    200200 
    201201        if (WPLANG == 'ja_EUC') { 
     
    208208        update_option("blog_charset", $setup_charset); 
    209209 
    210         update_option('blogname', $site_name );  
     210        update_option('blogname', $site_name ); 
    211211        update_option('blogdescription', 'WordPress for XOOPS'); 
    212212        update_option("admin_email", $GLOBALS["xoopsConfig"]['adminmail']); 
     
    217217        update_option('default_pingback_flag', 0); 
    218218        $ret[] = 'The initial data was written in the data base of wordpress.<br />'; 
    219          
     219 
    220220        update_option("template", "xpress_default"); 
    221221        update_option("stylesheet", "xpress_default"); 
     
    223223//      update_option('uploads_use_yearmonth_folders', 1); 
    224224        update_option('upload_path', 'wp-content/uploads'); 
    225                          
     225 
    226226// activate the xpressme plugin 
    227227        require_once dirname( __FILE__ ).'/xpress_active_plugin.php'; 
Note: See TracChangeset for help on using the changeset viewer.