Hi

I have noticed that some websites display their article submission dates in a stylish graphical format alongside the article titles. Is there a module (or some hack) to implement this in Drupal (6.x). Here are a couple of examples of this feature: http://11heavens.com/ and http://www.mesmerlab.com/heres-a-quick-way-to-add-a-custom-date-graphic-...

Cheers

Comments

jix_’s picture

It’s something you’d have to do in your theme.

In template.php:

<?php
function phptemplate_node_submitted($node) {
  return t('!datetime — !username', array(
      '!username' => theme('username', $node),
      '!datetime' => '<span class="day">' . format_date($node->created, 'custom', 'j') . '</span>' .
        '<span class="month">' . format_date($node->created, 'custom', 'M') . '</span>' .
        '<span class="year">' . format_date($node->created, 'custom', 'Y') . '</span>',
    )
  );
}
?>

Then, in your stylesheet, you could do anything you want with .node .submitted .day, etc. to make it as stylish as you wish :)

chillz’s picture

Ah ha, thanks for responding and the useful information mverbeer. I really appreciated it :).

Cheers

jix_’s picture

You’re welcome!

chillz’s picture

Oops I just noticed that I spelt your username incorrectly so accept my apologies, that should have been mverbaar instead of "mverbeer" :).

Thanks once again

jix_’s picture

hehe ;)