[mod] Export Users without Blacklisted or Unconfirmed users

3rd party code for phpList

[mod] Export Users without Blacklisted or Unconfirmed users

Postby WinstonN » 1:53pm, Tue 04 Dec, 2007

Hi guys,

Hope you are all having a wonderful day!
I have seen many problems and complaints from users that want to export users but they don't want the blacklisted or unconfirmed users in this export file, the csv.

I have made a small hack that will allow for this:

The file I edited was admin/export.php
Round about line 38 you will see this:

Code: Select all
case 'all':
    if ($list) {
      $querytables = $GLOBALS['tables']['user'].' user'.', '.$GLOBALS['tables']['listuser'].' listuser';
      $subselect = ' and listuser.userid = user.id ';
    } else {
      $querytables = $GLOBALS['tables']['user'].' user';
      $subselect = '';
    }


I then changed this line

Code: Select all
$subselect = '';


to

Code: Select all
$subselect = ' and user.blacklisted = 0 and user.confirmed = 1 ';


This then exports a clean list with ONLY confirmed and non blacklisted users

I will refine this a little later on to provide you with a tick box to export only blacklisted or un confirmed users.

Please let me know if this works for you,
Happy days to you fine peeps!

Wins
Winston Nolan
http://www.buyxonline.com
eCommerce and Email Marketing
WinstonN
PL Master
 
Posts: 158
Joined: 3:31pm, Sun 04 Feb, 2007
Location: Cape Town, South Africa

it's ok

Postby maryline » 2:36pm, Mon 07 Jan, 2008

This works for me !

Now I need to export only blacklisted people...
I didn't check in the forum if it exists already.
But thanks for your hack :-)

(sorry for my english, i'm french !)
maryline
phpList newbie
 
Posts: 2
Joined: 1:45pm, Mon 07 Jan, 2008

Postby Guest » 1:37pm, Fri 03 Oct, 2008

Anybody knows how to export only "unconfirmed" users?

I REALLY need this, because i'm cleaning out my database.

I've tried with 'unconfirmed = 0'; but that doesn't work.

Help guys.. PLEASE!
Guest
 

Postby vancoovur » 3:50pm, Fri 03 Oct, 2008

I'm guessing you would change

Code: Select all
$subselect = ' and user.blacklisted = 0 and user.confirmed = 1 ';


To

Code: Select all
$subselect = ' and user.confirmed = 0 ';


although I haven't tried this.
vancoovur
PL Geek
 
Posts: 120
Joined: 1:48am, Wed 28 Jan, 2009
Location: Canada

Re: [mod] Export Users without Blacklisted or Unconfirmed users

Postby ThorstenAlbrecht » 4:45pm, Thu 06 Aug, 2009

WinstonN wrote:Please let me know if this works for you,
Happy days to you fine peeps!

Thank you, very useful because export of blacklisted or unconfirmed users does not make any sense at all.

Thorsten
ThorstenAlbrecht
PL Nut
 
Posts: 44
Joined: 4:08pm, Thu 06 Aug, 2009

Re: [mod] Export Users without Blacklisted or Unconfirmed users

Postby ThorstenAlbrecht » 5:20pm, Thu 06 Aug, 2009

I just like to add something: If you want to export the users of a certain list (and not all users), you have to modify one more line in the same case statement:

in export.php:
original: (2.10.10)
Code: Select all
  case 'all':
    if ($list) {
      $querytables = $GLOBALS['tables']['user'].' user'.', '.$GLOBALS['tables']['listuser'].' listuser';
      $subselect = ' and listuser.userid = user.id ';
    } else {
      $querytables = $GLOBALS['tables']['user'].' user';

         $subselect = '';
    }


modified code
Code: Select all
  case 'all':
    if ($list) {
      $querytables = $GLOBALS['tables']['user'].' user'.', '.$GLOBALS['tables']['listuser'].' listuser';
//      $subselect = ' and listuser.userid = user.id ';
      $subselect = ' and listuser.userid = user.id  and user.blacklisted = 0 and user.confirmed = 1 ';
    } else {
      $querytables = $GLOBALS['tables']['user'].' user';

//         $subselect = '';
      $subselect = ' and user.blacklisted = 0 and user.confirmed = 1 ';
    }


Thorsten
ThorstenAlbrecht
PL Nut
 
Posts: 44
Joined: 4:08pm, Thu 06 Aug, 2009

Re: [mod] Export Users without Blacklisted or Unconfirmed users

Postby H2B2 » 11:05am, Sat 26 Jun, 2010

H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: [mod] Export Users without Blacklisted or Unconfirmed u

Postby sintsu » 1:44pm, Thu 03 Nov, 2011

Looking forward the new version 2.11.X release!
H2B2 wrote:Related feature request: http://mantis.phplist.com/view.php?id=15507
sintsu
PL Nut
 
Posts: 21
Joined: 5:42am, Fri 07 Oct, 2011

Re: [mod] Export Users without Blacklisted or Unconfirmed u

Postby mrmckoy » 5:48am, Wed 29 May, 2013

I can't understand why this isn't included in the core. It makes sense that one wouldn't want to export users that don't want to recieve email.

But H2B2 recommended against it. I don't get it
mrmckoy
PL Master
 
Posts: 169
Joined: 7:10am, Sat 24 Nov, 2007
Location: Atlanta, GA


Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 1 guest