diff --git a/modules/comment/comment.module b/modules/comment/comment.module index b279ef3241c..2a83aced006 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2258,6 +2258,7 @@ function template_preprocess_comment(&$variables) { $variables['title'] = l($comment->subject, $uri['path'], $uri['options']); $variables['permalink'] = l(t('Permalink'), $uri['path'], $uri['options']); + $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['author'], '!datetime' => $variables['created'])); // Preprocess fields. field_attach_preprocess('comment', $comment, $variables['elements'], $variables); diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php index 314da57ca4e..adf93b31cc6 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -19,6 +19,8 @@ * desired parameters on the $comment->changed variable. * - $new: New comment marker. * - $permalink: Comment permalink. + * - $submitted: Submission information created from $author and $created during + * template_preprocess_comment(). * - $picture: Authors picture. * - $signature: Authors signature. * - $status: Comment status. Possible values are: @@ -69,10 +71,7 @@
- $author, '!datetime' => $created)); - ?> +
> diff --git a/modules/node/node.module b/modules/node/node.module index d7cc85d83cb..47173cc045a 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1467,10 +1467,12 @@ function template_preprocess_node(&$variables) { // Display post information only on certain node types. if (variable_get('node_submitted_' . $node->type, TRUE)) { $variables['display_submitted'] = TRUE; + $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date'])); $variables['user_picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', array('account' => $node)) : ''; } else { $variables['display_submitted'] = FALSE; + $variables['submitted'] = ''; $variables['user_picture'] = ''; } diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php index 952f20a9d33..26128960d98 100644 --- a/modules/node/node.tpl.php +++ b/modules/node/node.tpl.php @@ -16,7 +16,9 @@ * calling format_date() with the desired parameters on the $created variable. * - $name: Themed username of node author output from theme_username(). * - $node_url: Direct url of the current node. - * - $display_submitted: whether submission information should be displayed. + * - $display_submitted: Whether submission information should be displayed. + * - $submitted: Submission information created from $name and $date during + * template_preprocess_node(). * - $classes: String of classes that can be used to style contextually through * CSS. It can be manipulated through the variable $classes_array from * preprocess functions. The default values can be one or more of the @@ -89,10 +91,7 @@
- $name, '!datetime' => $date)); - ?> +
diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index a8d62fe2229..07c03b37b94 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -499,10 +499,16 @@ function rdf_preprocess_node(&$variables) { if (!empty($variables['rdf_mapping']['created'])) { $date_attributes_array = rdf_rdfa_attributes($variables['rdf_mapping']['created'], $variables['created']); $variables['rdf_template_variable_attributes_array']['date'] = $date_attributes_array; + if ($variables['submitted']) { + $variables['rdf_template_variable_attributes_array']['submitted'] = $date_attributes_array; + } } // Adds RDFa markup for the relation between the node and its author. if (!empty($variables['rdf_mapping']['uid'])) { $variables['rdf_template_variable_attributes_array']['name']['rel'] = $variables['rdf_mapping']['uid']['predicates']; + if ($variables['submitted']) { + $variables['rdf_template_variable_attributes_array']['submitted']['rel'] = $variables['rdf_mapping']['uid']['predicates']; + } } // Adds RDFa markup annotating the number of comments a node has. @@ -679,10 +685,12 @@ function rdf_preprocess_comment(&$variables) { // cached as part of the entity. $date_attributes_array = $comment->rdf_data['date']; $variables['rdf_template_variable_attributes_array']['created'] = $date_attributes_array; + $variables['rdf_template_variable_attributes_array']['submitted'] = $date_attributes_array; } // Adds RDFa markup for the relation between the comment and its author. if (!empty($comment->rdf_mapping['uid'])) { $variables['rdf_template_variable_attributes_array']['author']['rel'] = $comment->rdf_mapping['uid']['predicates']; + $variables['rdf_template_variable_attributes_array']['submitted']['rel'] = $comment->rdf_mapping['uid']['predicates']; } if (!empty($comment->rdf_mapping['title'])) { // Adds RDFa markup to the subject of the comment. Because the RDFa markup diff --git a/themes/bartik/template.php b/themes/bartik/template.php index e94782527f3..a3393a4261f 100644 --- a/themes/bartik/template.php +++ b/themes/bartik/template.php @@ -102,6 +102,13 @@ function bartik_process_maintenance_page(&$variables) { } } +/** + * Override or insert variables into the node template. + */ +function bartik_preprocess_node(&$variables) { + $variables['submitted'] = t('published by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date'])); +} + /** * Override or insert variables into the block template. */ diff --git a/themes/bartik/templates/comment.tpl.php b/themes/bartik/templates/comment.tpl.php index 463b3ba8738..d83f178baae 100644 --- a/themes/bartik/templates/comment.tpl.php +++ b/themes/bartik/templates/comment.tpl.php @@ -19,6 +19,8 @@ * desired parameters on the $comment->changed variable. * - $new: New comment marker. * - $permalink: Comment permalink. + * - $submitted: Submission information created from $author and $created during + * template_preprocess_comment(). * - $picture: Authors picture. * - $signature: Authors signature. * - $status: Comment status. Possible values are: diff --git a/themes/bartik/templates/node.tpl.php b/themes/bartik/templates/node.tpl.php index e3ada69db5c..7b8377d0440 100644 --- a/themes/bartik/templates/node.tpl.php +++ b/themes/bartik/templates/node.tpl.php @@ -16,7 +16,9 @@ * calling format_date() with the desired parameters on the $created variable. * - $name: Themed username of node author output from theme_username(). * - $node_url: Direct url of the current node. - * - $display_submitted: whether submission information should be displayed. + * - $display_submitted: Whether submission information should be displayed. + * - $submitted: Submission information created from $name and $date during + * template_preprocess_node(). * - $classes: String of classes that can be used to style contextually through * CSS. It can be manipulated through the variable $classes_array from * preprocess functions. The default values can be one or more of the @@ -90,10 +92,7 @@
- $name, '!datetime' => $date)); - ?> +
diff --git a/themes/garland/comment.tpl.php b/themes/garland/comment.tpl.php index b46c1edfc31..a11f4fce5e9 100644 --- a/themes/garland/comment.tpl.php +++ b/themes/garland/comment.tpl.php @@ -5,7 +5,7 @@
- + diff --git a/themes/garland/node.tpl.php b/themes/garland/node.tpl.php index 6a7ae448dd5..0d15d8c5870 100644 --- a/themes/garland/node.tpl.php +++ b/themes/garland/node.tpl.php @@ -12,7 +12,7 @@ - +
> diff --git a/themes/garland/template.php b/themes/garland/template.php index 8021d7cdd13..b9234c972b6 100644 --- a/themes/garland/template.php +++ b/themes/garland/template.php @@ -119,6 +119,20 @@ function garland_preprocess_page(&$vars) { $vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text; } +/** + * Override or insert variables into the node template. + */ +function garland_preprocess_node(&$vars) { + $vars['submitted'] = $vars['date'] . ' — ' . $vars['name']; +} + +/** + * Override or insert variables into the comment template. + */ +function garland_preprocess_comment(&$vars) { + $vars['submitted'] = $vars['created'] . ' — ' . $vars['author']; +} + /** * Override or insert variables into the block template. */