I needed to allow duplicates also. However, I needed the unique ID (UID) to remain the same for someone who was already subscribed. Here is the modified code I added. It isn't the most efficient, but it looked safe and had minimal risk impact. This change was in signup.php. The first part adds uid to the list of stuff we get from the database.
// check for duplicates
$cmd = "select id,cnf,uid from $utable where list = '$list' and email like '$email'";
$result = mysql_query($cmd);
if(mysql_num_rows($result)>0){
list($xid,$xcnf,$uid)=mysql_fetch_row($result);
Then, further down, we use the uid if we got one.
$uniq = '';
// CH change - If this was a duplicate, I want to use the original UID if possible rather than creating a new one
if ($uid) {
$ucmd = "select id from $utable where uid = '$uid'";
$urow = mysql_query($ucmd);
$uniq_str = $uid;
if(@mysql_num_rows($urow)==0) $uniq=1;
}
// back to original code
while(!$uniq){
if($randmaxx) $randmax = $randmaxx;
$uniq_str = strtolower(substr(md5(rand(0,$randmax)), 0,7));
$ucmd = "select id from $utable where uid = '$uniq_str'";
$urow = mysql_query($ucmd);
if(@mysql_num_rows($urow)==0) $uniq=1;
}