Author Topic: Email List Extraction  (Read 4454 times)

0 Members and 1 Guest are viewing this topic.

Offline geewhiz

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • http://www.cawebguys.com
Email List Extraction
« 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,
- Snap -
Photography is not just a passion!
It has become an obsession!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Email List Extraction
« Reply #1 on: April 03, 2003, 06:58:52 PM »
create a .php file with this code:
Code: [Select]
<?php
define
&#40;'ROOT_PATH', './4images/'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
$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&#40;$sql&#41;;
$users = array&#40;&#41;;
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
$users[&#93; = array&#40;$row['user_name'&#93;, $row['user_email'&#93;&#41;;
&#125;
foreach &#40;$users as $key => $val&#41; &#123;
echo $val[0&#93;." - ".$val[1&#93;."<br />";
&#125;
?>

then, change ROOT_PATH .
this wont show users/emails who set "do not receive emails from admin" to yes.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline geewhiz

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • http://www.cawebguys.com
Email List Extraction
« Reply #2 on: April 03, 2003, 08:54:04 PM »
Thanks V@no, I will give it a try and let you know.

[edit]
Works like a charm!  :D

Thanks again.
- Snap -
Photography is not just a passion!
It has become an obsession!

Offline Caelestis

  • Newbie
  • *
  • Posts: 40
    • View Profile
Email List Extraction
« Reply #3 on: April 04, 2003, 12:00:48 AM »
If phpbb is intergrated... just as v@no's change the rootpath but this one show all users

Code: [Select]
<?php 
define
&#40;'ROOT_PATH', './'&#41;; 
include&#40;ROOT_PATH.'global.php'&#41;; 
$sql "SELECT username, user_email 
        FROM "
.USERS_TABLE." c 
        ORDER BY username ASC"

$result $site_db->query&#40;$sql&#41;; 
$users = array&#40;&#41;; 
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123; 
   
$users[&#93; = array&#40;$row['username'&#93;, $row['user_email'&#93;&#41;; 
&#125; 
foreach &#40;$users as $key => $val&#41; &#123; 
   
echo $val[0&#93;." - ".$val[1&#93;."<br />"; 
&#125; 
?>

Offline geewhiz

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • http://www.cawebguys.com
Email List Extraction
« Reply #4 on: April 04, 2003, 02:06:06 AM »
Quote from: Caelestis
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
- Snap -
Photography is not just a passion!
It has become an obsession!