/**
  * 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;
 }
Exemple #2
0
 /**
  * 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')));
 }
Exemple #3
0
 /**
  * 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;
 }
 /**
  * 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;
 }