XPressME Integration Kit

Trac

Changeset 852


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

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

Location:
trunk/xpressme_integration_kit/include
Files:
2 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'; 
  • trunk/xpressme_integration_kit/include/onupdate.php

    r835 r852  
    2323        $db =& XoopsDatabaseFactory::getDatabaseConnection() ; 
    2424        $mid = $module->getVar('mid') ; 
    25          
     25 
    2626 
    2727 
     
    3939        } 
    4040 
    41 //Site_url and home of an optional table are repaired.  
     41//Site_url and home of an optional table are repaired. 
    4242        $site_url= XOOPS_URL."/modules/".$mydirname; 
    4343        xpress_put_siteurl($mydirname,$site_url); 
     
    6161        $t_mess = xpress_clean_templates_file($mydirname,$mod_version); 
    6262        $msgs = array_merge($msgs,$t_mess); 
    63          
     63 
    6464        $t_mess = xpress_templates_make($mid,$mydirname); 
    6565        $msgs = array_merge($msgs,$t_mess); 
    6666 
    67 // The activation processing of the XPressME plugin is omitted.  
     67// The activation processing of the XPressME plugin is omitted. 
    6868// Because the XPressME plugin is done with wp-config in activation 
    6969 
     
    7373//              $msgs[] = 'The xpressme plug-in was activated.'; 
    7474//      } 
    75          
     75 
    7676        return true ; 
    7777} 
     
    110110 
    111111                $sql = "SELECT option_value FROM $option_table WHERE option_name = '" . $option_name . "'"; 
    112                  
     112 
    113113                $result =  $xoopsDB->query($sql, 0, 0); 
    114114                if ($xoopsDB->getRowsNum($result)  > 0){ 
     
    163163        } 
    164164 
    165         switch ( $xoops_block_check->get_op() )  
     165        switch ( $xoops_block_check->get_op() ) 
    166166        { 
    167167                case "remove_block": 
     
    194194                post_views bigint(20) unsigned NOT NULL default '0', 
    195195                KEY post_id (post_id) 
    196                 ) TYPE=MyISAM"; 
     196                ) ENGINE=MyISAM"; 
    197197                $db->queryF( $queries ) ; 
    198198                $msgs[] = "$views_table table of XPressME was made."; 
     
    203203                        $msgs[] = "$views_table  ADD blog_id ."; 
    204204                } 
    205                  
     205 
    206206                // The table is repaired. 
    207207                $non_blogid_sql ="SELECT * FROM $views_table WHERE blog_id IS NULL OR blog_id < 1"; 
     
    222222                } 
    223223        } 
    224          
     224 
    225225        $d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ; 
    226226        if (! enhanced_table_check($mydirname,'d3forum_link')){ 
     
    232232                        blog_id bigint(20) unsigned NOT NULL default '0', 
    233233                        KEY post_id (post_id) 
    234                         )TYPE=MyISAM"; 
     234                        )ENGINE=MyISAM"; 
    235235                $db->queryF( $queries ) ; 
    236236                $msgs[] = "$d3forum_link table of XPressME was made."; 
     
    265265                        login_all smallint(5) unsigned NOT NULL default '0' , 
    266266                        KEY groupid (groupid) 
    267                         )TYPE=MyISAM"; 
     267                        )ENGINE=MyISAM"; 
    268268                $db->queryF( $queries ) ; 
    269269                $sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')"; 
     
    280280                $db->queryF( $update_sql ) ; 
    281281        } 
    282          
     282 
    283283        if (! enhanced_table_check($mydirname,'notify_reserve')){ 
    284284                $notify_reserve = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_notify_reserve' ; 
     
    294294                        omit_user_id varchar(20) NOT NULL default '' , 
    295295                        KEY notify_reserve_id (notify_reserve_id) 
    296                         )TYPE=MyISAM"; 
     296                        )ENGINE=MyISAM"; 
    297297                $db->queryF( $queries ) ; 
    298298                $msgs[] = "$notify_reserve table of XPressME was made."; 
     
    305305function enhanced_table_check($mydirname,$table_name){ 
    306306                global $xoopsModule; 
    307                  
     307 
    308308                $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection(); 
    309309                $xpress_prefix = $xoopsDB->prefix(preg_replace('/wordpress/','wp',$mydirname) . '_'); 
Note: See TracChangeset for help on using the changeset viewer.