You are here

function theme_shoutform_message in Heartbeat 6.4

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

Theme the latest shout of a user.

Parameters

$latest_shout the shout message:

$update is it an ajax update of the shout?:

1 call to theme_shoutform_message()
clear_shout in modules/shouts/shouts.module
Clear the latest shout from a user.
3 theme calls to theme_shoutform_message()
shouts_shout_form in modules/shouts/shouts.module
Show the shoutform
shouts_shout_form_submit in modules/shouts/shouts.module
User submitted the shoutform, save the shout.
shouts_user in modules/shouts/shouts.module
Implementation of hook_user().

File

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

Code

function theme_shoutform_message($latest_shout, $update, $time = '') {
  $shout_time = '';
  if ($time) {
    $ago = t('ago');
    $time_diff = $_SERVER['REQUEST_TIME'] - strtotime($time);

    // don't show minutes if less then 1 minute ago.
    if ($time_diff < 60) {
      $date = t('a moment');
    }
    else {
      $date = format_interval($time_diff, 1, 'nl');
    }
    $shout_time = '<span class="shout_ago">' . $date . ' ' . $ago . '</span>';
  }
  $latest_shout = '<div class="latest_shout">' . $latest_shout . '</div>';
  $output = '<div class="inner">' . $latest_shout . $shout_time . '</div>';
  if (!$update) {
    $output = '<div id="shout-wrapper">' . $output . '</div>';
  }
  return $output;
}