Solved

How to add "Last updated on xx/xx/xx" in Joomla

Posted on 2009-05-15
10
424 Views
Last Modified: 2013-12-12
I need to add a site-wide "last updated on xx/xx/xx", meaning that if any pages would have been edited or added, the PHP script would display the most recent article. Is this possible? Yes or no? If yes, then how?
0
Comment
Question by:mpaert
  • 2
  • 2
  • 2
  • +2
10 Comments
 
LVL 3

Expert Comment

by:markh789
ID: 24400822
You want to check when a file was last edited?

<?php
// if windows use C:/path/to/the/file.php
$get_file_time = filectime("/full/path/to/the/file.php");
$formateddate = date("F j, Y", $s);
echo("Las Updated on " . $formateddate);
?

Open in new window

0
 

Author Comment

by:mpaert
ID: 24401737
Dear Markh,

Thank you, but I'm not looking for file date, but last change date of a MySQL database.
0
 

Expert Comment

by:adamjimenez
ID: 24402055
in that case you need to add a timestamp field to your database.

then select the most recent timestamp:

"select timestamp from table order by timestamp" - where timestamp is the name of your timestamp column.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 4

Expert Comment

by:manavsi
ID: 24402225
try lookin in this thread... may be it will help you...
Link: http://forum.joomla.org/viewtopic.php?t=28343

HTH
manavsi
0
 
LVL 11

Accepted Solution

by:
j-b-t earned 500 total points
ID: 24409987
If are you just wanting to show
"last updated on    xxx" - actually by default "last modified on" will show  -
on every page - go to yoursite.com/administrator/content (along top)
click article manager in drop down
in article manager clilick parameters (top right)
in parameters select "show" on Modified Date and Time - click save top right

This sets the default for all articles - within each article you also have the choice to manually set these parameters
0
 

Author Comment

by:mpaert
ID: 24410018
Hi jbt,

Thank you, I am aware of this function. What I want is a PHP script that looks at all "Last modivied" dates on the database from specific categories. I want to display on the homepage, when the site was last modified.
0
 
LVL 11

Assisted Solution

by:j-b-t
j-b-t earned 500 total points
ID: 24410500
OK - then you just need a module to display last date anything modified - so why not just modify  the newsflash or latest news module to do this
0
 
LVL 3

Expert Comment

by:markh789
ID: 24646385
j-b-t's method works.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question