Exemple #1
0
function yksemeProcessSnippet($list = false, $submit_text)
{
    global $yksemeBase;
    if (!is_object($yksemeBase)) {
        $yksemeBase = new yksemeBase();
    }
    return $yksemeBase->processSnippet($list, $submit_text);
}
Exemple #2
0
function display_mc_subscriber_count()
{
    if (class_exists("yksemeBase")) {
        $mailChimp = new yksemeBase();
        $list = $mailChimp->getListsData();
        $list_id = key($list);
        echo '<script>
			jQuery(function() {
			jQuery(".mailchimpCountTarget").text("' . $list['subscriber-count']['subscriber-count-' . $list_id] . '");
		});
		</script>';
    }
}
 public function displaySubscriberCount($p)
 {
     ob_start();
     if ($this->optionVal['api-key'] != '' && (is_array($this->optionVal['lists'][$p['id']]) && !empty($this->optionVal['lists'][$p['id']]))) {
         // Setup this list
         $list = $this->optionVal['lists'][$p['id']];
         $mailChimp = new yksemeBase();
         $list = $mailChimp->getListsData();
         $list_id = key($list);
         // return just the subscriber count so the user can easily customize it!
         echo $list['subscriber-count']['subscriber-count-' . $list_id];
     } else {
         if ($this->optionVal['api-key'] == '' || get_option('api_validation') == 'invalid_api_key') {
             include YKSEME_PATH . 'templates/shortcode_error_no_API_key.php';
             // else if the form was removed from the lists page
         } else {
             include YKSEME_PATH . 'templates/shortcode_error_data.php';
         }
     }
     $shortcode = ob_get_contents();
     ob_end_clean();
     return $shortcode;
 }