include 'PerchMailchimp_Stats.class.php'; include 'PerchMailchimp_Stat.class.php'; $API = new PerchAPI(1.0, 'perch_mailchimp'); $Lang = $API->get('Lang'); // check privs if ($CurrentUser->has_priv('perch_mailchimp')) { $Settings = $API->get('Settings'); $api_key = $Settings->get('perch_mailchimp_api_key')->settingValue(); $list_id = $Settings->get('perch_mailchimp_list_id')->settingValue(); $Data = new PerchMailchimp_Stats($API); $msg = false; if (!$api_key || $api_key == '' || !$list_id || $list_id == '') { //need to set these $msg = '<p class="bd helptext"><a href="' . PERCH_LOGINPATH . '/core/settings/">' . PerchLang::get('You must set your Mailchimp API Key and List ID in Settings.') . '</a></p>'; } else { $display_data = $Data->get_data(); } ?> <div class="widget"> <h2><?php echo $Lang->get('MailChimp'); ?> </h2> <div class=""> <?php if ($msg) { echo $msg; } else { if (is_object($display_data)) { echo '<table><caption>' . PerchUtil::html($display_data->title()) . '</caption>' . "\n";