summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2009-11-02 15:19:28 +0000
committerJohnAlbin2009-11-02 15:19:28 +0000
commit911d51305c870863d189b3a415d87381a129a01f (patch)
treea06f7e63830c9777434f30119b42473b4932fd38
parent658bff742c724a1f327fcdd2cbcec8ce35dff32a (diff)
Added $display_submitted variable and deprecated $submitted variable to node.tpl.php.
-rw-r--r--template.php3
-rw-r--r--templates/node.tpl.php16
2 files changed, 14 insertions, 5 deletions
diff --git a/template.php b/template.php
index 55e64c2..f192abc 100644
--- a/template.php
+++ b/template.php
@@ -265,6 +265,9 @@ function zen_preprocess_node(&$vars, $hook) {
// Create the user_picture variable.
$vars['user_picture'] = $vars['picture'];
+ // Create the Drupal 7 $display_submitted variable.
+ $vars['display_submitted'] = theme_get_setting('toggle_node_info_' . $vars['node']->type);
+
// Special classes for nodes.
// Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc.
$vars['classes_array'][] = zen_id_safe('node-type-' . $vars['type']);
diff --git a/templates/node.tpl.php b/templates/node.tpl.php
index e90dee7..c6231b8 100644
--- a/templates/node.tpl.php
+++ b/templates/node.tpl.php
@@ -14,6 +14,7 @@
* - $name: Themed username of node author output from theme_username().
* - $node_url: Direct url of the current node.
* - $terms: the themed list of taxonomy term links output from theme_links().
+ * - $display_submitted: whether submission information should be displayed.
* - $links: Themed links like "Read more", "Add new comment", etc. output
* from theme_links().
* - $classes: String of classes that can be used to style contextually through
@@ -60,7 +61,7 @@
*
* The following variables are deprecated in Drupal 7:
* - $picture: This variable has been renamed $user_picture in Drupal 7.
- * - $submitted: themed submission information output from
+ * - $submitted: Themed submission information output from
* theme_node_submitted().
*
* @see template_preprocess()
@@ -70,7 +71,7 @@
* @see zen_process()
*/
?>
-<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>">
+<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix">
<?php print $user_picture; ?>
@@ -82,10 +83,15 @@
<div class="unpublished"><?php print t('Unpublished'); ?></div>
<?php endif; ?>
- <?php if ($submitted || $terms): ?>
+ <?php if ($display_submitted || $terms): ?>
<div class="meta">
- <?php if ($submitted): ?>
- <span class="submitted"><?php print $submitted; ?></span>
+ <?php if ($display_submitted): ?>
+ <span class="submitted">
+ <?php
+ print t('Submitted by !username on !datetime',
+ array('!username' => $name, '!datetime' => $date));
+ ?>
+ </span>
<?php endif; ?>
<?php if ($terms): ?>