This is a simple usability patch that normalizes the "Submitted by USERNAME on DATE_TIME" instead of having it hard coded in theme.inc.
Garland already works around this by calling the appropriate pieces in node.tpl.php and comment.tpl.php, but that is hackish. The $submitted variable is processed and then its content ignored.
This patch makes $submitted themeable by creating two functions, one in node. module and the other in comment.module. Then template.php can be used for overriding them if the need arises.
Garland stays the same visually, but uses the $submitted variables, the way it should.
Comments
Comment #1
mlsamuelson commentedI tested the patch on HEAD and after clearing the cache, the theme changes took effect without a problem.
I tested overriding both node $submitted and comment $submitted for Garland (which the patch had applied, actually) as well as applying overrides on both the Bluemarine and Pushbutton themes. Worked like a charm.
I'm excited to see this patch. Only sorry I hadn't come across it earlier.
mlsamuelson
Comment #2
kbahey commentedHere is another issue that is a use case for this patch: Add the last updated time in the "Submitted" info.
http://drupal.org/node/51287
Comment #3
gábor hojtsySeemed to be a very logical improvement, but:
$ patch -p0 < submitted_1.patch
patching file themes/garland/template.php
patching file themes/garland/node.tpl.php
patching file themes/garland/comment.tpl.php
patching file includes/theme.inc
Hunk #1 succeeded at 1609 (offset 23 lines).
Hunk #2 succeeded at 1637 (offset 23 lines).
patching file modules/comment/comment.module
Hunk #1 succeeded at 184 (offset -1 lines).
Hunk #2 succeeded at 1856 with fuzz 2 (offset 15 lines).
Hunk #3 succeeded at 1918 (offset 16 lines).
patching file modules/node/node.module
Hunk #1 succeeded at 84 (offset 10 lines).
Hunk #2 FAILED at 3107.
1 out of 2 hunks FAILED -- saving rejects to file modules/node/node.module.rej
Comment #4
kbahey commentedHere is an updated patch.
Comment #5
gábor hojtsyGreat, thanks for the patch. Comitted!
Comment #6
gábor hojtsyBTW this should be documented in the theme update guide.
Comment #7
kbahey commentedDone
Comment #8
(not verified) commentedComment #9
Anonymous (not verified) commentedThemable by theme_node_submitted and theme_comment_submitted. Thanks everyone!
Here is the link to the Drupal6 API pages:
http://api.drupal.org/api/function/theme_node_submitted/6
http://api.drupal.org/api/function/theme_comment_submitted/6