XMB Forum Software

[Resolved] edited-by - adding timestamp

solbu - 12-28-2012 at 05:47 AM

Full Board URL: http://www.kristshell.net/
XMB Version: 1.9.11

When a user edit a post, there is a statement added to the post by the forum, if enabled, saying it was edited, and what date it was edited. For some time now, I've wanted to add a timestamp to the statement that a post was edited, and not just the date.
(I.e. [Edited on 28-12-2012 at 06:45 by username])

How do we do that?
I think we need to change post.php, but not what we need to change.

Mouser - 1-6-2013 at 10:37 PM

Place note, I have not tested this, but... Should work :)

The "time" you see, will be the local time of the logged in user who modified the text. The time will NOT change/update itself it another user from a different timezone views it.

Find:
Code:
$messageinput .= "\n\n[".$lang['textediton'].' '.gmdate($dateformat).' '.$lang['textby']." $username]";


Replace by:
Code:
$messageinput .= "\n\n[".$lang['textediton'].' '.gmdate($dateformat).' '.$lang['textat'].' '.gmdate($timeformat).' '.$lang['textby']." $username]";

solbu - 2-15-2013 at 01:47 AM

Sorry about the long delay.
Quote: Originally posted by Mouser  
The "time" you see, will be the local time of the logged in user who modified the text. The time will NOT change/update itself it another user from a different timezone views it.
That's no problem as the forum in question is a norwegian forum, and all users are in the same timezone.
Quote:

Replace by:
Code:
$messageinput .= "\n\n[".$lang['textediton'].' '.gmdate($dateformat).' '.$lang['textat'].' '.gmdate($timeformat).' '.$lang['textby']." $username]";

That definately does not work. :) «timeformat» displays whether the forum have a 12 or 24 hour clock.
I.e. It said Edited at 15-02-2013 at 24 by username. If my forum had a 12 hour clock, it would say at 12.

But your post pointed me to where I must change, so I experimented a little and came with a solution that works.

Replace with:
Code:
$currtime = $onlinetime + ($timeoffset * 3600) + ($addtime * 3600); $time = gmdate($timecode, $currtime); $messageinput .= "\n\n[".$lang['textediton'].' '.gmdate($dateformat).' '.$lang['textat'].' '.$time.' '.$lang['textby']." $username]";


Thank you for the help and inspiration. :cool rsvd: