ListMailPRO Email Marketing Software Forums

ListMailPRO Email Marketing Software Forums => Customization, Integration => Topic started by: Pavel on March 07, 2006, 07:52:15 am

Title: Combine two lists into one
Post by: Pavel on March 07, 2006, 07:52:15 am
I wonder if there is a simple way to combine subs from 2 lists into 1 saving their unique IPs?
Title: Combine two lists into one
Post by: DW on March 08, 2006, 05:03:48 am
Here you go!

1. Copy and paste the code below into a new file, ie. custom.php
2. Upload the file to your ListMail folder
3. Browse to it
Code: [Select]
<?php// place this script in your ListMail folder and browse to itinclude('./config.php');include('./admin.php');$move_from_list = '1';$move_to_list = '2';// cycle all users on "from" listecho "moving users from list $move_from_list to list $move_to_list - please wait<br>";flush();$rows = mysql_query("select id,email from $utable where list = '$move_from_list';");echo @mysql_num_rows($rows).' users to process<br>';while(list($id,$em)=mysql_fetch_row($rows)){ $row = mysql_query("select id from $utable where list = '$move_to_list' and email like '$em';"); // if not on list move user if(@mysql_num_rows($row)==0) mysql_query("update $utable set list = '$move_to_list' where id = '$id';"); else echo "duplicate email $em<br>";}echo "done!<br>";?>
Title: Combine two lists into one
Post by: BGSWebDesign on March 08, 2006, 06:21:01 am
Hi DW,

Quote
1. Copy and paste the code below into a new file, ie. custom.php


Thanks a million, this was long overdue and will help tremendously!!!  As we discussed before, this is one of those 'Extras' you could sell as part of a membership, or as an 'add-on', think about it...  we've talked about it many times - I want to see you making a good living from LMP   :)

What we really would need is a selector box, select list 1, select list 2, instead of manually updating the php file every time ...
also - another option is really needed to make this script fully functional:
Move To, or Copy To - preserving the old users in the original List so they are not removed from the other list, just copied to the new list...

What do you think, DW?
Title: Combine two lists into one
Post by: DW on March 08, 2006, 11:04:40 am
When checkboxes, selections, and 'all list' or 'all result' operations come to the user database page this will all be very easy.
Title: Combine two lists into one
Post by: Pavel on March 08, 2006, 02:34:07 pm
Thanks a lot Dean, you are very helpful.

I think this feature has long been awaited, especially in the form of a button somewhere in the "User Database" window :)

Thanks.