You are here

function timeago_process_node in Timeago 7.2

Implements hook_process_node().

We have to use process instead of preprocess because some themes (notably bartik) override $variables['submitted'] in their preprocess implementations which can result in something like "published by admin on 10 minutes ago."

File

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

Code

function timeago_process_node(&$variables) {
  if (variable_get('timeago_node', 1)) {
    $node = $variables['node'];
    $variables['date'] = timeago_format_date($node->created, $variables['date']);
    if (variable_get('node_submitted_' . $node->type, TRUE)) {
      $variables['submitted'] = t('Submitted by !username !datetime', array(
        '!username' => $variables['name'],
        '!datetime' => $variables['date'],
      ));
    }
  }
}