You are here

function shouts_user in Heartbeat 6.4

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

Implementation of hook_user().

File

modules/shouts/shouts.module, line 77
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':
      if ($user->uid > 0) {
        $user->latest_shout = get_latest_shout($user->uid);
      }
      break;
    case 'view':
      $latest_shout = get_latest_shout($account->uid);
      if (!empty($latest_shout->message)) {
        $account->content['shouts'] = array(
          '#type' => 'user_profile_category',
          '#title' => t('Lastest shout'),
          '#attributes' => array(
            'class' => 'shouts-profile',
          ),
          '#weight' => 1,
          'latest_shout' => array(
            '#type' => 'user_profile_item',
            '#value' => theme('shoutform_message', $latest_shout->message, false, false, $latest_shout->time),
          ),
        );
      }
      break;
  }
}