Solved

email to phpBB forum

Posted on 2004-09-14
8
3,244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

 
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
 
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

626 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