You are here

function timeago_preprocess_comment in Timeago 7.2

Same name and namespace in other branches
  1. 6.2 timeago.module \timeago_preprocess_comment()

Implements hook_preprocess_comment().

File

./timeago.module, line 336
Adds support for the Timeago jQuery library.

Code

function timeago_preprocess_comment(&$variables) {
  if (variable_get('timeago_comment', 1)) {
    $comment = $variables['comment'];
    $variables['created'] = timeago_format_date($comment->created, $variables['created']);
    $variables['changed'] = timeago_format_date($comment->changed, $variables['changed']);
    $variables['submitted'] = t('Submitted by !username !datetime', array(
      '!username' => $variables['author'],
      '!datetime' => $variables['created'],
    ));
  }
}