コード例 #1
0
 /**
  * Insert message into log
  *
  * @version 1.0
  * Copyright 2011 Andy Potanin, Usability Dynamics, Inc.  <*****@*****.**>
  */
 function insert_message($user_id, $message, $form_slug)
 {
     $insert_id = WP_CRM_F::insert_event("object_id={$user_id}&user_id={$user_id}&attribute=contact_form_message&text={$message}&value=new&other={$form_slug}");
     if ($insert_id) {
         return $insert_id;
     }
     return false;
 }
コード例 #2
0
ファイル: class_ajax.php プロジェクト: sekurtz1/wp-crm
 /**
  * Insert activity message
  */
 static function insert_activity_message()
 {
     die(WP_CRM_F::insert_event(array('time' => $_REQUEST["time"], 'attribute' => !empty($_REQUEST["message_type"]) ? $_REQUEST["message_type"] : "note", 'object_id' => $_REQUEST["user_id"], 'text' => $_REQUEST["content"], 'ajax' => 'true')));
 }
コード例 #3
0
ファイル: default_api.php プロジェクト: sekurtz1/wp-crm
 /**
  * Updated user activity stream.
  *
  * @todo $args argument should be modifiable to pass extra data - such as importance of message. - potanin@UD
  * @hooked_into WP_CRM_Core::admin_head();
  * @since 0.1
  */
 function wp_crm_add_to_user_log($user_id, $message, $time = false, $args = false)
 {
     $insert_data = wp_parse_args($args, array('object_id' => $user_id, 'attribute' => 'note', 'text' => $message));
     if ($time) {
         $insert_data['time'] = $time;
     }
     if (WP_CRM_F::insert_event($insert_data)) {
         return true;
     }
     return false;
 }
コード例 #4
0
 /**
  * Saves user data
  *
  * @hooked_into WP_CRM_Core::admin_head();
  * @since 0.1
  */
 function wp_crm_add_to_user_log($user_id, $message, $time = false)
 {
     $insert_data['object_id'] = $user_id;
     $insert_data['attribute'] = 'note';
     $insert_data['text'] = $message;
     if ($time) {
         $insert_data['time'] = $time;
     }
     if (WP_CRM_F::insert_event($insert_data)) {
         return true;
     }
     return false;
 }