Page 1 of 1

[REQUEST] email address grabber

Posted: Sun Apr 13, 2008 7:50 am
this is somehting thats come to me recently with my forums failure to send emails to members.. that and my dislike of the mass email feature within phpbb3

id love a mod that would only appear within the ACP so only admin could use it that enabled me to, hopefull with just a click or two to grab every forum members email address and export them in a word document, or other similar document which i can then use to construct my own more profesional looking emails to my members

Re: [REQUEST] email address grabber

Posted: Sun Apr 13, 2008 10:09 am
by ccessex
Already exists, it's called


This installs into the ACP and lists all the members email addys, complete with the ; so is ready to just copy and paste into the BCC or CC box of your email.

Re: [REQUEST] email address grabber

Posted: Sun Apr 13, 2008 10:11 am
brilliant, thanks for your reply

Re: [REQUEST] email address grabber

Posted: Sun Apr 13, 2008 10:15 am
by ccessex

Re: [REQUEST] email address grabber

Posted: Sun Apr 13, 2008 10:53 am
by -ToM-
Well, I had just made this very simple modification, you can use it if you wish:

Create a new file called showusers.php and upload to your root dir with the following inside it:

Code: Select all


include 'config.php';

$table = 'phpbb_users';

if (!mysql_connect($dbhost, $dbuser, $dbpasswd))
    die("Can't connect to the database");

if (!mysql_select_db($dbname))
    die("Can't select the database");

// sending query
$result = mysql_query("SELECT user_email FROM {$table}");
if (!$result) {
    die("Query to show fields from table failed");

$fields_num = mysql_num_fields($result);

echo "<h1>All user's email addresses:</h1>";
// printing table headers
for($i=0; $i<$fields_num; $i++)
    $field = mysql_fetch_field($result);
echo "</tr>\n";
// printing table rows
while($row = mysql_fetch_row($result))

    // $row is array... foreach( .. ) puts every element
    // of $row to $cell variable
    foreach($row as $cell)
        echo "<td>$cell<br></td>";

    echo "</tr>\n";
Open and edit adm/style/acp_main.html.


Code: Select all

			<form id="action_purge_cache_form" method="post" action="{U_ACTION}">
					<dt><label for="action_purge_cache">{L_PURGE_CACHE}</label><br /><span>{L_PURGE_CACHE_EXPLAIN}</span></dt>
					<dd><input type="hidden" name="action" value="purge_cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd>
After, add:

Code: Select all

				<dt><label>List all emails</label><br /><span>Lists all emails of all users in one text file.</span></dt>
				<dd><input class="button2" type="button" onClick="document.location.href=''" value="Run now" /></dd></dl></form>
NOTE: Change to your forum url with forum path (if needed).

Go to acp, click on run now for purge cache, then yes. Then click on the run now for list all emails and you should see the screen of everyone's emails.