Changeset 384
- Timestamp:
- Sep 12, 2009, 10:35:47 AM (15 years ago)
- Location:
- trunk/xpressme_integration_kit/include
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/include/oninstall.php
r352 r384 29 29 $root =& XCube_Root::getSingleton(); 30 30 $root->mDelegateManager->add( 'Legacy.Admin.Event.ModuleInstall.' . ucfirst($mydirname) . '.Success' , 'xpress_message_append_oninstall' ) ; 31 $root->mDelegateManager->add( 'Legacy.Admin.Event.ModuleInstall.' . ucfirst($mydirname) . '.Fail' , 'xpress_message_append_oninstall_err' ) ; 31 32 $ret = array() ; 32 33 } else { … … 36 37 $db =& Database::getInstance() ; 37 38 $mid = $module->getVar('mid') ; 39 40 if( defined( 'XOOPS_CUBE_LEGACY' ) ) { 41 $ret[] = "********************************* Install Log ********************************<br />"; 42 } else { 43 $ret[] = '<h4 style="border-bottom: 1px dashed rgb(0, 0, 0); text-align: left; margin-bottom: 0px;">Install Log</h4>'; 44 } 38 45 39 46 //xpress … … 47 54 $site_name = ucfirst($mydirname) . ' ' . _MI_XP2_NAME; 48 55 56 // permission and wordpress files check 57 require_once ($path . 'include/pre_check.php'); 58 if(! xp_permission_check($mydirname, $mydirpath)){ 59 if( ! defined( 'XOOPS_CUBE_LEGACY' ) ) { 60 $ret = $GLOBALS["err_log"]; 61 $ret[] = "<br /><span style=\"color:#ff0000;\">The uninstallation of the module is executed now. </span><br />"; 62 $ret[] = xoops_module_uninstall($mydirname); 63 } 64 return false; 65 } 66 49 67 // install WordPress 50 68 if (file_exists($path . 'wp-load.php')) { … … 56 74 wp_cache_flush(); 57 75 make_db_current_silent(); 58 $ret[] = "The data base of wordpress was made by prefix $table_prefix. ";76 $ret[] = "The data base of wordpress was made by prefix $table_prefix.<br />"; 59 77 60 78 $option_desc = __('WordPress web address'); … … 84 102 KEY post_id (post_id) 85 103 )$charset_collate;"; 86 87 104 dbDelta($views_queries); 88 $ret[] = "$views_table table of XPressME was made."; 89 105 $ret[] = "$views_table table of XPressME was made.<br />"; 90 106 91 107 $d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ; … … 97 113 )$charset_collate;"; 98 114 dbDelta($views_queries); 99 $ret[] = "$d3forum_link table of XPressME was made. ";115 $ret[] = "$d3forum_link table of XPressME was made.<br />"; 100 116 101 117 $group_role = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_group_role' ; … … 110 126 )$charset_collate;"; 111 127 dbDelta($views_queries); 112 $ret[] = "$group_role table of XPressME was made. ";128 $ret[] = "$group_role table of XPressME was made.<br />"; 113 129 114 130 $notify_reserve = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_notify_reserve' ; … … 126 142 )TYPE=MyISAM"; 127 143 dbDelta($queries); 128 $ret[] = "$notify_reserve table of XPressME was made. ";144 $ret[] = "$notify_reserve table of XPressME was made.<br />"; 129 145 130 146 $sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')"; … … 163 179 $sql = "UPDATE $wpdb->users SET user_pass ='$pass_md5' WHERE ID = $user_id"; 164 180 $wpdb->query($sql); 165 $ret[] = 'The password of XOOPS was copied. ';181 $ret[] = 'The password of XOOPS was copied.<br />'; 166 182 167 183 … … 175 191 } 176 192 177 $ret[] = 'The first sample post & comment was written. ';193 $ret[] = 'The first sample post & comment was written.<br />'; 178 194 179 195 // Rewrite Option for Xpress … … 195 211 update_option("what_to_show", "posts"); 196 212 update_option('default_pingback_flag', 0); 197 $ret[] = 'The initial data was written in the data base of wordpress. ';213 $ret[] = 'The initial data was written in the data base of wordpress.<br />'; 198 214 199 215 update_option("template", "xpress_default"); 200 216 update_option("stylesheet", "xpress_default"); 201 $ret[] = 'The default theme of wordpress was set to xpress_default. ';217 $ret[] = 'The default theme of wordpress was set to xpress_default.<br />'; 202 218 // update_option('uploads_use_yearmonth_folders', 1); 203 219 update_option('upload_path', 'wp-content/uploads'); … … 220 236 require_once dirname( __FILE__ ).'/xpress_active_plugin.php'; 221 237 if (xpress_pulugin_activation('xpressme/xpressme.php')){ 222 $ret[] = 'The xpressme plug-in was activated.'; 238 $ret[] = 'The xpressme plug-in was activated.<br />'; 239 } else { 240 $GLOBALS["err_log"][] = '<span style="color:#ff0000;">failed in the activation of xpressme plug-in.</span><br />'; 241 return false; 223 242 } 224 243 … … 241 260 } 242 261 endif; 262 263 if( ! function_exists( 'xpress_message_append_oninstall_err' ) ) : 264 function xpress_message_append_oninstall_err( &$module_obj , &$log ) 265 { 266 if( is_array( @$GLOBALS["err_log"] ) ) { 267 foreach( $GLOBALS["err_log"] as $message ) { 268 $log->add( strip_tags($message)) ; 269 } 270 } 271 272 // use mLog->addWarning() or mLog->addError() if necessary 273 } 274 endif; 275 243 276 244 277 if( ! function_exists( 'wp_install_old_defaults' ) ) : … … 274 307 } 275 308 endif; 276 277 309 ?> -
trunk/xpressme_integration_kit/include/onupdate.php
r352 r384 15 15 $root =& XCube_Root::getSingleton(); 16 16 $root->mDelegateManager->add( 'Legacy.Admin.Event.ModuleUpdate.' . ucfirst($mydirname) . '.Success', 'xpress_message_append_onupdate' ) ; 17 $root->mDelegateManager->add( 'Legacy.Admin.Event.ModuleUpdate.' . ucfirst($mydirname) . '.Fail', 'xpress_message_append_onupdate' ) ; 17 18 $msgs = array() ; 18 19 } else { … … 22 23 $db =& Database::getInstance() ; 23 24 $mid = $module->getVar('mid') ; 25 26 24 27 25 28 //XPressME Update … … 28 31 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 29 32 $path = $mydirpath . '/'; 30 33 34 // permission and wordpress files check 35 require_once ($path . 'include/pre_check.php'); 36 if(! xp_permission_check($mydirname, $mydirpath)){ 37 $msgs = $GLOBALS["err_log"]; 38 return false; 39 } 40 31 41 //Site_url and home of an optional table are repaired. 32 42 $site_url= XOOPS_URL."/modules/".$mydirname; -
trunk/xpressme_integration_kit/include/xpress_templates_make.php
r137 r384 22 22 $rcd = copy($file_path, $target_file_path); 23 23 if ($rcd){ 24 $msgs[] = 'Template <b>'.htmlspecialchars($target_file_path).'</b> copy from ' . htmlspecialchars($file) ;24 $msgs[] = 'Template <b>'.htmlspecialchars($target_file_path).'</b> copy from ' . htmlspecialchars($file) . '<br />'; 25 25 } else { 26 $msgs[] = '<span style="color:#ff0000;">ERROR: Could not copy template <b>'.htmlspecialchars($target_file_name).'</b> from ' . htmlspecialchars($file). '(check templates directory permision (777))</span> ';26 $msgs[] = '<span style="color:#ff0000;">ERROR: Could not copy template <b>'.htmlspecialchars($target_file_name).'</b> from ' . htmlspecialchars($file). '(check templates directory permision (777))</span><br />'; 27 27 } 28 28 $tplfile =& $tplfile_handler->create() ;
Note: See TracChangeset
for help on using the changeset viewer.