XPressME Integration Kit

Trac


Ignore:
Timestamp:
Mar 6, 2009, 5:16:22 PM (15 years ago)
Author:
toemon
Message:

途中経過でインストール、アップデートできなくなってしまっていたバグ修正
イベント通知の部分をFix、(ゲストのモジュールアクセス権限がないと通知できないのは直らない)
ブロックのキャッシュを見直し、キャッシュがない場合と、ブロックオプションが変更された場合にリフレッシュする機能を追加
ブロックキャッシュの更新にてポスト削除時のイベントをDB削除前にとっていたバグを修正。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/oninstall.php

    r89 r96  
    5151        wp_cache_flush(); 
    5252        make_db_current_silent(); 
     53        $ret[] = "The data base of wordpress was made by prefix $table_prefix."; 
    5354         
    5455        $option_desc = __('WordPress web address'); 
     
    6768        update_option("home", $site_url); 
    6869        update_option("siteurl", $site_url); 
     70        update_option("what_to_show", "posts"); 
     71        update_option('default_pingback_flag', 0); 
     72        $ret[] = 'The initial data was written in the data base of wordpress.'; 
     73         
    6974        update_option("template", "xpress_default"); 
    7075        update_option("stylesheet", "xpress_default"); 
    71         update_option("what_to_show", "posts"); 
    72  
     76        $ret[] = 'The default theme of wordpress was set to xpress_default.'; 
    7377        /* add new option for uploads */ 
    7478//      update_option('uploads_use_yearmonth_folders', 1); 
    7579//      update_option('upload_path', $module->getVar("dirname")); 
    7680         
     81                 
     82// Admin User Data write 
     83        // Change uid field 
     84        $wpdb->query("ALTER TABLE $wpdb->posts CHANGE `post_author` `post_author` mediumint(8) NOT NULL DEFAULT '0'"); 
     85        $user_name = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("uname"):'admin'; 
     86        $email = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("email"):'foo@exsample.com'; 
     87        $pass_md5 = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("pass"):''; 
     88         
     89        $user_id = username_exists($user_name); 
     90        if ( !$user_id ) { 
     91                $random_password = 'admin'; 
     92                $user_id = wp_create_user($user_name, $random_password, $email); 
     93        } else { 
     94                $random_password = __('User already exists.  Password inherited.'); 
     95        } 
     96 
     97        $user = new WP_User($user_id); 
     98        $user->set_role('administrator'); 
     99        'User ' . $user_name . ' of the administrator was made.'; 
     100        // over write xoops md5 password  
     101        $sql = "UPDATE $wpdb->users SET user_pass ='$pass_md5' WHERE ID = $user_id"; 
     102        $wpdb->query($sql); 
     103        $ret[] = 'The password of XOOPS was copied.'; 
     104        // Set Default data 
     105        wp_install_defaults($user_id); 
     106        $ret[] = 'The first sample post & comment was written.'; 
     107//          generate_page_uri_index(); 
     108 
    77109        /* activate the XPressME plugin */ 
    78110        $plugin_current = "xpressme/xpressme.php"; 
     
    80112        include_once(dirname(__FILE__) . '/../wp-content/plugins/'.$plugin_current); 
    81113        do_action('activate_'.$plugin_current); 
    82                  
    83 // Admin User Data write 
    84         // Change uid field 
    85         $wpdb->query("ALTER TABLE $wpdb->posts CHANGE `post_author` `post_author` mediumint(8) NOT NULL DEFAULT '0'"); 
    86         $ID = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("uid"):1; 
    87 //      require_once($mydirpath . '/include/user_sync.php'); 
    88         $sync_messg = ''; 
    89 //      user_sync_to_wordpress($ID,$sync_messg);                //this function in XPressME plugin  
    90  
    91         // Set Default data 
    92                 wp_install_defaults($ID); 
    93 //          generate_page_uri_index(); 
    94  
    95                  
     114        $ret[] = 'The xpressme plug-in was activated.'; 
     115         
    96116        // create views table 
    97117        $xp_prefix = $mydirname; 
     
    115135 
    116136        dbDelta($views_queries); 
     137        $ret[] = "$views_table table of XPressME was made."; 
     138 
    117139         
    118140        $d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ; 
     
    124146                )$charset_collate;"; 
    125147        dbDelta($views_queries); 
     148        $ret[] = "$d3forum_link table of XPressME was made."; 
    126149         
    127150        $group_role = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_group_role' ; 
     
    136159                )$charset_collate;"; 
    137160        dbDelta($views_queries); 
     161        $ret[] = "$group_role table of XPressME was made."; 
     162 
    138163        $sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')"; 
    139164        $wpdb->query($sql); 
Note: See TracChangeset for help on using the changeset viewer.