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

Home » FUDforum » How To » Plain mailbox import with date/time information
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon5.gif  Plain mailbox import with date/time information [message #8664] Fri, 14 February 2003 14:54 Go to next message
moozg   Poland
Messages: 4
Registered: February 2003
Karma: 0
Junior Member
Hello,

I have a large (over 150MB) archive of a live mailinglist in plain mailbox format that I would like to import it in FUD forum. I tried to run 'formail -s maillist.php 1' and it worked well with one exception - it has replaced original post date with current import date. Is there an easy way to fix maillist.php to use message date/time instead current one?
Re: Plain mailbox import with date/time information [message #8665 is a reply to message #8664] Fri, 14 February 2003 15:06 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
Hmmm... that should be possible to do relatively easily, but you will need to modify maillist.php import script.

You will need to make it parse the date from the headers and use that instead of the current timestamp.


FUDforum Core Developer
Odp:Re: Plain mailbox import with date/time information [message #8666 is a reply to message #8665] Fri, 14 February 2003 15:15 Go to previous messageGo to next message
moozg   Poland
Messages: 4
Registered: February 2003
Karma: 0
Junior Member
Yeah, sure, that's pretty obvious, but I am new to FUD and don't know where maillist.php inserts the date to DB. I looked for 'date', 'now' etc. in its code and did found nothing, so I expected it in other file (one of many included).

Can you give me more precise directions where may I find part responsible for message date/time settings?
Odp:Re: Plain mailbox import with date/time information [message #8667 is a reply to message #8666] Fri, 14 February 2003 16:15 Go to previous messageGo to next message
moozg   Poland
Messages: 4
Registered: February 2003
Karma: 0
Junior Member
moozg napisał(a) dnia pią, 14 luty 2003 10:15

Yeah, sure, that's pretty obvious, but I am new to FUD and don't know where maillist.php inserts the date to DB. I looked for 'date', 'now' etc. in its code and did found nothing, so I expected it in other file (one of many included).

Can you give me more precise directions where may I find part responsible for message date/time settings?



OK, I already found this, that after line 595:
$msg_post = new fud_msg_edit;

i added:

if( isset($emsg->headers['date']) )
$msg_post->post_stamp = strtotime($emsg->headers['date']);

and it worked. The second problem is user's autoregistration time...
Re: Plain mailbox import with date/time information [message #8682 is a reply to message #8667] Sat, 15 February 2003 09:23 Go to previous message
moozg   Poland
Messages: 4
Registered: February 2003
Karma: 0
Junior Member
Hi,

OK, I already managed it.

If someone wants to incorporate my patch - here it is. I used FUD distribution version 2.3.7.

This patch enables date/time resolving for:
- creating new users
- importing posts

Bye!
  • Attachment: maillist.php
    (Size: 19.94KB, Downloaded 625 times)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: include fudforum inside a template
Next Topic: confirmation email not sent
Goto Forum:
  

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

Current Time: Sun Nov 24 09:09:12 GMT 2024

Total time taken to generate the page: 0.02206 seconds