You are here

function shouts_user in Heartbeat 6.3

Same name and namespace in other branches
  1. 6.4 modules/shouts/shouts.module \shouts_user()

Implementation of hook_user().

File

modules/shouts/shouts.module, line 185
Gives the possibility to the user to shout a message.

Code

function shouts_user($op, &$edit, &$account, $category = NULL) {
  global $user;
  switch ($op) {
    case 'load':
      $user->latest_shout = get_latest_shout($user->uid);
      break;
    case 'view':
      $latest_shout = get_latest_shout($account->uid);
      if (!$latest_shout->cleared) {
        if (!empty($latest_shout->message)) {
          $account->content['latest_shout'] = array(
            '#value' => theme('shoutform_message', $latest_shout->message, false, false, $latest_shout->time),
          );
        }
      }
      break;
  }
}