XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: [Resolved] edited-by - adding timestamp
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

question.gif posted on 12-28-2012 at 05:47 AM
[Resolved] edited-by - adding timestamp


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.



My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User
Mouser
XMB Contributor
********




Posts: 202
Registered: 4-14-2008
Member Is Offline

Mood: Christmasy. Yes, in September.

[*] posted on 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]";
View user's profile View All Posts By User
solbu
Member
***




Posts: 33
Registered: 1-10-2007
Location: Norway
Member Is Offline

Mood: No Mood

[*] posted on 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:



My posts are licensed under a Creative Commons license
View user's profile Visit user's homepage View All Posts By User

  Go To Top

Powered by XMB 1.9.12 (Debug Mode)
XMB Forum Software © 2001-2024 The XMB Group
[Queries: 16] [PHP: 28.5% - SQL: 71.5%]