Advertisement
helgatheviki

mailchimp-widget.php Revision

Jun 19th, 2012
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.49 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Displays a MailChimp Signup Form
  4.  **/
  5. function mailchimpSF_signup_form($args = array()) {
  6.     extract($args);
  7.  
  8.     $mv = get_option('mc_merge_vars');
  9.     $igs = get_option('mc_interest_groups');
  10.  
  11.     $widget = '';
  12.    
  13.     // See if we have valid Merge Vars
  14.     if (!is_array($mv)){
  15.         $widget .=  $before_widget;
  16.        
  17.         $widget .= '<div class="mc_error_msg">' . esc_html__('There was a problem loading your MailChimp details. Please re-run the setup process under Settings->MailChimp Setup', 'mailchimp_i18n') . '</div>';
  18.         $widget .=  $after_widget;
  19.         return;
  20.     }
  21.    
  22.     // Get some options
  23.     $uid = get_option('mc_user_id');
  24.     $list_name = get_option('mc_list_name');
  25.    
  26.     if (!empty($before_widget)) {
  27.         $widget .=  $before_widget;
  28.     }
  29.  
  30.     $header =  get_option('mc_header_content');
  31.     // See if we have custom header content
  32.     if (!empty($header)) {
  33.         // See if we need to wrap the header content in our own div
  34.         if (strlen($header) == strlen(strip_tags($header))){
  35.             $widget .=  !empty($before_title) ? $before_title : '<div class="mc_custom_border_hdr">';
  36.             $widget .=  $header; // don't escape $header b/c it may have HTML allowed
  37.             $widget .=  !empty($after_title) ? $after_title : '</div><!-- /mc_custom_border_hdr -->';
  38.         }
  39.         else {
  40.             $widget .=  $header; // don't escape $header b/c it may have HTML allowed
  41.         }
  42.     }
  43.    
  44.     $sub_heading = trim(get_option('mc_subheader_content'));
  45.    
  46.     $widget .= '<div id="mc_signup">';
  47.     $widget .= '<form method="post" action="#mc_signup" id="mc_signup_form">';
  48.     $widget .= '<input type="hidden" id="mc_submit_type" name="mc_submit_type" value="html" />';
  49.     $widget .= '<input type="hidden" name="mcsf_action" value="mc_submit_signup_form" />';
  50.     $widget .= wp_nonce_field('mc_submit_signup_form', '_mc_submit_signup_form_nonce', false, false);
  51.        
  52.    
  53.     if ($sub_heading) {
  54.    
  55.         $widget .= '<div id="mc_subheader">';
  56.             $widget .=  $sub_heading;
  57.         $widget .= '</div><!-- /mc_subheader -->';
  58.     }
  59.    
  60.     $widget .= '<div class="mc_form_inside">';
  61.        
  62.         $widget .= '<div class="updated" id="mc_message">';
  63.             $widget .=  mailchimpSF_global_msg();
  64.         $widget .= '</div><!-- /mc_message -->';
  65.  
  66.         //don't show the "required" stuff if there's only 1 field to display.
  67.         $num_fields = 0;
  68.         foreach((array)$mv as $var) {
  69.             $opt = 'mc_mv_'.$var['tag'];
  70.             if ($var['req'] || get_option($opt) == 'on') {
  71.                 $num_fields++;
  72.             }
  73.         }
  74.  
  75.         if (is_array($mv)) {
  76.             // head on back to the beginning of the array
  77.             reset($mv);
  78.         }
  79.        
  80.         // Loop over our vars, and output the ones that are set to display
  81.         foreach($mv as $var) {
  82.             if (!$var['public']) {
  83.                 $widget .=  '<div style="display:none;">'.mailchimp_form_field($var, $num_fields).'</div>';
  84.             }
  85.             else {
  86.                 $widget .=  mailchimp_form_field($var, $num_fields);
  87.             }
  88.         }
  89.        
  90.        
  91.         // Show an explanation of the * if there's more than one field
  92.         if ($num_fields > 1) {
  93.             $widget .= '<div id="mc-indicates-required">';
  94.                 $widget .= '* = '. esc_html__('required field', 'mailchimp_i18n');
  95.             $widget .= '</div><!-- /mc-indicates-required -->';
  96.            
  97.         }
  98.        
  99.        
  100.         // Show our Interest groups fields if we have them, and they're set to on
  101.         if (is_array($igs) && !empty($igs)) {
  102.             foreach ($igs as $ig) {
  103.                 if (is_array($ig) && isset($ig['id'])) {
  104.                     if ($igs && get_option('mc_show_interest_groups_'.$ig['id']) == 'on') {
  105.                         if ($ig['form_field'] != 'hidden') {
  106.                        
  107.                             $widget .= '<div class="mc_interests_header">'. esc_html($ig['name']) . '</div><!-- /mc_interests_header -->';
  108.                             $widget .= '<div class="mc_interest">';
  109.                         }
  110.                         else {
  111.                             $widget .= '<div class="mc_interest" style="display: none;">';
  112.                         }
  113.                    
  114.                     $widget .= mailchimp_interest_group_field($ig);
  115.                    
  116.                     $widget .= '</div><!-- /mc_interest -->';
  117.            
  118.                     }
  119.                 }
  120.             }
  121.         }
  122.  
  123.         if (get_option('mc_email_type_option')) {
  124.        
  125.         $widget .= '<div class="mergeRow">';
  126.             $widget .= '<label>' .__('Preferred Format', 'mailchimp_i18n'). '</label>';
  127.             $widget .= '<div class="field-group groups">';
  128.                 $widget .= '<ul class="mc_list">';
  129.                     $widget .= '<li><input type="radio" name="email_type" id="email_type_html" value="html" checked="checked"><label for="email_type_html">'.__('HTML', 'mailchimp_i18n').'</label></li>';
  130.                    $widget .= ' <li><input type="radio" name="email_type" id="email_type_text" value="text"><label for="email_type_text">'.__('Text', 'mailchimp_i18n').'</label></li>';
  131.                     $widget .= '<li><input type="radio" name="email_type" id="email_type_mobile" value="mobile"><label for="email_type_mobile">'.__('Mobile', 'mailchimp_i18n').'</label></li>';
  132.                 $widget .= '</ul>';
  133.             $widget .= '</div>';
  134.         $widget .= '</div>';
  135.  
  136.        
  137.         }
  138.        
  139.  
  140.         $widget .= '<div class="mc_signup_submit">';
  141.             $widget .= '<input type="submit" name="mc_signup_submit" id="mc_signup_submit" value="'. esc_attr(get_option('mc_submit_text')).'" class="button" />';
  142.         $widget .= '</div><!-- /mc_signup_submit -->';
  143.    
  144.    
  145.    
  146.         if ( get_option('mc_use_unsub_link') == 'on') {
  147.             list($key, $dc) = explode("-",get_option('mc_apikey'),2);
  148.             if (!$dc) $dc = "us1";
  149.             $host = 'http://'.$dc.'.list-manage.com';
  150.        
  151.             $widget .= '<div id="mc_unsub_link" align="center">';
  152.                 $widget .= sprintf('<a href="%s" target="_blank">%s</a>', esc_url($host.'/unsubscribe/?u='.get_option('mc_user_id').'&amp;id='.get_option('mc_list_id')), esc_html__('unsubscribe from list', 'mailchimp_i18n'));
  153.             $widget .= '</div><!-- /mc_unsub_link -->';
  154.            
  155.         }
  156.         if ( get_option('mc_rewards') == 'on') {
  157.            
  158.             $widget .= '<div id="mc_display_rewards" align="center">';
  159.                 $widget .= sprintf('%s <a href="%s">Mailcimp</a>!' , esc_html__('powered by', 'mailchimp_i18n') , esc_url('http://www.mailchimp.com/affiliates/?aid='.get_option('mc_user_id').'&amp;afl=1'));
  160.             $widget .= '</div><!-- /mc_display_rewards -->';
  161.         }
  162.        
  163.        
  164.     $widget .= '</div><!-- /mc_form_inside -->';
  165.     $widget .= '</form><!-- /mc_signup_form -->';
  166. $widget .= '</div><!-- /mc_signup_container -->';
  167.    
  168.     if (!empty($before_widget)) {
  169.         $widget .= $after_widget;
  170.     }
  171.  
  172.     return apply_filters('mailchimpSF_signup_form',$widget);
  173. }
  174.  
  175. /**
  176.  * Generate and display markup for Interest Groups
  177.  * @param array $ig Set of Interest Groups to generate markup for
  178.  * @return void
  179.  */
  180. function mailchimp_interest_group_field($ig) {
  181.     if (!is_array($ig)) {
  182.         return;
  183.     }
  184.     $html = '';
  185.     $set_name = 'group['.$ig['id'].']';
  186.     switch ($ig['form_field']) {
  187.         case 'checkbox':
  188.         case 'checkboxes':
  189.             $i = 1;
  190.             foreach($ig['groups'] as $interest){
  191.                 $interest = $interest['name'];
  192.                 $html .= '
  193.                 <input type="checkbox" name="'.esc_attr($set_name.'['.$i.']').'" id="'.esc_attr('mc_interest_'.$ig['id'].'_'.$interest).'" class="mc_interest" value="'.esc_attr($interest).'" />
  194.                 <label for="'. esc_attr('mc_interest_'.$ig['id'].'_'.$interest).'" class="mc_interest_label">'.esc_html($interest).'</label>
  195.                 <br/>';
  196.                 $i++;
  197.             }
  198.             break;
  199.         case 'radio':
  200.             foreach($ig['groups'] as $interest){
  201.                 $interest = $interest['name'];
  202.                 $html .= '
  203.                 <input type="radio" name="'.esc_attr($set_name).'" id="'.esc_attr('mc_interest_'.$ig['id'].'_'.$interest).'" class="mc_interest" value="'.esc_attr($interest).'"/>
  204.                 <label for="'.esc_attr('mc_interest_'.$ig['id'].'_'.$interest).'" class="mc_interest_label">'.esc_html($interest).'</label>
  205.                 <br/>';
  206.             }
  207.             break;
  208.         case 'select':
  209.         case 'dropdown':
  210.             $html .= '
  211.             <select name="'.esc_attr($set_name).'">
  212.                 <option value=""></option>';
  213.                 foreach($ig['groups'] as $interest){
  214.                     $interest = $interest['name'];
  215.                     $html .= '
  216.                     <option value="'.esc_attr($interest).'">'.esc_html($interest).'</option>';
  217.                 }
  218.                 $html .= '
  219.             </select>';
  220.             break;
  221.         case 'hidden':
  222.             $i = 1;
  223.             foreach($ig['groups'] as $interest) {
  224.                 $interest = $interest['name'];
  225.                 $html .= '
  226.                 <input type="checkbox" name="'.esc_attr($set_name.'['.$i.']').'" id="'.esc_attr('mc_interest_'.$ig['id'].'_'.$interest).'" class="mc_interest" value="'.esc_attr($interest).'" />
  227.                 <label for="'. esc_attr('mc_interest_'.$ig['id'].'_'.$interest).'" class="mc_interest_label">'.esc_html($interest).'</label>';
  228.                 $i++;
  229.             }
  230.             break;
  231.     }
  232.     return $html;
  233. }
  234.  
  235. /**
  236.  * Generate and display markup for form fields
  237.  * @param array $var Array containing informaoin about the field
  238.  * @param int $num_fields The number of fields total we'll be generating markup for. Used in calculating required text logic
  239.  * @return void
  240.  */
  241. function mailchimp_form_field($var, $num_fields) {
  242.     $opt = 'mc_mv_'.$var['tag'];
  243.     $html = '';
  244.     // See if that var is set as required, or turned on (for display)
  245.     if ($var['req'] || get_option($opt) == 'on') {
  246.         $label = '<label for="'.esc_attr($opt).'" class="mc_var_label">'.esc_html($var['name']);
  247.         if ($var['req'] && $num_fields > 1) {
  248.             $label .= '<span class="mc_required">*</span>';
  249.         }
  250.         $label .= '</label>';
  251.    
  252.         $html .= '
  253. <div class="mc_merge_var">
  254.         '.$label;
  255.    
  256.         switch ($var['field_type']) {
  257.             case 'date':
  258.                 $html .= '
  259.     <input type="text" size="18" value="'.esc_attr($var['default']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="date-pick mc_input"/>';
  260.                 break;
  261.             case 'radio':
  262.                 if (is_array($var['choices'])) {
  263.                     $html .= '
  264.     <ul class="mc_list">';
  265.                     foreach ($var['choices'] as $key => $value) {
  266.                         $html .= '
  267.         <li>
  268.             <input type="radio" id="'.esc_attr($opt.'_'.$key).'" name="'.esc_attr($opt).'" class="mc_radio" value="'.$value.'"'.checked($var['default'], $value, false).' />
  269.             <label for="'.esc_attr($opt.'_'.$key).'" class="mc_radio_label">'.esc_html($value).'</label>
  270.         </li>';
  271.                     }
  272.                     $html .= '
  273.     </ul>';
  274.                 }
  275.                 break;
  276.             case 'dropdown':
  277.                 if (is_array($var['choices'])) {
  278.                     $html .= '
  279.     <br /><select id="'.esc_attr($opt).'" name="'.esc_attr($opt).'" class="mc_select">';
  280.                     foreach ($var['choices'] as $value) {
  281.                         $html .= '
  282.         <option value="'.esc_attr($value).'"'.selected($value, $var['default'], false).'>'.esc_html($value).'</option>';
  283.                     }
  284.                     $html .= '
  285.     </select>';
  286.                 }
  287.                 break;
  288.             case 'birthday':
  289.                 $html .= '
  290.     <input type="text" size="18" value="'.esc_attr($var['default']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="birthdate-pick mc_input"/>';
  291.                 break;
  292.             case 'birthday-old':
  293.                 $days = range(1, 31);
  294.                 $months = array(__('January', 'mailchimp_i18n'), __('February', 'mailchimp_i18n'), __('March', 'mailchimp_i18n'), __('April', 'mailchimp_i18n'), __('May', 'mailchimp_i18n'), __('June', 'mailchimp_i18n'), __('July', 'mailchimp_i18n'), __('August', 'mailchimp_i18n'), __('September', 'mailchimp_i18n'), __('October', 'mailchimp_i18n'), __('November', 'mailchimp_i18n'), __('December', 'mailchimp_i18n'), );
  295.                
  296.                 $html .= '
  297.     <br /><select id="'.esc_attr($opt).'" name="'.esc_attr($opt.'[month]').'" class="mc_select">';
  298.                 foreach ($months as $month_key => $month) {
  299.                     $html .= '
  300.         <option value="'.$month_key.'">'.$month.'</option>';
  301.                 }
  302.                 $html .= '
  303.     </select>';
  304.    
  305.                 $html .= '
  306.     <select id="'.esc_attr($opt).'" name="'.esc_attr($opt.'[day]').'" class="mc_select">';
  307.                 foreach ($days as $day) {
  308.                         $html .= '
  309.         <option value="'.$day.'">'.$day.'</option>';
  310.                     }          
  311.                 $html .= '
  312.     </select>';
  313.                 break;
  314.             case 'address':
  315.             $countries = mailchimp_country_list();
  316.             $html .= '
  317.     <br />
  318.     <label for="'.esc_attr($opt.'-addr1').'" class="mc_address_label">'.__('Street Address', 'mailchimp_i18n').'</label> <br />
  319.     <input type="text" size="18" value="" name="'.esc_attr($opt.'[addr1]').'" id="'.esc_attr($opt.'-addr1').'" class="mc_input" /> <br />
  320.     <label for="'.esc_attr($opt.'-addr2').'" class="mc_address_label">'.__('Address Line 2', 'mailchimp_i18n').'</label> <br />
  321.     <input type="text" size="18" value="" name="'.esc_attr($opt.'[addr2]').'" id="'.esc_attr($opt.'-addr2').'" class="mc_input" /> <br />
  322.     <label for="'.esc_attr($opt.'-city').'" class="mc_address_label">'.__('City', 'mailchimp_i18n').'</label>   <br />
  323.     <input type="text" size="18" value="" name="'.esc_attr($opt.'[city]').'" id="'.esc_attr($opt.'-city').'" class="mc_input" /> <br />
  324.     <label for="'.esc_attr($opt.'-state').'" class="mc_address_label">'.__('State', 'mailchimp_i18n').'</label> <br />
  325.     <input type="text" size="18" value="" name="'.esc_attr($opt.'[state]').'" id="'.esc_attr($opt.'-state').'" class="mc_input" /> <br />
  326.     <label for="'.esc_attr($opt.'-zip').'" class="mc_address_label">'.__('Zip / Postal', 'mailchimp_i18n').'</label> <br />
  327.     <input type="text" size="18" value="" maxlength="5" name="'.esc_attr($opt.'[zip]').'" id="'.esc_attr($opt.'-zip').'" class="mc_input" /> <br />
  328.     <label for="'.esc_attr($opt.'-country').'" class="mc_address_label">'.__('Country', 'mailchimp_i18n').'</label> <br />
  329.     <select name="'.esc_attr($opt.'[country]').'" id="'.esc_attr($opt.'-country').'">';
  330.             foreach ($countries as $country_code => $country_name) {
  331.                 $html .= '
  332.         <option value="'.esc_attr($country_code).'"'.selected($country_code, $var['defaultcountry'], false).'>'.esc_html($country_name).'</option>';
  333.             }
  334.             $html .= '
  335.     </select>';
  336.                 break;
  337.             case 'zip':
  338.                 $html .= '
  339.     <input type="text" size="18" maxlength="5" value="" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="mc_input" />';
  340.                 break;
  341.             case 'phone':
  342.                 $html .= '<br />
  343.     &#40; <input type="text" size="3" maxlength="3" value="" name="'.esc_attr($opt.'[area]').'" id="'.esc_attr($opt.'-area').'" class="mc_input mc_phone" /> &#41; &ndash;
  344.     <input type="text" size="3" maxlength="3" value="" name="'.esc_attr($opt.'[detail1]').'" id="'.esc_attr($opt.'-detail1').'" class="mc_input mc_phone" /> &ndash;
  345.     <input type="text" size="4" maxlength="4" value="" name="'.esc_attr($opt.'[detail2]').'" id="'.esc_attr($opt.'-detail2').'" class="mc_input mc_phone" />
  346.             ';
  347.                 break;
  348.             case 'email':
  349.             case 'url':
  350.             case 'imageurl':
  351.             case 'text':
  352.             case 'number':
  353.             default:
  354.                 $html .= '
  355.     <input type="text" size="18" value="'.esc_html($var['default']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="mc_input"/>';
  356.                 break;
  357.         }
  358.         if (!empty($var['helptext'])) {
  359.             $html .= '<span class="mc_help">'.esc_html($var['helptext']).'</span>';
  360.         }
  361.         $html .= '
  362. </div><!-- /mc_merge_var -->';
  363.     }
  364.    
  365.     return $html;
  366. }
  367.  
  368. /**
  369.  * MailChimp Subscribe Box widget class
  370.  */
  371. class mailchimpSF_Widget extends WP_Widget {
  372.  
  373.     function mailchimpSF_Widget() {
  374.         $widget_ops = array(
  375.             'description' => __('Displays a MailChimp Subscribe box', 'mailchimp_i18n')
  376.         );
  377.         $this->WP_Widget('mailchimpSF_widget', __('MailChimp Widget', 'mailchimp_i18n'), $widget_ops);
  378.     }
  379.  
  380.     function widget( $args, $instance ) {
  381.         if (!is_array($instance)) {
  382.             $instance = array();
  383.         }
  384.         echo mailchimpSF_signup_form(array_merge($args, $instance));
  385.     }
  386. }
  387.  
  388. function mailchimp_country_list() {
  389.     return array(
  390.         '164' => __('USA', 'mailchimp_i18n'),
  391.         '286' => __('Aaland Islands', 'mailchimp_i18n'),
  392.         '274' => __('Afghanistan', 'mailchimp_i18n'),
  393.         '2' => __('Albania', 'mailchimp_i18n'),
  394.         '3' => __('Algeria', 'mailchimp_i18n'),
  395.         '178' => __('American Samoa', 'mailchimp_i18n'),
  396.         '4' => __('Andorra', 'mailchimp_i18n'),
  397.         '5' => __('Angola', 'mailchimp_i18n'),
  398.         '176' => __('Anguilla', 'mailchimp_i18n'),
  399.         '175' => __('Antigua And Barbuda', 'mailchimp_i18n'),
  400.         '6' => __('Argentina', 'mailchimp_i18n'),
  401.         '7' => __('Armenia', 'mailchimp_i18n'),
  402.         '179' => __('Aruba', 'mailchimp_i18n'),
  403.         '8' => __('Australia', 'mailchimp_i18n'),
  404.         '9' => __('Austria', 'mailchimp_i18n'),
  405.         '10' => __('Azerbaijan', 'mailchimp_i18n'),
  406.         '11' => __('Bahamas', 'mailchimp_i18n'),
  407.         '12' => __('Bahrain', 'mailchimp_i18n'),
  408.         '13' => __('Bangladesh', 'mailchimp_i18n'),
  409.         '14' => __('Barbados', 'mailchimp_i18n'),
  410.         '15' => __('Belarus', 'mailchimp_i18n'),
  411.         '16' => __('Belgium', 'mailchimp_i18n'),
  412.         '17' => __('Belize', 'mailchimp_i18n'),
  413.         '18' => __('Benin', 'mailchimp_i18n'),
  414.         '19' => __('Bermuda', 'mailchimp_i18n'),
  415.         '20' => __('Bhutan', 'mailchimp_i18n'),
  416.         '21' => __('Bolivia', 'mailchimp_i18n'),
  417.         '22' => __('Bosnia and Herzegovina', 'mailchimp_i18n'),
  418.         '23' => __('Botswana', 'mailchimp_i18n'),
  419.         '24' => __('Brazil', 'mailchimp_i18n'),
  420.         '180' => __('Brunei Darussalam', 'mailchimp_i18n'),
  421.         '25' => __('Bulgaria', 'mailchimp_i18n'),
  422.         '26' => __('Burkina Faso', 'mailchimp_i18n'),
  423.         '27' => __('Burundi', 'mailchimp_i18n'),
  424.         '28' => __('Cambodia', 'mailchimp_i18n'),
  425.         '29' => __('Cameroon', 'mailchimp_i18n'),
  426.         '30' => __('Canada', 'mailchimp_i18n'),
  427.         '31' => __('Cape Verde', 'mailchimp_i18n'),
  428.         '32' => __('Cayman Islands', 'mailchimp_i18n'),
  429.         '33' => __('Central African Republic', 'mailchimp_i18n'),
  430.         '34' => __('Chad', 'mailchimp_i18n'),
  431.         '35' => __('Chile', 'mailchimp_i18n'),
  432.         '36' => __('China', 'mailchimp_i18n'),
  433.         '37' => __('Colombia', 'mailchimp_i18n'),
  434.         '38' => __('Congo', 'mailchimp_i18n'),
  435.         '183' => __('Cook Islands', 'mailchimp_i18n'),
  436.         '268' => __('Costa Rica', 'mailchimp_i18n'),
  437.         '275' => __('Cote D\'Ivoire', 'mailchimp_i18n'),
  438.         '40' => __('Croatia', 'mailchimp_i18n'),
  439.         '276' => __('Cuba', 'mailchimp_i18n'),
  440.         '41' => __('Cyprus', 'mailchimp_i18n'),
  441.         '42' => __('Czech Republic', 'mailchimp_i18n'),
  442.         '43' => __('Denmark', 'mailchimp_i18n'),
  443.         '44' => __('Djibouti', 'mailchimp_i18n'),
  444.         '289' => __('Dominica', 'mailchimp_i18n'),
  445.         '187' => __('Dominican Republic', 'mailchimp_i18n'),
  446.         '233' => __('East Timor', 'mailchimp_i18n'),
  447.         '45' => __('Ecuador', 'mailchimp_i18n'),
  448.         '46' => __('Egypt', 'mailchimp_i18n'),
  449.         '47' => __('El Salvador', 'mailchimp_i18n'),
  450.         '48' => __('Equatorial Guinea', 'mailchimp_i18n'),
  451.         '49' => __('Eritrea', 'mailchimp_i18n'),
  452.         '50' => __('Estonia', 'mailchimp_i18n'),
  453.         '51' => __('Ethiopia', 'mailchimp_i18n'),
  454.         '191' => __('Faroe Islands', 'mailchimp_i18n'),
  455.         '52' => __('Fiji', 'mailchimp_i18n'),
  456.         '53' => __('Finland', 'mailchimp_i18n'),
  457.         '54' => __('France', 'mailchimp_i18n'),
  458.         '277' => __('French Polynesia', 'mailchimp_i18n'),
  459.         '59' => __('Germany', 'mailchimp_i18n'),
  460.         '60' => __('Ghana', 'mailchimp_i18n'),
  461.         '194' => __('Gibraltar', 'mailchimp_i18n'),
  462.         '61' => __('Greece', 'mailchimp_i18n'),
  463.         '195' => __('Greenland', 'mailchimp_i18n'),
  464.         '192' => __('Grenada', 'mailchimp_i18n'),
  465.         '62' => __('Guam', 'mailchimp_i18n'),
  466.         '198' => __('Guatemala', 'mailchimp_i18n'),
  467.         '270' => __('Guernsey', 'mailchimp_i18n'),
  468.         '65' => __('Guyana', 'mailchimp_i18n'),
  469.         '200' => __('Haiti', 'mailchimp_i18n'),
  470.         '66' => __('Honduras', 'mailchimp_i18n'),
  471.         '67' => __('Hong Kong', 'mailchimp_i18n'),
  472.         '68' => __('Hungary', 'mailchimp_i18n'),
  473.         '69' => __('Iceland', 'mailchimp_i18n'),
  474.         '70' => __('India', 'mailchimp_i18n'),
  475.         '71' => __('Indonesia', 'mailchimp_i18n'),
  476.         '278' => __('Iran', 'mailchimp_i18n'),
  477.         '279' => __('Iraq', 'mailchimp_i18n'),
  478.         '74' => __('Ireland', 'mailchimp_i18n'),
  479.         '75' => __('Israel', 'mailchimp_i18n'),
  480.         '76' => __('Italy', 'mailchimp_i18n'),
  481.         '202' => __('Jamaica', 'mailchimp_i18n'),
  482.         '78' => __('Japan', 'mailchimp_i18n'),
  483.         '288' => __('Jersey  (Channel Islands)', 'mailchimp_i18n'),
  484.         '79' => __('Jordan', 'mailchimp_i18n'),
  485.         '80' => __('Kazakhstan', 'mailchimp_i18n'),
  486.         '81' => __('Kenya', 'mailchimp_i18n'),
  487.         '82' => __('Kuwait', 'mailchimp_i18n'),
  488.         '83' => __('Kyrgyzstan', 'mailchimp_i18n'),
  489.         '84' => __('Lao People\'s Democratic Republic', 'mailchimp_i18n'),
  490.         '85' => __('Latvia', 'mailchimp_i18n'),
  491.         '86' => __('Lebanon', 'mailchimp_i18n'),
  492.         '281' => __('Libya', 'mailchimp_i18n'),
  493.         '90' => __('Liechtenstein', 'mailchimp_i18n'),
  494.         '91' => __('Lithuania', 'mailchimp_i18n'),
  495.         '92' => __('Luxembourg', 'mailchimp_i18n'),
  496.         '208' => __('Macau', 'mailchimp_i18n'),
  497.         '93' => __('Macedonia', 'mailchimp_i18n'),
  498.         '94' => __('Madagascar', 'mailchimp_i18n'),
  499.         '95' => __('Malawi', 'mailchimp_i18n'),
  500.         '96' => __('Malaysia', 'mailchimp_i18n'),
  501.         '97' => __('Maldives', 'mailchimp_i18n'),
  502.         '98' => __('Mali', 'mailchimp_i18n'),
  503.         '99' => __('Malta', 'mailchimp_i18n'),
  504.         '212' => __('Mauritius', 'mailchimp_i18n'),
  505.         '101' => __('Mexico', 'mailchimp_i18n'),
  506.         '102' => __('Moldova, Republic of', 'mailchimp_i18n'),
  507.         '103' => __('Monaco', 'mailchimp_i18n'),
  508.         '104' => __('Mongolia', 'mailchimp_i18n'),
  509.         '290' => __('Montenegro', 'mailchimp_i18n'),
  510.         '105' => __('Morocco', 'mailchimp_i18n'),
  511.         '106' => __('Mozambique', 'mailchimp_i18n'),
  512.         '242' => __('Myanmar', 'mailchimp_i18n'),
  513.         '107' => __('Namibia', 'mailchimp_i18n'),
  514.         '108' => __('Nepal', 'mailchimp_i18n'),
  515.         '109' => __('Netherlands', 'mailchimp_i18n'),
  516.         '110' => __('Netherlands Antilles', 'mailchimp_i18n'),
  517.         '213' => __('New Caledonia', 'mailchimp_i18n'),
  518.         '111' => __('New Zealand', 'mailchimp_i18n'),
  519.         '112' => __('Nicaragua', 'mailchimp_i18n'),
  520.         '113' => __('Niger', 'mailchimp_i18n'),
  521.         '114' => __('Nigeria', 'mailchimp_i18n'),
  522.         '272' => __('North Korea', 'mailchimp_i18n'),
  523.         '116' => __('Norway', 'mailchimp_i18n'),
  524.         '117' => __('Oman', 'mailchimp_i18n'),
  525.         '118' => __('Pakistan', 'mailchimp_i18n'),
  526.         '222' => __('Palau', 'mailchimp_i18n'),
  527.         '282' => __('Palestine', 'mailchimp_i18n'),
  528.         '119' => __('Panama', 'mailchimp_i18n'),
  529.         '219' => __('Papua New Guinea', 'mailchimp_i18n'),
  530.         '120' => __('Paraguay', 'mailchimp_i18n'),
  531.         '121' => __('Peru', 'mailchimp_i18n'),
  532.         '122' => __('Philippines', 'mailchimp_i18n'),
  533.         '123' => __('Poland', 'mailchimp_i18n'),
  534.         '124' => __('Portugal', 'mailchimp_i18n'),
  535.         '126' => __('Qatar', 'mailchimp_i18n'),
  536.         '58' => __('Republic of Georgia', 'mailchimp_i18n'),
  537.         '128' => __('Romania', 'mailchimp_i18n'),
  538.         '129' => __('Russia', 'mailchimp_i18n'),
  539.         '130' => __('Rwanda', 'mailchimp_i18n'),
  540.         '205' => __('Saint Kitts and Nevis', 'mailchimp_i18n'),
  541.         '206' => __('Saint Lucia', 'mailchimp_i18n'),
  542.         '132' => __('Samoa (Independent)', 'mailchimp_i18n'),
  543.         '227' => __('San Marino', 'mailchimp_i18n'),
  544.         '133' => __('Saudi Arabia', 'mailchimp_i18n'),
  545.         '134' => __('Senegal', 'mailchimp_i18n'),
  546.         '266' => __('Serbia', 'mailchimp_i18n'),
  547.         '135' => __('Seychelles', 'mailchimp_i18n'),
  548.         '137' => __('Singapore', 'mailchimp_i18n'),
  549.         '138' => __('Slovakia', 'mailchimp_i18n'),
  550.         '139' => __('Slovenia', 'mailchimp_i18n'),
  551.         '223' => __('Solomon Islands', 'mailchimp_i18n'),
  552.         '141' => __('South Africa', 'mailchimp_i18n'),
  553.         '142' => __('South Korea', 'mailchimp_i18n'),
  554.         '143' => __('Spain', 'mailchimp_i18n'),
  555.         '144' => __('Sri Lanka', 'mailchimp_i18n'),
  556.         '293' => __('Sudan', 'mailchimp_i18n'),
  557.         '146' => __('Suriname', 'mailchimp_i18n'),
  558.         '147' => __('Swaziland', 'mailchimp_i18n'),
  559.         '148' => __('Sweden', 'mailchimp_i18n'),
  560.         '149' => __('Switzerland', 'mailchimp_i18n'),
  561.         '152' => __('Taiwan', 'mailchimp_i18n'),
  562.         '153' => __('Tanzania', 'mailchimp_i18n'),
  563.         '154' => __('Thailand', 'mailchimp_i18n'),
  564.         '155' => __('Togo', 'mailchimp_i18n'),
  565.         '232' => __('Tonga', 'mailchimp_i18n'),
  566.         '234' => __('Trinidad and Tobago', 'mailchimp_i18n'),
  567.         '156' => __('Tunisia', 'mailchimp_i18n'),
  568.         '157' => __('Turkey', 'mailchimp_i18n'),
  569.         '287' => __('Turks &amp; Caicos Islands', 'mailchimp_i18n'),
  570.         '159' => __('Uganda', 'mailchimp_i18n'),
  571.         '161' => __('Ukraine', 'mailchimp_i18n'),
  572.         '162' => __('United Arab Emirates', 'mailchimp_i18n'),
  573.         '262' => __('United Kingdom', 'mailchimp_i18n'),
  574.         '163' => __('Uruguay', 'mailchimp_i18n'),
  575.         '239' => __('Vanuatu', 'mailchimp_i18n'),
  576.         '166' => __('Vatican City State (Holy See)', 'mailchimp_i18n'),
  577.         '167' => __('Venezuela', 'mailchimp_i18n'),
  578.         '168' => __('Vietnam', 'mailchimp_i18n'),
  579.         '169' => __('Virgin Islands (British)', 'mailchimp_i18n'),
  580.         '238' => __('Virgin Islands (U.S.)', 'mailchimp_i18n'),
  581.         '173' => __('Zambia', 'mailchimp_i18n'),
  582.         '174' => __('Zimbabwe', 'mailchimp_i18n'),
  583.     );
  584. }
  585. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement