FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Posting Date and maillist.php
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Posting Date and maillist.php [message #34684] Tue, 14 November 2006 17:30 Go to next message
appscontent   United States
Messages: 33
Registered: November 2006
Karma: 0
Member
I've successfully converted an old archive of email messages into an .elm format. Using maillist.php, these messages import without any issues.

However, the posting date in the forum message displays today's date and not the original creation date. I am using FUDforum 2.7.6.

One of the import file messages contains the following header information

From: "John Does" <jdoe(at)someplace(dot)com> -->
Date: Mon, 26 Mar 2001 14:17:43 +0000 -->
Subject: Training Admin Questions -->

This same import message file has columns with the following attribution:

Created: 03/26/2006 2:17:43 PM
Modified: 03/26/2006 2:17:43 PM
Accessed: 03/26/2006 2:17:43 PM

Can I get the posted message to reflect the original creation date?
Re: Posting Date and maillist.php [message #34699 is a reply to message #34684] Wed, 15 November 2006 02:46 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The import script tries to use the date from the message itself, only if it fails to find the Date header or if the date is in the future will it use the current date.



FUDforum Core Developer
Re: Posting Date and maillist.php [message #34702 is a reply to message #34699] Wed, 15 November 2006 13:28 Go to previous messageGo to next message
appscontent   United States
Messages: 33
Registered: November 2006
Karma: 0
Member
So ... my message header is in the format of

Date: Mon, 26 Mar 2001 14:17:43 +0000 -->

and the posting has today's date. Does this mean it is interpreting this date format as a future date? If so, how do I correct?
Re: Posting Date and maillist.php [message #34711 is a reply to message #34702] Wed, 15 November 2006 17:15 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The date formats are parsed using the PHP's strtotime() function, which takes a string and converts it into a unix timestamp. This is the value the maillist.php script is using.

FUDforum Core Developer
Re: Posting Date and maillist.php [message #34717 is a reply to message #34684] Wed, 15 November 2006 17:45 Go to previous messageGo to next message
appscontent   United States
Messages: 33
Registered: November 2006
Karma: 0
Member
Then I would expect to see a posting date of 26 Mar 2001 (from the header) instead of today's date. I understand what you are saying, but it still does not explain the behavior I am seeing.

I guess I will have to live with this. Thanks for your replies ... I appreciate the help.
Re: Posting Date and maillist.php [message #34727 is a reply to message #34717] Thu, 16 November 2006 15:24 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Which version of PHP are you using? Try and see if PHP can parse the specified date, you can do so via this simple code.

<?php
var_dump
(date("r"strtotime("Mon, 26 Mar 2001 14:17:43 +0000")));
?>


FUDforum Core Developer
Re: Posting Date and maillist.php [message #34744 is a reply to message #34684] Thu, 16 November 2006 22:30 Go to previous messageGo to next message
appscontent   United States
Messages: 33
Registered: November 2006
Karma: 0
Member
PHP Version 4.4.3

<?php
var_dump(date("r", strtotime("Mon, 26 Mar 2001 14:17:43 +0000")));
?>


string(31) "Mon, 26 Mar 2001 09:17:43 -0500"
Re: Posting Date and maillist.php [message #34758 is a reply to message #34744] Fri, 17 November 2006 00:11 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You can try adding a bit of debug code to the maillist.php script and make the code output the value of the post_stamp property of the fud_msg object, it should contain the date & time of the message in the unix timestamp format.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Forum backup
Next Topic: -=] Back to Top [=-
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 05:36:49 GMT 2024

Total time taken to generate the page: 0.05649 seconds