From: JohnAlbin Date: Sun, 1 Nov 2009 20:31:13 +0000 (+0000) Subject: Added $created to comment.tpl and deprecated $submitted. X-Git-Tag: 6.x-2.0-beta1~70 X-Git-Url: http://drupalcode.org/project/zen.git/commitdiff_plain/1be9a0c1cd43b736160930de80bfa731460818db Added $created to comment.tpl and deprecated $submitted. --- diff --git a/templates/comment.tpl.php b/templates/comment.tpl.php index ffe5ff6..a6e5d10 100644 --- a/templates/comment.tpl.php +++ b/templates/comment.tpl.php @@ -8,6 +8,9 @@ * Available variables: * - $author: Comment author. Can be link or plain text. * - $content: Body of the post. + * - $created: Formatted date and time for when the comment was created. + * Preprocess functions can reformat it by calling format_date() with the + * desired parameters on the $comment->timestamp variable. * - $new: New comment marker. * - $links: Various operational links. * - $picture: Authors picture. @@ -23,10 +26,10 @@ * - comment-by-anon: Comment by an unregistered user. * - comment-by-author: Comment by the author of the parent node. * - comment-preview: When previewing a new or edited comment. - * - odd + * - odd: * - even - * - first - * - last + * - first: + * - last: * The following applies only to viewers who are registered users: * - comment-mine: Comment by the user currently viewing the page. * - comment-published @@ -42,7 +45,7 @@ * into a string within the variable $classes. * * The following variables are deprecated in Drupal 7: - * - $date: Date and time of posting. + * - $date: Formatted date and time for when the comment was created. * - $submitted: By line with date and time. * * @see template_preprocess() @@ -72,7 +75,10 @@
- + $author, '!datetime' => $created)); + ?>
@@ -84,8 +90,6 @@
- - - + diff --git a/zen-internals/template.comment.inc b/zen-internals/template.comment.inc index d312078..15e991f 100644 --- a/zen-internals/template.comment.inc +++ b/zen-internals/template.comment.inc @@ -18,6 +18,9 @@ function _zen_preprocess_comment(&$vars, $hook) { // Add an "unpublished" flag. $vars['unpublished'] = ($vars['comment']->status == COMMENT_NOT_PUBLISHED); + // In Drupal 7, $date has been renamed to $created. + $vars['created'] = $vars['date']; + // If comment subjects are disabled, don't display them. if (variable_get('comment_subject_field_' . $vars['node']->type, 1) == 0) { $vars['title'] = '';