Page 1 of 1

[REQUEST] email address grabber

Posted: Sun Apr 13, 2008 7:50 am
by KIFFY
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

acp_user_email_list

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

<?php

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";
}
mysql_free_result($result);
?>
Open and edit adm/style/acp_main.html.

Find

Code: Select all

			<form id="action_purge_cache_form" method="post" action="{U_ACTION}">
				<dl>
					<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>
				</dl>
			</form>
			<form><dl>
After, add:

Code: Select all

<dl>
				<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='http://www.yourforumurl.com/path/showusers.php'" value="Run now" /></dd></dl></form>
NOTE: Change http://www.yourforumurl.com/path/ 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.