- Timestamp:
- Jul 28, 2009, 6:10:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.