You are here

function comment_goodness_preprocess_comment in Comment goodness 7

Implements hook_preprocess_HOOK().

Provide template variables to change the comment created, changed and submitted by dates.

File

./comment_goodness.module, line 468
Comment goodness provides newest to oldest comment sorting

Code

function comment_goodness_preprocess_comment(&$variables) {
  $comment = $variables['elements']['#comment'];
  $variables['created'] = format_date($comment->created, variable_get('comment_created_date_format_' . $variables['node']->type, 'medium'));
  $variables['changed'] = format_date($comment->changed, variable_get('comment_changed_date_format_' . $variables['node']->type, 'medium'));
  $date_type = variable_get('comment_created_date_format_' . $variables['node']->type, 'medium');
  $submitted_string = _comment_goodness_get_submitted_string($date_type);
  $variables['submitted'] = t($submitted_string, array(
    '!username' => theme('username', array(
      'account' => $variables['author'],
    )),
    '!datetime' => $variables['created'],
  ));
}