Solved

email to phpBB forum

Posted on 2004-09-14
8
3,220 Views
Last Modified: 2008-03-10
Is there a simple way to take an email archive (mailing list) and import it into a forum created with phpBB. This would have to be sorted by the email subject and have some filtering options available.
Thanks
Peregian
0
Comment
Question by:Peregian
  • 4
  • 3
8 Comments
 
LVL 2

Expert Comment

by:Celardore
ID: 12053494
What do you mean? Import your mailing list into where?

You can run a MySQL query to import the email addresses into your PHPbb database.
0
 
LVL 10

Expert Comment

by:daleoran
ID: 12053787
Hi Peregian

Check this out

http://www.phpbbhacks.com/download/3016

it will allow you to import your mailing list in the form of a csv

Hope this helps

Michael

0
 
LVL 2

Author Comment

by:Peregian
ID: 12053811
Yes, import a mailing list archive into phpBB bulletin board database.  I just want a simple way to do that. So it would become a searchable archive in a forum. I want it to just group all messages by email subject.
0
 
LVL 2

Author Comment

by:Peregian
ID: 12053862
I'd better clarify. I'm not interested in hteir email addresses just the email message content.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 2

Expert Comment

by:Celardore
ID: 12054631
What format is your original mailing list in?

If it is like this?

user@email.com - Subject1
another@user.com - Hello!

A simple PHP script to insert all the data into the database.

<?php
 $link=mysql_connect('localhost','dbuser','dbpass') or die('could not connect to database');
 $list = file('mailinglist.txt');
 foreach ($list as $line_num => $line)
{
 $data = explode(' - ',$line);
 mysql_query("INSERT INTO emails ('email','subject') VALUES('.$data[0].','.$data[1].'),$link) or die(mysql_error());
}
?>

I can't actually test any php at the moment, but I hope that the above code may guide you.

=)
0
 
LVL 2

Author Comment

by:Peregian
ID: 12060131
The original list could be exported into many formats I suppose but I was thinking csv would be easiest to work with. That script may look simple but I have no idea how to run it. Would I have to upload the list and the script to my hosts webserver and run it from there somehow?
You'll have to excuse my dumbness on this subject :o)
0
 
LVL 2

Accepted Solution

by:
Celardore earned 125 total points
ID: 12063029
To run the script, select everything between and including <?php and ?> then save that in notepad or something similar, as 'emailscript.php'.  You will need to change some things, like the 'dbuser', 'dbpass' and the $file variable.

You can export your original list as CSV, but make sure to change the ' - ' in the explode function to be ','

Change the values in the mysql_query() to represent those of your database table.

Also, if you want to use more information from the email information, you can use $data[2],[3],etc.  Every time the explode function hits your explode character (' - ') it will dump the results into the $data[] array which will increment each time it finds a new ' - '.

So once you've made all the changes to that script, you upload the emailscript.php and the mailinglist.txt to your host, then run the location of the script in your address bar.  It should work automatically, but like I said; I'm afraid I can't test it!

Good luck! =)
0
 
LVL 2

Author Comment

by:Peregian
ID: 12063202
Thanks, I appreciate you taking the time to explain that for me.
Looks pretty easy, so I'll see how we go.
I'll get back to you :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now