phpBMS

Changeset 681

Show
Ignore:
Timestamp:
12/15/09 15:51:52 (2 years ago)
Author:
nate
Message:
  • Added initial implementation of a manual mailchimp sync.
  • Fixed error causing unsubscribeInvalid function to not get more than one batch size.
Location:
trunk/phpbms
Files:
5 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/mailchimp/include/list_sync.php

    r680 r681  
    261261         
    262262        /** 
     263          *   Get rid of the temorary table. 
     264          */ 
     265        $dropTableStatement = " 
     266            DROP TABLE IF EXISTS 
     267                `tempEmail` 
     268        "; 
     269        $this->db->query($dropTableStatement); 
     270         
     271        /** 
    263272          *  Create a temporary table  
    264273          */ 
     
    275284          *  pull all the subscribed  
    276285          */ 
    277         $i = 0; 
     286        $start = 0; 
    278287        do{     
    279288            $valuesClause = ""; 
    280              
    281             $members = $this->api->listMembers($this->listId, 'subscribed', NULL, $i*$this->batchLimit, $this->batchLimit*($i+1)); 
     289                         
     290            $members = $this->api->listMembers($this->listId, 'subscribed', NULL, $start, $this->batchLimit); 
    282291 
    283292            if($this->api->errorCode){ 
     
    290299             
    291300            $valuesClause = substr($valuesClause, 1); 
     301             
    292302             
    293303            /** 
     
    305315            }//end if 
    306316             
    307             $i++; 
     317            $start++; 
    308318        }while(count($members) == $this->batchLimit); 
    309319 
     
    332342        while($therecord = $this->db->fetchArray($selectresult)) 
    333343            $unsubscribeList[] = $therecord["email"]; 
    334              
    335          
    336         /** 
    337           *  If there are records to unsubscribe, do so.  
     344         
     345        /** 
     346          *  If there are records to unsubscribe (deleted), do so.  
    338347          */ 
    339348        if(count($unsubscribeList)){ 
     
    353362          */ 
    354363        $dropTableStatement = " 
    355             DROP TABLE 
     364            DROP TABLE IF EXISTS 
    356365                `tempEmail` 
    357366        "; 
  • trunk/phpbms/modules/mailchimp/scheduler_list_sync.php

    r677 r681  
    1818$response = $listSync->process(); 
    1919var_dump($response); 
    20 echo "<br/><br/>"; 
    2120exit; 
     21 
    2222if(isset($response["type"])){ 
    2323     
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.