You are here

function messaging_simple_get_messages in Messaging 6.3

Same name and namespace in other branches
  1. 6.4 messaging_simple/messaging_simple.module \messaging_simple_get_messages()
  2. 7 messaging_simple/messaging_simple.module \messaging_simple_get_messages()

Get messages for user

2 calls to messaging_simple_get_messages()
Messaging_API_Tests::testMessagingSendingAPI in tests/messaging_api.test
Play with creating, retrieving, deleting a pair messages
messaging_simple_user_overview in messaging_simple/messaging_simple.module
Display message overview list

File

messaging_simple/messaging_simple.module, line 87
Simple messaging using html page. Messaging method plug-in

Code

function messaging_simple_get_messages($uid, $pager = MESSAGING_SIMPLE_PAGER) {
  $messages = array();
  if ($pager) {
    $result = pager_query("SELECT * FROM {messaging_simple} WHERE uid = " . (int) $uid . " ORDER BY sent DESC", $pager);
  }
  else {
    $result = db_query("SELECT * FROM {messaging_simple} WHERE uid = %d ORDER BY sent DESC", $uid);
  }
  while ($message = db_fetch_object($result)) {
    $messages[] = $message;
  }
  return $messages;
}