You are here

function timeago_preprocess_comment in Timeago 6.2

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

Implementation of hook_preprocess_comment().

File

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

Code

function timeago_preprocess_comment(&$variables) {
  if (variable_get('timeago_comment', 1)) {
    $comment = $variables['comment'];
    $variables['date'] = timeago_format_date($comment->timestamp, $variables['date']);

    // We could override theme('comment_submitted'), but our override would get overridden by themes.
    $variables['submitted'] = t('Submitted by !username !datetime', array(
      '!username' => $variables['author'],
      '!datetime' => $variables['date'],
    ));
  }
}