4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: geewhiz on April 03, 2003, 06:38:12 PM
-
Does someone have a simple utility that can easily extract the *validated* user names & email address from 4Images?
We would like to generate a mail out that is HTML and as such find that the embedded process does not work for us.
Thanks,
-
create a .php file with this code:
<?php
define('ROOT_PATH', './4images/');
include(ROOT_PATH.'global.php');
$sql = "SELECT user_name, user_email, user_allowemails
FROM ".USERS_TABLE." c
WHERE user_allowemails <> 0
ORDER BY user_name ASC";
$result = $site_db->query($sql);
$users = array();
while ($row = $site_db->fetch_array($result)) {
$users[] = array($row['user_name'], $row['user_email']);
}
foreach ($users as $key => $val) {
echo $val[0]." - ".$val[1]."<br />";
}
?>
then, change ROOT_PATH .
this wont show users/emails who set "do not receive emails from admin" to yes.
-
Thanks V@no, I will give it a try and let you know.
[edit]
Works like a charm! :D
Thanks again.
-
If phpbb is intergrated... just as v@no's change the rootpath but this one show all users
<?php
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
$sql = "SELECT username, user_email
FROM ".USERS_TABLE." c
ORDER BY username ASC";
$result = $site_db->query($sql);
$users = array();
while ($row = $site_db->fetch_array($result)) {
$users[] = array($row['username'], $row['user_email']);
}
foreach ($users as $key => $val) {
echo $val[0]." - ".$val[1]."<br />";
}
?>
-
If phpbb is intergrated...
I wish it was :( but not at this time, however thanks for the code I will hang on to it for that "very day".
Thanks