function snp_ml_get_cc_lists($ml_cc_username = '', $ml_cc_pass = '') { require_once SNP_DIR_PATH . '/include/constantcontact/class.cc.php'; $list = array(); if (snp_get_option('ml_cc_username') && snp_get_option('ml_cc_pass') || $ml_cc_username && $ml_cc_pass) { if ($ml_cc_username && $ml_cc_pass) { $cc = new cc($ml_cc_username, $ml_cc_pass); } else { $cc = new cc(snp_get_option('ml_cc_username'), snp_get_option('ml_cc_pass')); } $res = $cc->get_lists('lists'); if ($res) { foreach ((array) $res as $v) { $list[$v['id']] = array('name' => $v['Name']); } } else { // Error } } if (count($list) == 0) { $list[0] = array('name' => 'Nothing Found...'); } return $list; }
function ihc_return_cc_list($ips_cc_user, $ips_cc_pass) { include_once IHC_PATH . 'classes/email_services/constantcontact/class.cc.php'; $list = array(); $cc = new cc($ips_cc_user, $ips_cc_pass); $lists = $cc->get_lists('lists'); if ($lists) { foreach ((array) $lists as $v) { $list[$v['id']] = array('name' => $v['Name']); } } return $list; }