Changeset 352
- Timestamp:
- Jul 28, 2009, 6:10:49 PM (15 years ago)
- Location:
- trunk/xpressme_integration_kit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/include/oninstall.php
r345 r352 111 111 dbDelta($views_queries); 112 112 $ret[] = "$group_role table of XPressME was made."; 113 114 $notify_reserve = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_notify_reserve' ; 115 $queries ="CREATE TABLE $notify_reserve ( 116 notify_reserve_id bigint(20) NOT NULL AUTO_INCREMENT , 117 notify_reserve_status varchar(20) NOT NULL default '' , 118 category text NOT NULL default '', 119 item_id bigint(20) unsigned NOT NULL default '0', 120 event varchar(20) NOT NULL default '', 121 extra_tags_arry longtext NOT NULL default '' , 122 user_list_arry longtext NOT NULL default '' , 123 module_id smallint(5) unsigned NOT NULL default '0' , 124 omit_user_id varchar(20) NOT NULL default '' , 125 KEY notify_reserve_id (notify_reserve_id) 126 )TYPE=MyISAM"; 127 dbDelta($queries); 128 $ret[] = "$notify_reserve table of XPressME was made."; 113 129 114 130 $sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')"; -
trunk/xpressme_integration_kit/include/onupdate.php
r345 r352 205 205 } 206 206 207 if (! enhanced_table_check($mydirname,'notify_reserve')){ 208 $notify_reserve = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_notify_reserve' ; 209 $queries ="CREATE TABLE $notify_reserve ( 210 notify_reserve_id bigint(20) NOT NULL AUTO_INCREMENT , 211 notify_reserve_status varchar(20) NOT NULL default '' , 212 category text NOT NULL default '', 213 item_id bigint(20) unsigned NOT NULL default '0', 214 event varchar(20) NOT NULL default '', 215 extra_tags_arry longtext NOT NULL default '' , 216 user_list_arry longtext NOT NULL default '' , 217 module_id smallint(5) unsigned NOT NULL default '0' , 218 omit_user_id varchar(20) NOT NULL default '' , 219 KEY notify_reserve_id (notify_reserve_id) 220 )TYPE=MyISAM"; 221 $db->queryF( $queries ) ; 222 $msgs[] = "$notify_reserve table of XPressME was made."; 223 } 207 224 return $msgs; 208 225 } -
trunk/xpressme_integration_kit/include/xpress_debug_log.php
r96 r352 1 1 <?php 2 3 // define('XPRESS_EVENT_DEBUG',1); 4 2 5 if (!function_exists('xpress_debug')) { 3 6 function xpress_debug($title = '',$ditail_show = false) -
trunk/xpressme_integration_kit/wp-config.php
r294 r352 95 95 require_once( ABSPATH .'/include/request_url.php'); 96 96 if (is_xpress_index_page_call()){ 97 //When notifying by a private message, 98 //it is evaded that the data base becomes read-only as a result of the check on the referrer and the method. 99 $_SERVER['REQUEST_METHOD'] = 'POST'; 100 97 101 require_once $xoops_config->xoops_mainfile_path; //It is necessary to execute it for the user attestation before wp-settings.php. 102 98 103 require_once(ABSPATH.'wp-settings.php'); 99 104 if (!is_object($xoopsUser)){ // before login auth cookie clear … … 110 115 $err_str = "The activation of the XPressME plugin was executed.<br />\n"; 111 116 $err_str .= "Because the XPressME plugin was invalid.<br />\n"; 112 $err_str .= "Please do the rereading seeing on the page.\n"; 117 $err_str .= "Please do the rereading seeing on the page.\n"; 113 118 die($err_str); 114 119 } 115 120 121 Notification_reserve_send(); 116 122 ob_start(); 117 123 if($xoops_config->is_wp20 ) -
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php
r347 r352 40 40 //When notifying by a private message, 41 41 //it is evaded that the data base becomes read-only as a result of the check on the referrer and the method. 42 if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'call $notification_handler->triggerEvent'); 42 43 if (is_wp_cron_page_call() ){ 43 44 $_SERVER['HTTP_REFERER'] = 'http://'. $_SERVER[HTTP_HOST] . $_SERVER['PHP_SELF']; 44 45 $_SERVER['REQUEST_METHOD'] = 'POST'; 46 if (function_exists('xpress_debug')) xpress_debug($title = 'wp_cron_page_call',true); 45 47 } 46 48 if (is_xmlrpc_call() ){ … … 49 51 } 50 52 // set_error_handler("xpress_error_handler"); 51 if ($xoops_config->is_impress != true){ // impress cms is error52 if ( !defined("XOOPS_MAINFILE_INCLUDED")) {53 require_once $xoops_config->xoops_mainfile_path; // load XOOPS System54 }55 }53 // if ($xoops_config->is_impress != true){ // impress cms is error 54 // if ( !defined("XOOPS_MAINFILE_INCLUDED")) { 55 // require_once $xoops_config->xoops_mainfile_path; // load XOOPS System 56 // } 57 // } 56 58 if ( defined("XOOPS_MAINFILE_INCLUDED")) { 59 if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'call $notification_handler->triggerEvent'); 57 60 $module_id = get_xpress_modid() ; 58 61 $notification_handler =& xoops_gethandler( 'notification' ) ; 59 62 $notification_handler->triggerEvent($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id); 63 } else { 64 if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'not call $notification_handler->triggerEvent'); 65 $module_id = get_xpress_modid() ; 66 Notification_reserve($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id); 60 67 } 61 68 } … … 177 184 default : 178 185 } 179 } 186 } 187 188 //When the event cannot notify because the XOOPS system is not loaded, the event is stacked. 189 function Notification_reserve($category, $item_id=0, $event, $extra_tags=array(), $user_list=array(), $module_id=0, $omit_user_id=null) 190 { 191 global $xpress_config,$xoops_db; 192 193 $xpress_prefix = get_wp_prefix(); 194 $notfiy_reserve = $xpress_prefix . 'notify_reserve'; 195 196 $extra_tags_arry = addslashes(serialize($extra_tags)); 197 $user_list_arry = addslashes(serialize($user_list)); 198 // $extra_tags_arry = mysql_real_escape_string(serialize($extra_tags)); 199 // $user_list_arry = mysql_real_escape_string(serialize($user_list)); 200 201 $notify_reserve_status = 'reserve'; 202 203 $sql = "INSERT INTO $notfiy_reserve "; 204 $sql .= "(notify_reserve_status , category , item_id , event , extra_tags_arry , user_list_arry , module_id , omit_user_id)"; 205 $sql .= "VALUES "; 206 $sql .= "('$notify_reserve_status' , '$category' , $item_id , '$event' , '$extra_tags_arry' , '$user_list_arry' , $module_id , '$omit_user_id')"; 207 if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = $sql); 208 209 $xoops_db->query($sql); 210 } 211 212 //It calls when the XOOPS system is loaded, and the stacked event notification processing is done. 213 function Notification_reserve_send() 214 { 215 global $xpress_config,$xoops_db; 216 if ( ! defined("XOOPS_MAINFILE_INCLUDED")) return; 217 218 $notification_handler =& xoops_gethandler( 'notification' ) ; 219 220 $xpress_prefix = get_wp_prefix(); 221 $notfiy_reserve_db = $xpress_prefix . 'notify_reserve'; 222 223 $extra_tags_arry = addslashes(serialize($extra_tags)); 224 $user_list_arry = addslashes(serialize($user_list)); 225 226 $sql = "SELECT * "; 227 $sql .= "FROM $notfiy_reserve_db "; 228 $sql .= "WHERE notify_reserve_status = 'reserve'"; 229 230 $notify_reserves = $xoops_db->get_results($sql); 231 232 //So as not to process it by other sessions while processing it, status is changed. 233 foreach($notify_reserves as $notify){ 234 $notify_reserve_id = $notify->notify_reserve_id; 235 $sql = "UPDATE $notfiy_reserve_db SET notify_reserve_status = 'sending' WHERE notify_reserve_id = $notify_reserve_id"; 236 $xoops_db->query($sql); 237 } 238 239 foreach($notify_reserves as $notify){ 240 $notify_reserve_id = $notify->notify_reserve_id; 241 $category = $notify->category; 242 $item_id = $notify->item_id; 243 $event = $notify->event; 244 $extra_tags = unserialize($notify->extra_tags_arry); 245 $user_list = unserialize($notify->user_list_arry); 246 $module_id = $notify->module_id; 247 $omit_user_id = $notify->omit_user_id; 248 $notification_handler->triggerEvent($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id); 249 $sql = "DELETE FROM $notfiy_reserve_db WHERE notify_reserve_id = $notify_reserve_id"; 250 $xoops_db->query($sql); 251 } 252 } 180 253 181 254 ?>
Note: See TracChangeset
for help on using the changeset viewer.