Joomla 2.5 – Display the creation date in the Articles Newsflash Module

The Articles Newsflash (mod_articles_news) module can be adapted to show the creation date of your latest articles.

In the following file there is variable (Array) named $item which handles all information we want to display, like date of creation, Title etc.

/modules/mod_articles_news/tmpl/_item.php

To display the creation date of every items you have to add this line of code to display creation date (format: dd/mm/yyyy).

Before

.....
<?php echo $item->beforeDisplayContent; ?>
.....

After

.....
<?php echo $item->beforeDisplayContent; ?>
.....
<?php echo "Pubbl. Date: ".substr($item->created,8,2)."/".substr($item->created,5,2)."/".substr($item->created,0,4);?>

Att: I’m not an expert in php code: I’m sure there exists a more elegant solution. Quick and dirty fix but it works !