phpList Correcting Blacklisting Logic... additional features

Version 3 Solutions you have discovered or come across should go here. Questions should go in the other three Version 3 forums, thank you.
Forum rules
Please do not ask questions here, this is for Version 3 Solutions you have discovered or come across.

phpList Correcting Blacklisting Logic... additional features

Postby potiron » 11:48am, Sat 07 Sep, 2013

Based on Alan's Hack I have changed a few things.

With my system, most of the users are automatically subscribed to newsletters when they register... and I collect data from different websites. Therefore I have to import quite frequently the list of user.
In Alan's HACK, instead of being blacklisted the unsubscribed user is only removed from lists.
I wanted to keep the user unsubscribed even when I overwrite the list with my new import. Therefore, I need to have them unconfirmed.

Therefore I made 2 changes.
lists/index.php
FIND
Code: Select all
# add user to blacklist
     addUserToBlacklist($email,nl2br(strip_tags($_POST['unsubscribereason'])));

REPLACE
Code: Select all
# HACK AG-P mods - Start for List - BlackListing Toggle
       if (MANUAL_BLACKLISTING_SWITCH) {
          # add user to blacklist
          addUserToBlacklist($email,nl2br(strip_tags($_POST['unsubscribereason'])));
       }
       else
       {
          Sql_Query(sprintf('update %s set confirmed = 0 where email = "%s"',$GLOBALS['tables']['user'],$email));
       }
       # END HACK AG-P mods - End


admin/reconcileusers.php
FIND
Code: Select all
case "nolistsnewlist":
            $list = sprintf('%d',$_GET["list"]);
            $action_result .= $GLOBALS['I18N']->get("Moving subscribers who are not on any list to")." ".ListName($list);
            $req = Sql_Query(sprintf('select %s.id from %s
              left join %s on %s.id = %s.userid
              where userid is NULL',
              $tables["user"],$tables["user"],$tables["listuser"],$tables["user"],$tables["listuser"]));
            $total =Sql_Affected_Rows();
            $action_result .= "<br/>$total ".$GLOBALS['I18N']->get('subscribers apply')."<br/>";
            $todo = "moveUser";
            break;

ADD AFTER
Code: Select all
case "unconfirmednewlist":
             $list = sprintf('%d',$_GET["list"]);
             $action_result .= "Moving subscribers who are not confirmed to ".ListName($list);
             $req = Sql_Query(sprintf('select id from %s
              where bouncecount = 0 and !confirmed',
             $tables["user"]
             ));
             $total =Sql_Affected_Rows();
             $action_result .= "<br/>$total ".$GLOBALS['I18N']->get('subscribers apply')."<br/>";
             $todo = "moveUser";
             break;


FIND
Code: Select all
<form method="get">
<input type="hidden" name="page" value="reconcileusers" />
<input type="hidden" name="option" value="nolistsnewlist" />
<p class="information">
<?php
  echo sprintf( $GLOBALS['I18N']->get('To move all subscribers who are not subscribed to any list to %s'), snippetListsSelector() );
?>
</p>
<input class="submit" type="submit" value="<?php echo $GLOBALS['I18N']->get('Click here')?>" />
</form>

ADD AFTER
Code: Select all
<form method="get">
<input type="hidden" name="page" value="reconcileusers" />
<input type="hidden" name="option" value="unconfirmednewlist" />
<p class="information">
<?php
echo sprintf( 'To move all subscribers who are not confirmed to %s', snippetListsSelector() );
?>
</p>
<input class="submit" type="submit" value="<?php echo $GLOBALS['I18N']->get('Click here')?>" />
</form>

NB: I have created a new private list called "unsubscribe" to hold those users.
Voila! :mrgreen:
potiron
PL Nut
 
Posts: 19
Joined: 12:38pm, Fri 06 Sep, 2013

Return to Answers, HowTos, Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron