Version Description
- November 3, 2014 =
Updates
- Release v5.1
- Added brand new templating framework, to allow users to create custom form templates for use with any MailChimp List
- Re-style Manage List page
- Added missing label to radio buttons inside the form
- Added missing closing parentheses on subscriber count inside view subscribers page
- Added custom color picker to easily stylize forms without writing a single line of code
- Added ability to specify a custom class names for each field of the form ( easily add custom class names to MailChimp form fields for further customization )
- Only run API Key check when a new key is entered ( not on each page load )
- Added new Welcome page with features+update notifications for users
- Security vulnerability re-patched - props @g0blinResearch for privately disclosing the potential vulnerability
- Added
yks_redirect_add_post_types
filter, to allow custom post types to be added to the redirect drop down (view docs for example) - Added
yikes_mc_user_already_subscribed
filter to allow users to alter the message displayed to the user when they are already subscribed to a given list (view docs for example) - Added
yikes_mc_subscriber_update_message
filter, to alter the success message when a user updates their account information for a given list (view docs for example) - Added a new link to allow users to update profile information if previously subscribed to a given list
- Added 5 bundled templates, and 2 boilerplate files for users to use as a starting point for new templates
Download this release
Release Info
Developer | eherman24 |
Plugin | Easy Forms for MailChimp |
Version | 5.1 |
Comparing to | |
See all releases |
Code changes from version 5.0.9 to 5.1
- classes/class.yksemeBase.php +1227 -389
- css/style.ykseme.css +200 -20
- images/Thumbs.db +0 -0
- images/pagination/Thumbs.db +0 -0
- images/smoothness/Thumbs.db +0 -0
- images/welcome_page/Custom_Templates.jpg +0 -0
- images/welcome_page/Form_Customizer.jpg +0 -0
- images/welcome_page/Manage_List_Styles.jpg +0 -0
- images/welcome_page/browse_subscribers.jpg +0 -0
- images/welcome_page/custom_class_names.jpg +0 -0
- images/welcome_page/slide_images/header_optin_template_city_skyline.jpg +0 -0
- images/welcome_page/slide_images/header_optin_template_sub-head-bar.jpg +0 -0
- images/welcome_page/slide_images/header_optin_template_vacation.jpg +0 -0
- images/welcome_page/track_stats.jpg +0 -0
- js/jquery.1.7.1.min.js +0 -4
- lib/lib.ajax.php +5 -1
- pages/lists.php +261 -23
- pages/options.php +27 -9
- pages/welcome.php +427 -0
- process/ajax.php +0 -12
- process/public.ajax.php +12 -1
- readme.md +0 -588
- readme.txt +151 -7
- templates/form_template.php +10 -0
- templates/mailChimpChatter-widget-template.php +127 -127
- templates/shortcode_form.php +228 -40
- templates/yikes-mailchimp-bundled-templates/Clean_Blue/clean_blue_form.css +219 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Blue/clean_blue_template.jpg +0 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Blue/clean_blue_template.php +37 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Blue/images/check_radio_sheet_blue.png +0 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/clean_green_with_icons.css +297 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/clean_green_with_icons_template.jpg +0 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/clean_green_with_icons_template.php +35 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/calendar.png +0 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/check_radio_sheet_green.png +0 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/home.png +0 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/mail.png +0 -0
- templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/pen.png +0 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/header_optin_template_city_skyline.css +105 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/header_optin_template_city_skyline.jpg +0 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/header_optin_template_city_skyline.php +56 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/images/city_skyline.jpg +0 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/header_optin_form_sub_header_bar.css +137 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/header_optin_form_sub_header_bar.jpg +0 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/header_optin_form_sub_header_bar.php +51 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/images/simple_dashed.png +0 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/header_optin_template_vacation.css +103 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/header_optin_template_vacation.jpg +0 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/header_optin_template_vacation.php +69 -0
- templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/images/island_background.jpg +0 -0
- templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Header/custom_header_template_boilerplate.css +127 -0
- templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Header/custom_header_template_boilerplate.php +63 -0
- templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Header/images/square_bg.png +0 -0
- templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Standard/custom_template_boilerplate.css +71 -0
- templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Standard/custom_template_boilerplate.php +49 -0
- templates/yikes-mailchimp-widget.php +3 -3
- yikes-inc-easy-mailchimp-extender.php +2 -2
classes/class.yksemeBase.php
CHANGED
@@ -78,17 +78,26 @@ public function initialize()
|
|
78 |
// custom Dashboard MailChimp Account Activity Widget
|
79 |
add_action( 'wp_dashboard_setup', array( &$this , 'yks_mc_add_chimp_chatter_dashboard_widget' ) );
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
87 |
// adding our custom content action
|
88 |
// used to prevent other plugins from hooking
|
89 |
// into the_content (such as jetpack sharedadddy, sharethis etc.)
|
90 |
add_action( 'init', array( &$this, 'yks_mc_content' ), 1 );
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
|
94 |
// tinymce buttons
|
@@ -110,14 +119,20 @@ public function initialize()
|
|
110 |
}
|
111 |
if(!is_admin())
|
112 |
{
|
113 |
-
add_action('wp_print_styles', array(&$this, 'addStyles_frontend'));
|
114 |
-
add_action('wp_print_scripts', array(&$this, 'addScripts_frontend'));
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
}
|
116 |
// Setup the administration menus
|
117 |
add_action('admin_menu', array(&$this, 'addAdministrationMenu'));
|
118 |
// Make sure the option exists
|
119 |
if(!$this->optionVal) $this->getOptionValue();
|
120 |
-
// Setup
|
121 |
$this->createShortcodes();
|
122 |
// Initialize current list array
|
123 |
$this->currentLists = array();
|
@@ -127,10 +142,24 @@ public function initialize()
|
|
127 |
// Register Our Widget
|
128 |
$this->registerMailChimpWidget($this->optionVal['lists']);
|
129 |
}
|
|
|
|
|
130 |
public function createShortcodes()
|
131 |
{
|
132 |
add_shortcode('yks-mailchimp-list', array(&$this, 'processShortcode'));
|
|
|
133 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
// Create and store our initial plugin options
|
135 |
public function getOptionValue()
|
136 |
{
|
@@ -243,9 +272,6 @@ public function getImportedFieldsArray($lid, $mv)
|
|
243 |
'type' => $field['field_type'],
|
244 |
'help' => $field['helptext'],
|
245 |
'default' => $field['default'],
|
246 |
-
'placeholder' => (isset($field['placeholder-'.$lid.'-'.$num]) ? $field['placeholder-'.$lid.'-'.$num] : ''),
|
247 |
-
'redirect_checkbox' => (isset($field['yks_mailchimp_redirect_'.$lid]) ? $field['yks_mailchimp_redirect_'.$lid] : ''),
|
248 |
-
'selected_page' => (isset($field['page_id_'.$lid]) ? $field['page_id_'.$lid] : ''),
|
249 |
'choices' => (isset($field['choices']) ? $field['choices'] : '')
|
250 |
);
|
251 |
$fields[$addField['id']] = $addField;
|
@@ -393,6 +419,8 @@ public function updateOptions($p)
|
|
393 |
$this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
|
394 |
$this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
|
395 |
$this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
|
|
|
|
|
396 |
update_option('api_validation', 'valid_api_key');
|
397 |
return update_option(YKSEME_OPTION, $this->optionVal);
|
398 |
} else {
|
@@ -405,6 +433,7 @@ public function updateOptions($p)
|
|
405 |
$this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
|
406 |
$this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
|
407 |
$this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
|
|
|
408 |
update_option('api_validation', 'valid_api_key');
|
409 |
// if the new API key differs from the old one
|
410 |
// we need to unset the previously set up widgets
|
@@ -701,7 +730,7 @@ public function getInterestGroups($list_id)
|
|
701 |
echo $user_set_interest_group_label;
|
702 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
703 |
$checkboxValue = $interest_group['name'];
|
704 |
-
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'">'.$singleGrouping['name'].'</label>';
|
705 |
}
|
706 |
echo '</td>';
|
707 |
echo '</tr>';
|
@@ -715,7 +744,7 @@ public function getInterestGroups($list_id)
|
|
715 |
echo $user_set_interest_group_label;
|
716 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
717 |
$radioValue = $interest_group['name'];
|
718 |
-
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'">'.$singleGrouping['name'].'</label>';
|
719 |
}
|
720 |
echo '</td>';
|
721 |
echo '</tr>';
|
@@ -768,7 +797,7 @@ public function getInterestGroups($list_id)
|
|
768 |
echo '<div class="yks_mc_interest_group_holder">';
|
769 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
770 |
$checkboxValue = $interest_group['name'];
|
771 |
-
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'">'.$singleGrouping['name'].'</label>';
|
772 |
}
|
773 |
echo '</div>';
|
774 |
break;
|
@@ -779,7 +808,7 @@ public function getInterestGroups($list_id)
|
|
779 |
echo '<div class="yks_mc_interest_radio_button_holder">';
|
780 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
781 |
$radioValue = $interest_group['name'];
|
782 |
-
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'">'.$singleGrouping['name'].'</label>';
|
783 |
}
|
784 |
echo '</div>';
|
785 |
echo '</div>';
|
@@ -981,14 +1010,68 @@ public function updateList($p)
|
|
981 |
// $name = $this->slugify($field['label'].'-'.$field['tag']);
|
982 |
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num] = $fd['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num];
|
983 |
|
|
|
|
|
|
|
984 |
$num++;
|
985 |
|
986 |
-
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']] = $fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']];
|
987 |
|
988 |
if(isset($fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']])) {
|
989 |
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['page_id_'.$fd['yks-mailchimp-unique-id']] = $fd['page_id_'.$fd['yks-mailchimp-unique-id']];
|
990 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
991 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
992 |
}
|
993 |
return update_option(YKSEME_OPTION, $this->optionVal);
|
994 |
}
|
@@ -1023,8 +1106,6 @@ public function importList($i=false)
|
|
1023 |
)
|
1024 |
);
|
1025 |
// if merge variables are returned
|
1026 |
-
if($mv)
|
1027 |
-
{
|
1028 |
$mv = $this->getImportedFieldsArray($lid, $mv);
|
1029 |
if($mv)
|
1030 |
{
|
@@ -1035,10 +1116,44 @@ public function importList($i=false)
|
|
1035 |
return $this->generateListContainers(array($this->optionVal['lists'][$i]));
|
1036 |
}
|
1037 |
}
|
1038 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1039 |
}
|
1040 |
return false;
|
1041 |
}
|
|
|
1042 |
// Make a call to the MailChimp API to retrieve all subscribers to a given list
|
1043 |
// Runs when the user clicks 'view' next to the subscriber count on the list page
|
1044 |
public function listAllSubscribers($lid, $list_name) {
|
@@ -1057,7 +1172,7 @@ public function listAllSubscribers($lid, $list_name) {
|
|
1057 |
// display all subscribers in a table
|
1058 |
if($subscribers_list['total'] > 0) {
|
1059 |
?>
|
1060 |
-
<h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">'.$subscribers_list['total'].'</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").'</span>'; ?></h2>
|
1061 |
<p><?php _e( 'Click on a subscriber to see further information' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
|
1062 |
|
1063 |
<table id="yikes-mailchimp-subscribers-table" class="yks-mailchimp-fields-list" style="width:100%;">
|
@@ -1083,7 +1198,7 @@ public function listAllSubscribers($lid, $list_name) {
|
|
1083 |
<?php
|
1084 |
} else { // else display an error of sorts
|
1085 |
?>
|
1086 |
-
<h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">0</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").'</span>'; ?></h2>
|
1087 |
<?php
|
1088 |
_e( "Sorry You Don't Currently Have Any Subscribers In This List!" , "yikes-inc-easy-mailchimp-extender" );
|
1089 |
}
|
@@ -1289,9 +1404,8 @@ public function addStyles()
|
|
1289 |
{
|
1290 |
|
1291 |
$screen_base = get_current_screen()->base;
|
1292 |
-
|
1293 |
-
|
1294 |
-
|| $screen_base == 'mailchimp-forms_page_yks-mailchimp-form-lists' || $screen_base == 'widgets' || $screen_base == 'post' ) {
|
1295 |
// Register Styles
|
1296 |
wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
|
1297 |
wp_register_style('jquery-datatables-pagination', YKSEME_URL.'css/jquery.dataTables.css', array(), '1.0.0', 'all');
|
@@ -1299,18 +1413,29 @@ public function addStyles()
|
|
1299 |
wp_enqueue_style('thickbox');
|
1300 |
wp_enqueue_style('ykseme-css-base');
|
1301 |
wp_enqueue_style('jquery-datatables-pagination');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1302 |
}
|
1303 |
|
1304 |
-
// just load the animate.css class on all admin pages
|
1305 |
-
wp_register_style('ykseme-animate-css', YKSEME_URL.'css/animate.css', array(), '1.0.0', 'all');
|
1306 |
-
wp_enqueue_style('ykseme-animate-css');
|
1307 |
}
|
1308 |
|
1309 |
public function addStyles_frontend()
|
1310 |
{
|
1311 |
// Register Styles
|
1312 |
wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
|
1313 |
-
|
|
|
|
|
|
|
|
|
1314 |
wp_register_style('ykseme-animate-css', YKSEME_URL.'css/animate.css', array(), '1.0.0', 'all');
|
1315 |
// Enqueue Styles
|
1316 |
wp_enqueue_style('ykseme-css-base');
|
@@ -1323,14 +1448,31 @@ public function addScripts()
|
|
1323 |
{
|
1324 |
|
1325 |
$screen_base = get_current_screen()->base;
|
1326 |
-
|
1327 |
-
if ( $screen_base == 'toplevel_page_yks-mailchimp-form' || $screen_base == 'mailchimp-forms_page_yks-mailchimp-my-mailchimp'
|
1328 |
-
|| $screen_base == 'mailchimp-forms_page_yks-mailchimp-form-lists' ) {
|
1329 |
// Everything else
|
1330 |
// load our scripts in the dashboard
|
1331 |
wp_enqueue_script('jquery-ui-core');
|
1332 |
wp_enqueue_script('thickbox');
|
1333 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1334 |
wp_enqueue_script('jquery-ui-sortable');
|
1335 |
wp_enqueue_script('jquery-ui-tabs');
|
1336 |
wp_enqueue_script('ykseme-base', YKSEME_URL.'js/script.ykseme.js', array('jquery'));
|
@@ -1345,6 +1487,7 @@ public function addScripts()
|
|
1345 |
} else {
|
1346 |
return;
|
1347 |
}
|
|
|
1348 |
}
|
1349 |
|
1350 |
// redirect the user to the settings page on initial activation
|
@@ -1352,12 +1495,15 @@ public function addScripts()
|
|
1352 |
if (get_option('yks_easy_mc_plugin_do_activation_redirect', false)) {
|
1353 |
delete_option('yks_easy_mc_plugin_do_activation_redirect');
|
1354 |
// redirect to settings page
|
1355 |
-
wp_redirect(admin_url('/admin.php?page=yks-mailchimp-
|
1356 |
}
|
1357 |
}
|
1358 |
|
1359 |
public function addScripts_frontend()
|
1360 |
{
|
|
|
|
|
|
|
1361 |
global $wp_scripts;
|
1362 |
|
1363 |
$version ='1.9.0';
|
@@ -1375,9 +1521,15 @@ public function addScripts_frontend()
|
|
1375 |
wp_enqueue_script( 'jquery' );
|
1376 |
}
|
1377 |
}
|
|
|
1378 |
// Everything else
|
1379 |
-
wp_enqueue_script('jquery-ui-core');
|
1380 |
-
|
|
|
|
|
|
|
|
|
|
|
1381 |
}
|
1382 |
|
1383 |
|
@@ -1386,31 +1538,62 @@ public function addScripts_frontend()
|
|
1386 |
// Function to process the shortcode provided by the plugin
|
1387 |
// $p is the data associated with the shortcode (ie: form id and submit button text)
|
1388 |
public function processShortcode($p)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1389 |
{
|
1390 |
ob_start();
|
1391 |
if($this->optionVal['api-key'] != ''
|
1392 |
&& (is_array($this->optionVal['lists'][$p['id']]) && !empty($this->optionVal['lists'][$p['id']])))
|
1393 |
{
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
$
|
1400 |
-
|
1401 |
-
|
1402 |
-
$listCt = $this->currentLists[$p['id']];
|
1403 |
-
// Add the count to the list vars
|
1404 |
-
$list['id'] = $listCt.'-'.$list['id'];
|
1405 |
-
if(count($list['fields']))
|
1406 |
-
{
|
1407 |
-
foreach($list['fields'] as $fieldId => $field)
|
1408 |
-
{
|
1409 |
-
$list['fields'][$fieldId]['id'] = $listCt.'-'.$field['id'];
|
1410 |
-
}
|
1411 |
-
}
|
1412 |
-
// List form
|
1413 |
-
include YKSEME_PATH.'templates/shortcode_form.php';
|
1414 |
}
|
1415 |
// if there is no api key entered, or it's an invalid api key
|
1416 |
else if ( $this->optionVal['api-key'] == '' || get_option( 'api_validation' ) == 'invalid_api_key' )
|
@@ -1441,7 +1624,7 @@ public function processSnippet($list=false, $submit_text)
|
|
1441 |
public function addAdministrationMenu()
|
1442 |
{
|
1443 |
// Top Level Menu
|
1444 |
-
add_menu_page( __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'),
|
1445 |
// Sub Items
|
1446 |
add_submenu_page('yks-mailchimp-form', __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'), __('MailChimp Settings','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'));
|
1447 |
// if the user has entered a VALID API key
|
@@ -1450,6 +1633,7 @@ public function addAdministrationMenu()
|
|
1450 |
}
|
1451 |
add_submenu_page('yks-mailchimp-form', __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form-lists', array(&$this, 'generatePageLists'));
|
1452 |
add_submenu_page('yks-mailchimp-form', __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-about-yikes', array(&$this, 'generatePageAboutYikes'));
|
|
|
1453 |
}
|
1454 |
|
1455 |
|
@@ -1479,6 +1663,10 @@ public function generateUserMailChimpPage()
|
|
1479 |
{
|
1480 |
require_once YKSEME_PATH.'pages/myMailChimp.php'; // include our widget
|
1481 |
}
|
|
|
|
|
|
|
|
|
1482 |
|
1483 |
/***** FORM DATA
|
1484 |
****************************************************************************************************/
|
@@ -1498,6 +1686,7 @@ public function yks_resetPluginSettings() {
|
|
1498 |
$this->optionVal['recaptcha-api-key'] = '';
|
1499 |
$this->optionVal['recaptcha-private-api-key'] = '';
|
1500 |
$this->optionVal['recaptcha-style'] = 'default';
|
|
|
1501 |
$this->optionVal['version'] = YKSEME_VERSION_CURRENT;
|
1502 |
update_option('api_validation' , 'invalid_api_key');
|
1503 |
// we need to unset the previously set up widgets
|
@@ -1536,7 +1725,7 @@ public function validateAPIkeySettings()
|
|
1536 |
} catch( Exception $e ) {
|
1537 |
$errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
|
1538 |
echo $errorMessage;
|
1539 |
-
update_option('api_validation', 'invalid_api_key');
|
1540 |
}
|
1541 |
return $apiKey;
|
1542 |
// always die or it will always return 1
|
@@ -1556,7 +1745,7 @@ public function validateAPIkeySettings()
|
|
1556 |
} catch( Exception $e ) {
|
1557 |
$errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
|
1558 |
echo $errorMessage;
|
1559 |
-
update_option('api_validation', 'invalid_api_key');
|
1560 |
}
|
1561 |
// always die or it will always return 1
|
1562 |
return $apiKey;
|
@@ -2201,7 +2390,7 @@ public function getCampaignUnsubscribeData()
|
|
2201 |
|
2202 |
// Make a call to MailChimp API to add a new subscriber to a specified list
|
2203 |
// Runs when a user fills out the form on the frontend of the site
|
2204 |
-
public function addUserToMailchimp($p)
|
2205 |
{
|
2206 |
if(!empty($p['form_data']))
|
2207 |
{
|
@@ -2349,7 +2538,8 @@ public function addUserToMailchimp($p)
|
|
2349 |
|
2350 |
// Add custom filter here, to capture user submitted
|
2351 |
// data before it's sent off to MailChimp
|
2352 |
-
$form_data = apply_filters( 'yikes_mc_get_form_data'
|
|
|
2353 |
$specific_form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $lid, $mv );
|
2354 |
|
2355 |
|
@@ -2358,8 +2548,9 @@ public function addUserToMailchimp($p)
|
|
2358 |
$retval = $api->call('lists/subscribe', array(
|
2359 |
'id' => $lid, // form id
|
2360 |
'email' => array( 'email' => $email ), // user email
|
2361 |
-
'merge_vars' => $
|
2362 |
-
'double_optin' => $optin // double optin value (retreived from the settings page)
|
|
|
2363 |
));
|
2364 |
return "done";
|
2365 |
} catch( Exception $e ) { // catch any errors returned from MailChimp
|
@@ -2468,7 +2659,7 @@ public function addUserToMailchimp($p)
|
|
2468 |
|
2469 |
// Add custom filter here, to capture user submitted
|
2470 |
// data before it's sent off to MailChimp
|
2471 |
-
$form_data = apply_filters( 'yikes_mc_get_form_data'
|
2472 |
$specific_form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $lid, $mv );
|
2473 |
|
2474 |
|
@@ -2477,71 +2668,33 @@ public function addUserToMailchimp($p)
|
|
2477 |
$retval = $api->call('lists/subscribe', array(
|
2478 |
'id' => $lid, // form id
|
2479 |
'email' => array( 'email' => $email ), // user email
|
2480 |
-
'merge_vars' => $
|
2481 |
-
'double_optin' => $optin // double optin value (retreived from the settings page)
|
|
|
|
|
2482 |
));
|
2483 |
return "done";
|
2484 |
} catch( Exception $e ) { // catch any errors returned from MailChimp
|
2485 |
$errorCode = $e->getCode();
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
}
|
2496 |
}
|
2497 |
-
|
2498 |
-
// Create and store our variables for the redirection
|
2499 |
-
$form_id = explode('-', $field['id']); // get the form ID
|
2500 |
-
$redirect_value = (isset($field['yks_mailchimp_redirect_'.$form_id[1]]) ? $field['yks_mailchimp_redirect_'.$form_id[1]] : ''); // get the redirect value from the lists page redirect checkbox
|
2501 |
-
$redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
|
2502 |
-
$site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
|
2503 |
-
$redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
|
2504 |
-
// if redirection was set up for this form, print out our javascript to complete the redirect
|
2505 |
-
if ($redirect_value == 1) { // only redirect if successful form submission <-----
|
2506 |
-
wp_redirect( home_url() ); exit;
|
2507 |
-
}
|
2508 |
-
*/
|
2509 |
}
|
|
|
|
|
2510 |
}
|
2511 |
-
return __('One or more fields are empty','yikes-inc-easy-mailchimp-extender'); // return an error if your leaving any necessary fields empty
|
2512 |
}
|
2513 |
|
2514 |
|
2515 |
-
// get our merge variables associated with a sepcific list
|
2516 |
-
// may not need any more
|
2517 |
-
// maybe remove
|
2518 |
-
/*
|
2519 |
-
private function getFieldMergeVar($fn, $lid)
|
2520 |
-
{
|
2521 |
-
$mk = '_YKS_UNKNOWN';
|
2522 |
-
switch($fn)
|
2523 |
-
{
|
2524 |
-
case 'yks-mailchimp-field-name-first':
|
2525 |
-
case 'yks-mailchimp-field-name-last':
|
2526 |
-
case 'yks-mailchimp-field-email':
|
2527 |
-
case 'yks-mailchimp-field-address':
|
2528 |
-
foreach($this->optionVal['lists'] as $lud => $list)
|
2529 |
-
{
|
2530 |
-
if($list['list-id'] == $lid)
|
2531 |
-
{
|
2532 |
-
foreach($this->optionVal['lists'][$lud]['fields'] as $fud => $field)
|
2533 |
-
{
|
2534 |
-
if($field['name'] == $fn)
|
2535 |
-
$mk = $field['merge'];
|
2536 |
-
}
|
2537 |
-
}
|
2538 |
-
}
|
2539 |
-
break;
|
2540 |
-
}
|
2541 |
-
return $mk;
|
2542 |
-
}
|
2543 |
-
*/
|
2544 |
-
|
2545 |
// Generate the lists containers on the lists page
|
2546 |
// This function gets any imported lists, and builds up the lists page
|
2547 |
public function generateListContainers($listArr=false)
|
@@ -2553,205 +2706,363 @@ public function generateListContainers($listArr=false)
|
|
2553 |
{
|
2554 |
ob_start();
|
2555 |
// loop over each lists and build the page
|
|
|
2556 |
foreach($listArr as $list)
|
2557 |
{
|
2558 |
|
2559 |
$get_list_data = $this->getListsData();
|
2560 |
?>
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
</div>
|
2568 |
-
<span class="yikes-lists-error" style="display:none;"><?php _e( "I'm sorry there was an error with your request." , "yikes-inc-easy-mailchimp-extender" ); ?></span>
|
2569 |
-
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
|
2570 |
-
<input type="hidden" name="yks-mailchimp-unique-id" id="yks-mailchimp-unique-id_<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" />
|
2571 |
-
<table class="form-table yks-admin-form">
|
2572 |
-
<tbody>
|
2573 |
-
<tr valign="top">
|
2574 |
-
<th scope="row"><label for="yks-mailchimp-api-key"><?php _e('MailChimp List name','yikes-inc-easy-mailchimp-extender'); ?></label></th>
|
2575 |
-
<td class="yks-mailchimp-listname"><?php
|
2576 |
-
if ($list['name'])
|
2577 |
-
{
|
2578 |
$thename = $list['name'];
|
2579 |
//echo $thename;
|
2580 |
printf( __( '%1$s', 'yikes-inc-easy-mailchimp-extender' ), $thename );
|
2581 |
-
}
|
2582 |
-
|
2583 |
-
|
2584 |
-
foreach ($thelistdata as $lkey => $lval)
|
2585 |
-
{
|
2586 |
-
if ($lkey == $list['id'])
|
2587 |
-
{
|
2588 |
$thename = $lval;
|
2589 |
//echo $thename;
|
2590 |
printf( __( '%1$s', 'yikes-inc-easy-mailchimp-extender' ), $thename );
|
2591 |
-
}
|
2592 |
}
|
|
|
2593 |
}
|
2594 |
-
|
2595 |
-
</
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2643 |
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
</
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
$
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
<
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
|
2686 |
-
|
2687 |
-
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
|
2694 |
-
|
2695 |
-
|
2696 |
-
|
2697 |
-
|
2698 |
-
|
2699 |
-
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
|
2711 |
-
|
2712 |
-
|
2713 |
-
|
2714 |
-
|
2715 |
-
|
2716 |
-
|
2717 |
-
|
2718 |
-
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
|
2745 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2746 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2747 |
</div>
|
2748 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2749 |
}
|
2750 |
}
|
2751 |
$output = ob_get_contents();
|
2752 |
ob_end_clean();
|
2753 |
return $output;
|
2754 |
}
|
|
|
|
|
2755 |
// Generate our front end JavaScript , used to submit forms
|
2756 |
public function getFrontendFormJavascript($list='')
|
2757 |
{
|
@@ -2858,7 +3169,7 @@ public function getFrontendFormDisplay($list='', $submit_text)
|
|
2858 |
// Display the form inside of a table
|
2859 |
// if the user has selected table as their flavor on the settings page
|
2860 |
// make sure this matches exactly with the div flavor below (currently does not)
|
2861 |
-
case '0':
|
2862 |
?>
|
2863 |
<!-- BEGIN TABLE FLAVOR -->
|
2864 |
<table class="yks-mailchimpFormTable">
|
@@ -2981,91 +3292,225 @@ public function getFrontendFormDisplay($list='', $submit_text)
|
|
2981 |
// Display the form inside of a div
|
2982 |
// if the user has selected div as their flavor on the settings page
|
2983 |
case '1':
|
2984 |
-
?>
|
2985 |
-
<div class="yks-mailchimpFormDiv">
|
2986 |
-
<?php
|
2987 |
-
/* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
|
2988 |
-
if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
|
2989 |
-
$reCAPTCHA_style = $this->optionVal['recaptcha-style'];
|
2990 |
-
|
2991 |
-
// if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
|
2992 |
-
if ( $this->yks_mc_is_user_localhost() ) {
|
2993 |
-
$reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
|
2994 |
-
} else {
|
2995 |
-
$reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
|
2996 |
-
}
|
2997 |
-
// set up the CAPTCHA theme
|
2998 |
-
?>
|
2999 |
-
<script>var RecaptchaOptions = {
|
3000 |
-
theme : '<?php echo $reCAPTCHA_style; ?>'
|
3001 |
-
};
|
3002 |
-
</script>
|
3003 |
-
<?php
|
3004 |
-
$this->includeRECAPTCHAlib();
|
3005 |
-
$reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
|
3006 |
-
$reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
|
3007 |
-
}
|
3008 |
-
$num = 1;
|
3009 |
-
|
3010 |
-
foreach($list['fields'] as $field) : if($field['active'] == 1) :
|
3011 |
-
|
3012 |
-
// get field placeholders
|
3013 |
-
$form_id = explode( '-', $field['id']);
|
3014 |
-
$field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
|
3015 |
-
echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
|
3016 |
?>
|
3017 |
-
|
3018 |
-
<script>
|
3019 |
-
jQuery(document).ready(function() {
|
3020 |
-
var hiddenInputClass = '<?php echo $field['name']; ?>';
|
3021 |
-
// alert('<?php echo $num; ?>');
|
3022 |
-
var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
|
3023 |
-
jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
|
3024 |
-
});
|
3025 |
-
</script>
|
3026 |
<?php
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
3030 |
-
|
3031 |
-
|
3032 |
-
|
3033 |
-
|
3034 |
-
|
3035 |
-
$
|
3036 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3037 |
?>
|
|
|
3038 |
<div class="yks-mailchimpFormDivRow">
|
3039 |
-
|
3040 |
-
<div class="yks-mailchimpFormDivRowField">
|
3041 |
-
<!-- run our function to generate the input fields for the form, passing in the field -->
|
3042 |
-
<?php echo $this->getFrontendFormDisplay_field($field); ?>
|
3043 |
-
</div>
|
3044 |
</div>
|
3045 |
-
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
|
3050 |
-
|
3051 |
-
|
3052 |
-
|
3053 |
-
|
3054 |
-
|
3055 |
-
|
3056 |
-
|
3057 |
-
|
3058 |
-
|
3059 |
-
|
3060 |
-
|
3061 |
-
|
3062 |
-
|
3063 |
-
|
3064 |
-
|
3065 |
-
|
3066 |
-
|
3067 |
-
|
3068 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3069 |
<?php
|
3070 |
// Create and store our variables for the redirection
|
3071 |
$form_id = explode('-', $field['id']); // get the form ID
|
@@ -3073,6 +3518,127 @@ public function getFrontendFormDisplay($list='', $submit_text)
|
|
3073 |
$redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
|
3074 |
$site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
|
3075 |
$redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3076 |
// if redirection was set up for this form, print out our javascript to complete the redirect
|
3077 |
if ($redirect_value == 1) {
|
3078 |
?>
|
@@ -3104,12 +3670,20 @@ public function getFrontendFormDisplay($list='', $submit_text)
|
|
3104 |
|
3105 |
// Generate the input fields for the form on the front end of the site
|
3106 |
// based on the $field['type'] that is returned from MailChimp
|
3107 |
-
private function getFrontendFormDisplay_field($field=false)
|
3108 |
{
|
3109 |
if($field === false) return false;
|
3110 |
$o = '';
|
3111 |
-
$num = 1;
|
3112 |
$fieldID = $field['id'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3113 |
|
3114 |
switch($field['type'])
|
3115 |
{
|
@@ -3122,11 +3696,11 @@ private function getFrontendFormDisplay_field($field=false)
|
|
3122 |
case 'website':
|
3123 |
case 'imageurl':
|
3124 |
// custom placeholder value goes here
|
3125 |
-
$o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'" value="" />';
|
3126 |
-
|
3127 |
break;
|
3128 |
case 'dropdown':
|
3129 |
-
$o .= '<select name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'">';
|
3130 |
if(count($field['choices']) > 0) : foreach($field['choices'] as $ok => $ov) :
|
3131 |
$o .= '<option value="'.htmlentities($ov, ENT_QUOTES).'">'.$ov.'</option>';
|
3132 |
endforeach; endif;
|
@@ -3134,29 +3708,32 @@ private function getFrontendFormDisplay_field($field=false)
|
|
3134 |
break;
|
3135 |
case 'address':
|
3136 |
|
3137 |
-
$o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'" value="" /><span class="yks-mailchimp-form-tooltip">Street Address</span>';
|
3138 |
-
$o .= '<input type="text" name="'.$field['name'].'-add2" class="'.$field['name'].'-add2'.($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'-add2" value="" /><span class="yks-mailchimp-form-tooltip">Apt/Suite</span>';
|
3139 |
-
$o .= '<input type="text" name="'.$field['name'].'-city" class="'.$field['name'].'-city'.($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'-city" value="" /><span class="yks-mailchimp-form-tooltip">City</span>';
|
3140 |
-
$o .= '<input type="text" name="'.$field['name'].'-state" class="'.$field['name'].'-state'.($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'-state" value="" /><span class="yks-mailchimp-form-tooltip">State</span>';
|
3141 |
-
$o .= '<input type="text" name="'.$field['name'].'-zip" class="'.$field['name'].'-zip'.($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'-zip" value="" /><span class="yks-mailchimp-form-tooltip">Zip</span>';
|
3142 |
break;
|
3143 |
case 'radio':
|
3144 |
if(count($field['choices']) > 0) : $ct=0; foreach($field['choices'] as $ok => $ov) :
|
3145 |
$ct++;
|
3146 |
-
$o .= '<input type="radio" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'-'.$ok.'" value="'.htmlentities($ov, ENT_QUOTES).'" />'.$ov;
|
3147 |
if($ct < count($field['choices']))
|
3148 |
$o .= '<br />';
|
3149 |
endforeach; endif;
|
3150 |
break;
|
3151 |
case 'date':
|
3152 |
case 'birthday':
|
3153 |
-
$o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].' yks-field-type-date'.($field['require'] == 1 ? ' yks-require' : '').'" id="'.$field['id'].'" value="" />';
|
3154 |
break;
|
|
|
|
|
3155 |
}
|
|
|
3156 |
return $o;
|
3157 |
}
|
3158 |
|
3159 |
-
|
3160 |
/***** DROPDOWNS
|
3161 |
****************************************************************************************************/
|
3162 |
// not sure we need these any more
|
@@ -3213,7 +3790,7 @@ public function runUpdateTasks()
|
|
3213 |
{
|
3214 |
if(call_user_func(array(&$this, $updateFunction)))
|
3215 |
{
|
3216 |
-
update_option(YKSEME_OPTION,
|
3217 |
$this->runUpdateTasks();
|
3218 |
}
|
3219 |
}
|
@@ -3292,6 +3869,150 @@ private function runUpdateTasks_1_2_0()
|
|
3292 |
return true;
|
3293 |
}
|
3294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3295 |
/**
|
3296 |
* This update needs to pull in all of the custom form
|
3297 |
* data for each of the lists, unfortunately it has to replace
|
@@ -3315,6 +4036,123 @@ private function runUpdateTasks_1_3_0()
|
|
3315 |
$this->optionVal['version'] = '2.2.1';
|
3316 |
return true;
|
3317 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3318 |
|
3319 |
/**
|
3320 |
* This update needs to pull in all of the custom form
|
@@ -3438,7 +4276,7 @@ private function runUpdateTasks_4_3()
|
|
3438 |
'LNAME' => $commenter_last_name
|
3439 |
),
|
3440 |
'double_optin' => $optin, // double optin value (retreived from the settings page)
|
3441 |
-
'
|
3442 |
));
|
3443 |
return "done";
|
3444 |
} catch( Exception $e ) { // catch any errors returned from MailChimp
|
@@ -4088,7 +4926,7 @@ private function runUpdateTasks_4_3()
|
|
4088 |
|
4089 |
/** Change Default HeartBeat API Pulse Time */
|
4090 |
function yks_mc_tweak_heartbeat_settings( $settings ) {
|
4091 |
-
$settings['interval'] =
|
4092 |
return $settings;
|
4093 |
}
|
4094 |
|
78 |
// custom Dashboard MailChimp Account Activity Widget
|
79 |
add_action( 'wp_dashboard_setup', array( &$this , 'yks_mc_add_chimp_chatter_dashboard_widget' ) );
|
80 |
|
81 |
+
if ( is_admin() ) {
|
82 |
+
// add a filter for our heartbeat response
|
83 |
+
// only add it to the admin screen, to prevent
|
84 |
+
// heartbeat from running on the front end
|
85 |
+
add_filter('heartbeat_received', array( &$this , 'yks_mc_heartbeat_received' ) , 10, 2);
|
86 |
+
add_action("init", array( &$this , "yks_mc_heartbeat_init" ) );
|
87 |
+
add_filter( 'heartbeat_settings', array( &$this , 'yks_mc_tweak_heartbeat_settings') );
|
88 |
+
}
|
89 |
+
|
90 |
// adding our custom content action
|
91 |
// used to prevent other plugins from hooking
|
92 |
// into the_content (such as jetpack sharedadddy, sharethis etc.)
|
93 |
add_action( 'init', array( &$this, 'yks_mc_content' ), 1 );
|
94 |
|
95 |
+
// Custom Filter To Alter Submitted Data
|
96 |
+
// before being sent off to MailChimp
|
97 |
+
add_filter( 'yikes_mc_get_form_data', array( &$this , 'yikes_mc_get_form_data_filter' ) , 10 );
|
98 |
+
|
99 |
+
// Custom Filter To Alter User Already Subscribed Message
|
100 |
+
add_filter( 'yikes_mc_user_already_subscribed', array( &$this , 'yikes_mc_user_already_subscribed_error_message_filter' ) , 10 , 3 );
|
101 |
|
102 |
|
103 |
// tinymce buttons
|
119 |
}
|
120 |
if(!is_admin())
|
121 |
{
|
122 |
+
// add_action('wp_print_styles', array(&$this, 'addStyles_frontend'));
|
123 |
+
// add_action('wp_print_scripts', array(&$this, 'addScripts_frontend'));
|
124 |
+
|
125 |
+
// custom hooks to print scripts and styles only on pages
|
126 |
+
// where the form is being displayed (performace enhancement)
|
127 |
+
// hooked into shortcode_form.php
|
128 |
+
add_action('yks_mc_enqueue_styles', array( &$this, 'addStyles_frontend' ) );
|
129 |
+
add_action('yks_mc_enqueue_scripts', array( &$this, 'addScripts_frontend') ) ;
|
130 |
}
|
131 |
// Setup the administration menus
|
132 |
add_action('admin_menu', array(&$this, 'addAdministrationMenu'));
|
133 |
// Make sure the option exists
|
134 |
if(!$this->optionVal) $this->getOptionValue();
|
135 |
+
// Setup shortcodes
|
136 |
$this->createShortcodes();
|
137 |
// Initialize current list array
|
138 |
$this->currentLists = array();
|
142 |
// Register Our Widget
|
143 |
$this->registerMailChimpWidget($this->optionVal['lists']);
|
144 |
}
|
145 |
+
|
146 |
+
// register and add our shortcodes
|
147 |
public function createShortcodes()
|
148 |
{
|
149 |
add_shortcode('yks-mailchimp-list', array(&$this, 'processShortcode'));
|
150 |
+
add_shortcode('yks-mailchimp-subscriber-count', array(&$this, 'displaySubscriberCount'));
|
151 |
}
|
152 |
+
|
153 |
+
/** Custom Filter To Alter User Submitted Data **/
|
154 |
+
public function yikes_mc_get_form_data_filter( $mv ) {
|
155 |
+
return $mv;
|
156 |
+
}
|
157 |
+
|
158 |
+
/** Custom Filter To Alter User Already Subscribed Error Message **/
|
159 |
+
public function yikes_mc_user_already_subscribed_error_message_filter( $errorMessage , $update_user_link , $email ) {
|
160 |
+
return $errorMessage;
|
161 |
+
}
|
162 |
+
|
163 |
// Create and store our initial plugin options
|
164 |
public function getOptionValue()
|
165 |
{
|
272 |
'type' => $field['field_type'],
|
273 |
'help' => $field['helptext'],
|
274 |
'default' => $field['default'],
|
|
|
|
|
|
|
275 |
'choices' => (isset($field['choices']) ? $field['choices'] : '')
|
276 |
);
|
277 |
$fields[$addField['id']] = $addField;
|
419 |
$this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
|
420 |
$this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
|
421 |
$this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
|
422 |
+
$this->optionVal['yks-mailchimp-jquery-datepicker'] = isset( $fd['yks-mailchimp-jquery-datepicker'] ) ? '1' : '';
|
423 |
+
// evan herman here
|
424 |
update_option('api_validation', 'valid_api_key');
|
425 |
return update_option(YKSEME_OPTION, $this->optionVal);
|
426 |
} else {
|
433 |
$this->optionVal['optIn-checkbox'] = $fd['yks-mailchimp-optIn-checkbox'];
|
434 |
$this->optionVal['yks-mailchimp-optIn-default-list'] = isset($fd['yks-mailchimp-optIn-default-list']) ? $fd['yks-mailchimp-optIn-default-list'] : null; // if its set, else set to null <- fixes save form settings bug
|
435 |
$this->optionVal['yks-mailchimp-optin-checkbox-text'] = stripslashes($fd['yks-mailchimp-optin-checkbox-text']);
|
436 |
+
$this->optionVal['yks-mailchimp-jquery-datepicker'] = isset( $fd['yks-mailchimp-jquery-datepicker'] ) ? '1' : '';
|
437 |
update_option('api_validation', 'valid_api_key');
|
438 |
// if the new API key differs from the old one
|
439 |
// we need to unset the previously set up widgets
|
730 |
echo $user_set_interest_group_label;
|
731 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
732 |
$checkboxValue = $interest_group['name'];
|
733 |
+
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'"><span>'.$singleGrouping['name'].'</span></label>';
|
734 |
}
|
735 |
echo '</td>';
|
736 |
echo '</tr>';
|
744 |
echo $user_set_interest_group_label;
|
745 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
746 |
$radioValue = $interest_group['name'];
|
747 |
+
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'"><span>'.$singleGrouping['name'].'</span></label>';
|
748 |
}
|
749 |
echo '</td>';
|
750 |
echo '</tr>';
|
797 |
echo '<div class="yks_mc_interest_group_holder">';
|
798 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
799 |
$checkboxValue = $interest_group['name'];
|
800 |
+
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="checkbox" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_checkbox" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'[]" value="'.$singleGrouping['name'].'"><span></span>'.$singleGrouping['name'].'</label>';
|
801 |
}
|
802 |
echo '</div>';
|
803 |
break;
|
808 |
echo '<div class="yks_mc_interest_radio_button_holder">';
|
809 |
foreach ($interest_group['groups'] as $singleGrouping) {
|
810 |
$radioValue = $interest_group['name'];
|
811 |
+
echo '<label class="yks_mc_interest_group_label" for="'.$singleGrouping['name'].'"><input type="radio" id="'.$singleGrouping['name'].'" class="yikes_mc_interest_group_radio" name="'.$interest_group['form_field'].'-'.$interest_group['id'].'" value="'.$singleGrouping['name'].'"><span></span>'.$singleGrouping['name'].'</label>';
|
812 |
}
|
813 |
echo '</div>';
|
814 |
echo '</div>';
|
1010 |
// $name = $this->slugify($field['label'].'-'.$field['tag']);
|
1011 |
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num] = $fd['placeholder-'.$fd['yks-mailchimp-unique-id'].'-'.$num];
|
1012 |
|
1013 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['custom-field-class-'.$fd['yks-mailchimp-unique-id'].'-'.$num] = $fd['custom-field-class-'.$fd['yks-mailchimp-unique-id'].'-'.$num];
|
1014 |
+
|
1015 |
+
|
1016 |
$num++;
|
1017 |
|
1018 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']] = (isset($fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '');
|
1019 |
|
1020 |
if(isset($fd['yks_mailchimp_redirect_'.$fd['yks-mailchimp-unique-id']])) {
|
1021 |
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['page_id_'.$fd['yks-mailchimp-unique-id']] = $fd['page_id_'.$fd['yks-mailchimp-unique-id']];
|
1022 |
}
|
1023 |
+
|
1024 |
+
// custom style setting
|
1025 |
+
// $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['fields'][$k]['yks_mailchimp_custom_styles_'.$fd['yks-mailchimp-unique-id']] = (isset($fd['yks_mailchimp_custom_styles_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '');
|
1026 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['active'] = (isset($fd['yks_mailchimp_custom_styles_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '0');
|
1027 |
+
|
1028 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['active'] = (isset($fd['yks_mailchimp_custom_template_'.$fd['yks-mailchimp-unique-id']]) ? '1' : '0');
|
1029 |
+
|
1030 |
+
}
|
1031 |
+
|
1032 |
+
// save the selected form template, if custom template was set
|
1033 |
+
if ( $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['active'] == 1 ) {
|
1034 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_template']['template_file'] = $fd['yks-mc-template-file-selection'];
|
1035 |
+
}
|
1036 |
|
1037 |
+
// save the color styles
|
1038 |
+
if ( $this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['active'] == 1 ) {
|
1039 |
+
// save the custom styles colors here!
|
1040 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_submit_button_color'] = $fd['yks-mc-submit-button-color'];
|
1041 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_submit_button_text_color'] = $fd['yks-mc-submit-button-text-color'];
|
1042 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_background_color'] = $fd['yks-mc-background-color'];
|
1043 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_text_color'] = $fd['yks-mc-text-color'];
|
1044 |
+
|
1045 |
+
// if the form width is left blank,
|
1046 |
+
// we'll just set it to 100%
|
1047 |
+
if ( $fd['yks-mc-form-width'] != '' ) {
|
1048 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_width'] = $fd['yks-mc-form-width'];
|
1049 |
+
} else {
|
1050 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_width'] = '100%';
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_alignment'] = $fd['yks-mc-form-alignment'];
|
1054 |
+
|
1055 |
+
$padding_matches = array();
|
1056 |
+
$matching_array = array( 'px' , 'em' , 'rem' , '%' );
|
1057 |
+
|
1058 |
+
if ( preg_match( '/([0-9.]+)([^0-9]+)/', $fd['yks-mc-form-padding'], $padding_matches ) ) {
|
1059 |
+
// $padding_explosion = preg_split( '/[a-zA-Z]/' , $fd['yks-mc-form-padding'] );
|
1060 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = $padding_matches[1];
|
1061 |
+
if ( in_array( $padding_matches[2] , $matching_array ) ) {
|
1062 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = $padding_matches[2];
|
1063 |
+
} else {
|
1064 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = 'px';
|
1065 |
+
}
|
1066 |
+
} else {
|
1067 |
+
if ( trim( $fd['yks-mc-form-padding'] ) != '' ) {
|
1068 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = $fd['yks-mc-form-padding'];
|
1069 |
+
} else {
|
1070 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding'] = '0';
|
1071 |
+
}
|
1072 |
+
$this->optionVal['lists'][$fd['yks-mailchimp-unique-id']]['custom_styles']['yks_mc_form_padding_measurement'] = 'px';
|
1073 |
+
}
|
1074 |
+
|
1075 |
}
|
1076 |
return update_option(YKSEME_OPTION, $this->optionVal);
|
1077 |
}
|
1106 |
)
|
1107 |
);
|
1108 |
// if merge variables are returned
|
|
|
|
|
1109 |
$mv = $this->getImportedFieldsArray($lid, $mv);
|
1110 |
if($mv)
|
1111 |
{
|
1116 |
return $this->generateListContainers(array($this->optionVal['lists'][$i]));
|
1117 |
}
|
1118 |
}
|
1119 |
+
|
1120 |
+
}
|
1121 |
+
return false;
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
// reImport a list to the lists page
|
1125 |
+
// Runs when a user adds a list from the drop down on the lists page
|
1126 |
+
public function reImportMergeVariables($i=false)
|
1127 |
+
// evan herman here
|
1128 |
+
{
|
1129 |
+
if($i == false) return false;
|
1130 |
+
else
|
1131 |
+
{
|
1132 |
+
// create our variables
|
1133 |
+
$lid = $this->optionVal['lists'][$i]['list-id'];
|
1134 |
+
$name = $this->optionVal['lists'][$i]['name'];
|
1135 |
+
$api = new wpyksMCAPI($this->optionVal['api-key']);
|
1136 |
+
$mv = $api->call('lists/merge-vars', array(
|
1137 |
+
'id' => array( $lid )
|
1138 |
+
)
|
1139 |
+
);
|
1140 |
+
// if merge variables are returned
|
1141 |
+
$mv = $this->getImportedFieldsArray($lid, $mv);
|
1142 |
+
if($mv)
|
1143 |
+
{
|
1144 |
+
// Save the new list
|
1145 |
+
$this->optionVal['lists'][$i]['fields'] = $mv;
|
1146 |
+
// update the list with the new fields
|
1147 |
+
if(update_option(YKSEME_OPTION, $this->optionVal))
|
1148 |
+
{
|
1149 |
+
return $this->generateMergeVariableContainers(array($this->optionVal['lists'][$i]));
|
1150 |
+
}
|
1151 |
+
}
|
1152 |
+
|
1153 |
}
|
1154 |
return false;
|
1155 |
}
|
1156 |
+
|
1157 |
// Make a call to the MailChimp API to retrieve all subscribers to a given list
|
1158 |
// Runs when the user clicks 'view' next to the subscriber count on the list page
|
1159 |
public function listAllSubscribers($lid, $list_name) {
|
1172 |
// display all subscribers in a table
|
1173 |
if($subscribers_list['total'] > 0) {
|
1174 |
?>
|
1175 |
+
<h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">'.$subscribers_list['total'].'</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").')</span>'; ?></h2>
|
1176 |
<p><?php _e( 'Click on a subscriber to see further information' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
|
1177 |
|
1178 |
<table id="yikes-mailchimp-subscribers-table" class="yks-mailchimp-fields-list" style="width:100%;">
|
1198 |
<?php
|
1199 |
} else { // else display an error of sorts
|
1200 |
?>
|
1201 |
+
<h2><?php echo $list_name; echo ' <span class="subscriber-count" style="font-size:11px;">(<span class="number">0</span> '.__(" subscribers" , "yikes-inc-easy-mailchimp-extender").')</span>'; ?></h2>
|
1202 |
<?php
|
1203 |
_e( "Sorry You Don't Currently Have Any Subscribers In This List!" , "yikes-inc-easy-mailchimp-extender" );
|
1204 |
}
|
1404 |
{
|
1405 |
|
1406 |
$screen_base = get_current_screen()->base;
|
1407 |
+
if ( $screen_base == __( 'toplevel_page_yks-mailchimp-form' , 'yikes-inc-easy-mailchimp-extender' ) || $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-my-mailchimp', 'yikes-inc-easy-mailchimp-extender' )
|
1408 |
+
|| $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-form-lists', 'yikes-inc-easy-mailchimp-extender' ) || $screen_base == 'widgets' || $screen_base == 'post' || $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-about-yikes' , 'yikes-inc-easy-mailchimp-extender' ) ) {
|
|
|
1409 |
// Register Styles
|
1410 |
wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
|
1411 |
wp_register_style('jquery-datatables-pagination', YKSEME_URL.'css/jquery.dataTables.css', array(), '1.0.0', 'all');
|
1413 |
wp_enqueue_style('thickbox');
|
1414 |
wp_enqueue_style('ykseme-css-base');
|
1415 |
wp_enqueue_style('jquery-datatables-pagination');
|
1416 |
+
// just load the animate.css class on all admin pages
|
1417 |
+
wp_register_style('ykseme-animate-css', YKSEME_URL.'css/animate.css', array(), '1.0.0', 'all');
|
1418 |
+
wp_enqueue_style('ykseme-animate-css');
|
1419 |
+
}
|
1420 |
+
|
1421 |
+
|
1422 |
+
|
1423 |
+
if ( $screen_base == 'admin_page_yks-mailchimp-welcome' || $screen_base == 'mailchimp-forms_page_yks-mailchimp-form-lists' ) {
|
1424 |
+
wp_enqueue_style('bootstrap-css', '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' );
|
1425 |
+
wp_enqueue_style( 'wp-color-picker' );
|
1426 |
}
|
1427 |
|
|
|
|
|
|
|
1428 |
}
|
1429 |
|
1430 |
public function addStyles_frontend()
|
1431 |
{
|
1432 |
// Register Styles
|
1433 |
wp_register_style('ykseme-css-base', YKSEME_URL.'css/style.ykseme.css', array(), '1.0.0', 'all');
|
1434 |
+
// enqueue our jQuery UI styles only when
|
1435 |
+
// the datepicker enqueue is enabled in the settings field
|
1436 |
+
if( isset( $this->optionVal['yks-mailchimp-jquery-datepicker'] ) && $this->optionVal['yks-mailchimp-jquery-datepicker'] == '1' ) {
|
1437 |
+
wp_register_style('ykseme-css-smoothness', '//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css', array(), '1.0.0', 'all');
|
1438 |
+
}
|
1439 |
wp_register_style('ykseme-animate-css', YKSEME_URL.'css/animate.css', array(), '1.0.0', 'all');
|
1440 |
// Enqueue Styles
|
1441 |
wp_enqueue_style('ykseme-css-base');
|
1448 |
{
|
1449 |
|
1450 |
$screen_base = get_current_screen()->base;
|
1451 |
+
if ( $screen_base == __( 'toplevel_page_yks-mailchimp-form', 'yikes-inc-easy-mailchimp-extender' ) || $screen_base == __( 'mailchimp-forms_page_yks-mailchimp-my-mailchimp' , 'yikes-inc-easy-mailchimp-extender' ) ) {
|
|
|
|
|
1452 |
// Everything else
|
1453 |
// load our scripts in the dashboard
|
1454 |
wp_enqueue_script('jquery-ui-core');
|
1455 |
wp_enqueue_script('thickbox');
|
1456 |
|
1457 |
+
wp_enqueue_script('jquery-ui-sortable');
|
1458 |
+
wp_enqueue_script('jquery-ui-tabs');
|
1459 |
+
wp_enqueue_script('ykseme-base', YKSEME_URL.'js/script.ykseme.js', array('jquery'));
|
1460 |
+
wp_enqueue_script('jquery-datatables-pagination', YKSEME_URL.'js/jquery.dataTables.js', array('jquery'));
|
1461 |
+
wp_enqueue_script('jquery-highcharts-js', YKSEME_URL.'js/highcharts.js', array('jquery'));
|
1462 |
+
wp_enqueue_script('jquery-highcharts-exporting-js', YKSEME_URL.'js/exporting.js', array('jquery'));
|
1463 |
+
wp_enqueue_script('jquery-highcharts-3d-js', YKSEME_URL.'js/highcharts-3d.js', array('jquery'));
|
1464 |
+
|
1465 |
+
wp_enqueue_script('jquery-highmaps-js', YKSEME_URL.'js/map.js', array('jquery'));
|
1466 |
+
wp_enqueue_script('jquery-map-data-js', 'http://code.highcharts.com/mapdata/custom/world.js', array('jquery'));
|
1467 |
+
wp_enqueue_script('jquery-highmaps-data-js', YKSEME_URL.'js/data.js', array('jquery'));
|
1468 |
+
} else if ( $screen_base == 'admin_page_yks-mailchimp-welcome' ) {
|
1469 |
+
wp_enqueue_script('bootstrap-js', '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js', array('jquery')) ;
|
1470 |
+
} else if ( $screen_base == 'mailchimp-forms_page_yks-mailchimp-form-lists' ) {
|
1471 |
+
wp_enqueue_script( 'wp-color-picker' );
|
1472 |
+
wp_enqueue_script('bootstrap-js', '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js', array('jquery')) ;
|
1473 |
+
wp_enqueue_script('jquery-ui-core');
|
1474 |
+
wp_enqueue_script('thickbox');
|
1475 |
+
|
1476 |
wp_enqueue_script('jquery-ui-sortable');
|
1477 |
wp_enqueue_script('jquery-ui-tabs');
|
1478 |
wp_enqueue_script('ykseme-base', YKSEME_URL.'js/script.ykseme.js', array('jquery'));
|
1487 |
} else {
|
1488 |
return;
|
1489 |
}
|
1490 |
+
|
1491 |
}
|
1492 |
|
1493 |
// redirect the user to the settings page on initial activation
|
1495 |
if (get_option('yks_easy_mc_plugin_do_activation_redirect', false)) {
|
1496 |
delete_option('yks_easy_mc_plugin_do_activation_redirect');
|
1497 |
// redirect to settings page
|
1498 |
+
wp_redirect(admin_url('/admin.php?page=yks-mailchimp-welcome'));
|
1499 |
}
|
1500 |
}
|
1501 |
|
1502 |
public function addScripts_frontend()
|
1503 |
{
|
1504 |
+
/* - we shouldn't be enqueueing our own version of jQuery
|
1505 |
+
- it's just irresponsible! :o
|
1506 |
+
|
1507 |
global $wp_scripts;
|
1508 |
|
1509 |
$version ='1.9.0';
|
1521 |
wp_enqueue_script( 'jquery' );
|
1522 |
}
|
1523 |
}
|
1524 |
+
*/
|
1525 |
// Everything else
|
1526 |
+
// wp_enqueue_script('jquery-ui-core');
|
1527 |
+
|
1528 |
+
// enqueue jQuery datepicker only when the user has specified to do so
|
1529 |
+
if( isset( $this->optionVal['yks-mailchimp-jquery-datepicker'] ) && $this->optionVal['yks-mailchimp-jquery-datepicker'] == '1' ) {
|
1530 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
1531 |
+
}
|
1532 |
+
|
1533 |
}
|
1534 |
|
1535 |
|
1538 |
// Function to process the shortcode provided by the plugin
|
1539 |
// $p is the data associated with the shortcode (ie: form id and submit button text)
|
1540 |
public function processShortcode($p)
|
1541 |
+
{
|
1542 |
+
ob_start();
|
1543 |
+
// check if the list is set, to prevent errors from being thrown
|
1544 |
+
if ( isset( $this->optionVal['lists'][$p['id']] ) ) {
|
1545 |
+
|
1546 |
+
if( $this->optionVal['api-key'] != '' && ( is_array( $this->optionVal['lists'][$p['id']] ) && !empty( $this->optionVal['lists'][$p['id']] ) ) ) {
|
1547 |
+
// Setup this list
|
1548 |
+
$list = $this->optionVal['lists'][$p['id']];
|
1549 |
+
$submit_text = $p['submit_text'];
|
1550 |
+
// Which form are we on?
|
1551 |
+
if(!isset($this->currentLists[$p['id']]))
|
1552 |
+
$this->currentLists[$p['id']] = 0;
|
1553 |
+
else
|
1554 |
+
$this->currentLists[$p['id']]++;
|
1555 |
+
$listCt = $this->currentLists[$p['id']];
|
1556 |
+
// Add the count to the list vars
|
1557 |
+
$list['id'] = $listCt.'-'.$list['id'];
|
1558 |
+
if(count($list['fields']))
|
1559 |
+
{
|
1560 |
+
foreach($list['fields'] as $fieldId => $field)
|
1561 |
+
{
|
1562 |
+
$list['fields'][$fieldId]['id'] = $listCt.'-'.$field['id'];
|
1563 |
+
}
|
1564 |
+
}
|
1565 |
+
|
1566 |
+
// List form
|
1567 |
+
include YKSEME_PATH.'templates/shortcode_form.php';
|
1568 |
+
}
|
1569 |
+
|
1570 |
+
// if there is no api key entered, or it's an invalid api key
|
1571 |
+
} else if ( $this->optionVal['api-key'] == '' || get_option( 'api_validation' ) == 'invalid_api_key' ) {
|
1572 |
+
include YKSEME_PATH.'templates/shortcode_error_no_API_key.php';
|
1573 |
+
// else if the form was removed from the lists page
|
1574 |
+
} else {
|
1575 |
+
include YKSEME_PATH.'templates/shortcode_error_data.php';
|
1576 |
+
}
|
1577 |
+
$shortcode = ob_get_contents();
|
1578 |
+
ob_end_clean();
|
1579 |
+
return $shortcode;
|
1580 |
+
}
|
1581 |
+
|
1582 |
+
/* New Function to Display Subscriber Count for a given list */
|
1583 |
+
public function displaySubscriberCount($p)
|
1584 |
{
|
1585 |
ob_start();
|
1586 |
if($this->optionVal['api-key'] != ''
|
1587 |
&& (is_array($this->optionVal['lists'][$p['id']]) && !empty($this->optionVal['lists'][$p['id']])))
|
1588 |
{
|
1589 |
+
// Setup this list
|
1590 |
+
$list = $this->optionVal['lists'][$p['id']];
|
1591 |
+
$mailChimp = new yksemeBase();
|
1592 |
+
$list = $mailChimp->getListsData();
|
1593 |
+
$list_id = key($list);
|
1594 |
+
// echo '<h4>Join <strong>' . $list['subscriber-count']['subscriber-count-'.$list_id] . '</strong> others, and sign up for our mailing list!</h4>';
|
1595 |
+
// return just the subscriber count so the user can easily customize it!
|
1596 |
+
echo $list['subscriber-count']['subscriber-count-'.$list_id];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1597 |
}
|
1598 |
// if there is no api key entered, or it's an invalid api key
|
1599 |
else if ( $this->optionVal['api-key'] == '' || get_option( 'api_validation' ) == 'invalid_api_key' )
|
1624 |
public function addAdministrationMenu()
|
1625 |
{
|
1626 |
// Top Level Menu
|
1627 |
+
add_menu_page( __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'), 'MailChimp Forms', 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'), 'dashicons-welcome-write-blog', 400);
|
1628 |
// Sub Items
|
1629 |
add_submenu_page('yks-mailchimp-form', __('MailChimp Forms','yikes-inc-easy-mailchimp-extender'), __('MailChimp Settings','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form', array(&$this, 'generatePageOptions'));
|
1630 |
// if the user has entered a VALID API key
|
1633 |
}
|
1634 |
add_submenu_page('yks-mailchimp-form', __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), __('Manage List Forms','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-form-lists', array(&$this, 'generatePageLists'));
|
1635 |
add_submenu_page('yks-mailchimp-form', __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), __('About YIKES, Inc.','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-about-yikes', array(&$this, 'generatePageAboutYikes'));
|
1636 |
+
add_submenu_page('options.php', __('Welcome','yikes-inc-easy-mailchimp-extender'), __('Welcome','yikes-inc-easy-mailchimp-extender'), 'manage_options', 'yks-mailchimp-welcome', array(&$this, 'generateWelcomePage'));
|
1637 |
}
|
1638 |
|
1639 |
|
1663 |
{
|
1664 |
require_once YKSEME_PATH.'pages/myMailChimp.php'; // include our widget
|
1665 |
}
|
1666 |
+
public function generateWelcomePage()
|
1667 |
+
{
|
1668 |
+
require_once YKSEME_PATH.'pages/welcome.php'; // include our widget
|
1669 |
+
}
|
1670 |
|
1671 |
/***** FORM DATA
|
1672 |
****************************************************************************************************/
|
1686 |
$this->optionVal['recaptcha-api-key'] = '';
|
1687 |
$this->optionVal['recaptcha-private-api-key'] = '';
|
1688 |
$this->optionVal['recaptcha-style'] = 'default';
|
1689 |
+
$this->optionVal['yks-mailchimp-jquery-datepicker'] = '';
|
1690 |
$this->optionVal['version'] = YKSEME_VERSION_CURRENT;
|
1691 |
update_option('api_validation' , 'invalid_api_key');
|
1692 |
// we need to unset the previously set up widgets
|
1725 |
} catch( Exception $e ) {
|
1726 |
$errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
|
1727 |
echo $errorMessage;
|
1728 |
+
// update_option('api_validation', 'invalid_api_key');
|
1729 |
}
|
1730 |
return $apiKey;
|
1731 |
// always die or it will always return 1
|
1745 |
} catch( Exception $e ) {
|
1746 |
$errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
|
1747 |
echo $errorMessage;
|
1748 |
+
// update_option('api_validation', 'invalid_api_key');
|
1749 |
}
|
1750 |
// always die or it will always return 1
|
1751 |
return $apiKey;
|
2390 |
|
2391 |
// Make a call to MailChimp API to add a new subscriber to a specified list
|
2392 |
// Runs when a user fills out the form on the frontend of the site
|
2393 |
+
public function addUserToMailchimp($p,$update_existing)
|
2394 |
{
|
2395 |
if(!empty($p['form_data']))
|
2396 |
{
|
2538 |
|
2539 |
// Add custom filter here, to capture user submitted
|
2540 |
// data before it's sent off to MailChimp
|
2541 |
+
$form_data = apply_filters( 'yikes_mc_get_form_data' , $mv );
|
2542 |
+
|
2543 |
$specific_form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $lid, $mv );
|
2544 |
|
2545 |
|
2548 |
$retval = $api->call('lists/subscribe', array(
|
2549 |
'id' => $lid, // form id
|
2550 |
'email' => array( 'email' => $email ), // user email
|
2551 |
+
'merge_vars' => $form_data, // merge variables (ie: fields and interest groups)
|
2552 |
+
'double_optin' => $optin, // double optin value (retreived from the settings page)
|
2553 |
+
'update_existing' => $update_existing
|
2554 |
));
|
2555 |
return "done";
|
2556 |
} catch( Exception $e ) { // catch any errors returned from MailChimp
|
2659 |
|
2660 |
// Add custom filter here, to capture user submitted
|
2661 |
// data before it's sent off to MailChimp
|
2662 |
+
$form_data = apply_filters( 'yikes_mc_get_form_data' , $mv );
|
2663 |
$specific_form_data = apply_filters( 'yikes_mc_get_form_data_'.$lid, $lid, $mv );
|
2664 |
|
2665 |
|
2668 |
$retval = $api->call('lists/subscribe', array(
|
2669 |
'id' => $lid, // form id
|
2670 |
'email' => array( 'email' => $email ), // user email
|
2671 |
+
'merge_vars' => $form_data, // merge variables (ie: fields and interest groups)
|
2672 |
+
'double_optin' => $optin, // double optin value (retreived from the settings page)
|
2673 |
+
'send_welcome' => true,
|
2674 |
+
'update_existing' => $update_existing
|
2675 |
));
|
2676 |
return "done";
|
2677 |
} catch( Exception $e ) { // catch any errors returned from MailChimp
|
2678 |
$errorCode = $e->getCode();
|
2679 |
+
if ( $errorCode = '214' ) {
|
2680 |
+
$update_user_link = '<br /> <a href="#" onclick="return false;" class="button-secondary update-user-info">Update My Info.</a>';
|
2681 |
+
$errorMessage = $e->getMessage() . $update_user_link;
|
2682 |
+
return apply_filters( 'yikes_mc_user_already_subscribed' , $errorMessage , $update_user_link , $email );
|
2683 |
+
die();
|
2684 |
+
} else {
|
2685 |
+
echo '<strong>'.$e->getMessage().'</strong>';
|
2686 |
+
die();
|
2687 |
+
}
|
2688 |
}
|
2689 |
}
|
2690 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2691 |
}
|
2692 |
+
} else {
|
2693 |
+
return __('One or more fields are empty','yikes-inc-easy-mailchimp-extender'); // return an error if your leaving any necessary fields empty
|
2694 |
}
|
|
|
2695 |
}
|
2696 |
|
2697 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2698 |
// Generate the lists containers on the lists page
|
2699 |
// This function gets any imported lists, and builds up the lists page
|
2700 |
public function generateListContainers($listArr=false)
|
2706 |
{
|
2707 |
ob_start();
|
2708 |
// loop over each lists and build the page
|
2709 |
+
$i = 1;
|
2710 |
foreach($listArr as $list)
|
2711 |
{
|
2712 |
|
2713 |
$get_list_data = $this->getListsData();
|
2714 |
?>
|
2715 |
+
<!-- title -->
|
2716 |
+
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_<?php echo $i; ?>" class="panel-heading yks-mc-list-title-toggle panel panel-default">
|
2717 |
+
|
2718 |
+
<span class="yks_mc_list_title">
|
2719 |
+
<?php
|
2720 |
+
if ($list['name']) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2721 |
$thename = $list['name'];
|
2722 |
//echo $thename;
|
2723 |
printf( __( '%1$s', 'yikes-inc-easy-mailchimp-extender' ), $thename );
|
2724 |
+
} else {
|
2725 |
+
foreach ($thelistdata as $lkey => $lval) {
|
2726 |
+
if ($lkey == $list['id']) {
|
|
|
|
|
|
|
|
|
2727 |
$thename = $lval;
|
2728 |
//echo $thename;
|
2729 |
printf( __( '%1$s', 'yikes-inc-easy-mailchimp-extender' ), $thename );
|
|
|
2730 |
}
|
2731 |
+
}
|
2732 |
}
|
2733 |
+
?>
|
2734 |
+
</span>
|
2735 |
+
|
2736 |
+
<span class="yks_mc_subscriber_count"><?php if ( $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] > 1 || $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] == 0 ) { echo $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] . __( ' subscribers' , 'yikes-inc-easy-mailchimp-extender' ); } else { echo $get_list_data['subscriber-count']['subscriber-count-'.$list['id']] . __( ' subscriber' , 'yikes-inc-easy-mailchimp-extender' ); } ?></span>
|
2737 |
+
|
2738 |
+
</a>
|
2739 |
+
|
2740 |
+
<div id="collapse_<?php echo $i; ?>" class="panel-collapse collapse panel-body">
|
2741 |
+
<div class="yks-list-container" id="yks-list-container_<?php echo $list['id']; ?>">
|
2742 |
+
<div class="yks-status" id="yks-status" style="display: none;">
|
2743 |
+
<div class="yks-success" style="padding:.25em;"><p> <?php _e( 'Your List Was Successfully Saved!' , 'yikes-inc-easy-mailchimp-extender' ); ?></p></div>
|
2744 |
+
</div>
|
2745 |
+
<div class="yks-status-error" id="yks-status-error" style="display: none;">
|
2746 |
+
<div class="yks-error" style="padding:.25em;"><p> <?php _e( 'Your settings were not saved (or you did not change them).' , 'yikes-inc-easy-mailchimp-extender' ); ?></p></div>
|
2747 |
+
</div>
|
2748 |
+
<span class="yikes-lists-error" style="display:none;"><?php _e( "I'm sorry there was an error with your request." , "yikes-inc-easy-mailchimp-extender" ); ?></span>
|
2749 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
|
2750 |
+
<input type="hidden" name="yks-mailchimp-unique-id" id="yks-mailchimp-unique-id_<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" />
|
2751 |
+
<table class="form-table yks-admin-form">
|
2752 |
+
<tbody>
|
2753 |
+
<!-- display the specific MailChimp list ID back to the user -->
|
2754 |
+
<tr valign="top">
|
2755 |
+
<th scope="row"><label for="yks-mailchimp-api-key"><?php _e( 'MailChimp List ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
|
2756 |
+
<td><?php echo $list['list-id']; ?>
|
2757 |
+
</td>
|
2758 |
+
</tr>
|
2759 |
+
<!-- display the shortcode with the specific list ID -->
|
2760 |
+
<tr valign="top">
|
2761 |
+
<th scope="row"><label for="yks-mailchimp-shortcode"><?php _e( 'Shortcode' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
|
2762 |
+
<td class="yks-mailchimp-shortcode">
|
2763 |
+
<span class="shortcode-code">[yks-mailchimp-list id="<?php echo $list['id']; ?>" submit_text="Submit"]</span>
|
2764 |
+
<span class="description yks-margin-left"><?php _e( 'Paste this shortcode into whatever page or post you want to add this form to' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
2765 |
+
</td>
|
2766 |
+
</tr>
|
2767 |
+
<!-- display the PHP snippet with the specific list ID -->
|
2768 |
+
<tr valign="top">
|
2769 |
+
<th scope="row"><label for="yks-mailchimp-api-key"><?php _e( 'PHP Snippet' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
|
2770 |
+
<td>
|
2771 |
+
<?php /* echo htmlentities('<?php echo yksemeProcessSnippet(\''.$list['id'].'\', \'Submit\'); ?>'); */ ?>
|
2772 |
+
<?php echo htmlentities('<?php echo yksemeProcessSnippet( "'.$list['id'].'" , "Submit" ); ?>'); ?>
|
2773 |
+
<span class="description yks-margin-left"><?php _e( 'Use this code to add this form to a template file' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
2774 |
+
</td>
|
2775 |
+
</tr>
|
2776 |
+
<!-- display subscriber count here -->
|
2777 |
+
<tr valign="top">
|
2778 |
+
<th scope="row"><label for="yks-mailchimp-api-key"><?php _e( 'Number of Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
|
2779 |
+
<td>
|
2780 |
+
<!-- rel contains list id that we pass along to our function to ajax retreive all subscribers -->
|
2781 |
+
<span class="number-of-subscribers-<?php echo $list['id']; ?>"><?php echo $get_list_data['subscriber-count']['subscriber-count-'.$list['id']]; ?> </span><a href="#TB_inline?width=600&height=550&inlineId=yikes-mailchimp-subscribers-box" class="thickbox displayListSubscribers button-secondary" rel="<?php echo $list['id']; ?>">View</a>
|
2782 |
+
</td>
|
2783 |
+
</tr>
|
2784 |
+
<!-- display the forms fields, with options to customize -->
|
2785 |
+
<tr valign="top">
|
2786 |
+
<td scope="row">
|
2787 |
+
<label for="api-key"><strong><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label>
|
2788 |
+
<p class="description">
|
2789 |
+
<?php _e( 'Check the fields you want included in your form (Email Address is required).' , 'yikes-inc-easy-mailchimp-extender' ); ?>
|
2790 |
+
</p>
|
2791 |
|
2792 |
+
<p class="description">
|
2793 |
+
<?php _e( 'Use the green arrows to drag-and-drop the fields and rearrange their order.' , 'yikes-inc-easy-mailchimp-extender' ); ?>
|
2794 |
+
<span class="yks-mailchimp-sorthandle-img"></span>
|
2795 |
+
</p>
|
2796 |
+
<!-- add our add new form field button here!
|
2797 |
+
To Do --
|
2798 |
+
- Create new forms
|
2799 |
+
- Add + Remove merge fields from existing forms on the fly
|
2800 |
+
- Add+ Remove interest groups etc from existing forms on the fly
|
2801 |
+
<p class="description">
|
2802 |
+
<a class="button-secondary thickbox" onclick="return false;" href="#TB_inline?width=auto&height=175&inlineId=newMergeVariableContainer">Add New Field</a>
|
2803 |
+
</p>
|
2804 |
+
-->
|
2805 |
+
</th>
|
2806 |
+
<td class="yks-mailchimp-fields-td" id="yks-mailchimp-fields-td_<?php echo $list['id']; ?>">
|
2807 |
+
<fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
|
2808 |
+
<legend class="screen-reader-text"><span><?php _e( 'Active Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></legend>
|
2809 |
+
<div class="yks-mailchimp-fields-list" id="yks-mailchimp-fields-list_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
|
2810 |
+
|
2811 |
+
<!-- create sortable rows populated with mailchimp data -->
|
2812 |
+
<?php
|
2813 |
+
$num = 1;
|
2814 |
+
foreach($list['fields'] as $field) { ?>
|
2815 |
+
<div class="yks-mailchimp-fields-list-row">
|
2816 |
+
<label title="<?php echo $field['name']; ?>" rel="<?php echo $field['id']; ?>">
|
2817 |
+
<span class="yks-mailchimp-sorthandle"><?php _e( 'Drag' , 'yikes-inc-easy-mailchimp-extender' ); ?> & <?php _e( 'drop' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
2818 |
+
<input type="checkbox" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" value="1" <?php echo ($field['active'] == 1 ? 'checked="checked"' : ''); ?><?php echo ($field['require'] == 1 ? 'disabled="disabled"' : ''); ?> />
|
2819 |
+
|
2820 |
+
<div class="yks-mailchimp-field-name"><?php echo $field['label']; ?></div>
|
2821 |
+
</label>
|
2822 |
+
<span class="yks-mailchimp-field-merge"><span class="description"><?php _e( 'Merge field' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> *|<input type="text" class="merge_field_input" name="<?php echo $field['name']; ?>-merge" id="<?php echo $field['id']; ?>-merge" value="<?php echo $field['merge']; ?>"<?php echo (($field['locked'] == 1 || $field['merge'] == false) ? ' disabled="disabled"' : ''); ?> />|*</span>
|
2823 |
+
<span class="yks-mailchimp-field-placeholder"><span class="description"><?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> *|<input type="text" name="placeholder-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-placeholder" placeholder="<?php echo $field['label']; ?>" value="<?php if(isset($field['placeholder-'.$list['id'].'-'.$num])) { echo $field['placeholder-'.$list['id'].'-'.$num]; } ?>" />|*</span>
|
2824 |
+
<span class="yks-mailchimp-field-custom-field-class"><span class="description"><?php _e( 'Custom Class' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> *|<input type="text" name="custom-field-class-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-custom-field-class" value="<?php if(isset($field['custom-field-class-'.$list['id'].'-'.$num])) { echo $field['custom-field-class-'.$list['id'].'-'.$num]; } ?>" />|*</span>
|
2825 |
+
</div>
|
2826 |
+
<?php
|
2827 |
+
$num++;
|
2828 |
+
} ?>
|
2829 |
+
</div>
|
2830 |
+
</fieldset>
|
2831 |
+
<!-- display redirect checkbox here -->
|
2832 |
+
<tr valign="top">
|
2833 |
+
<th scope="row"><label for="yks-mailchimp-url-redirect"><?php _e( 'Redirect User On Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
|
2834 |
+
<td>
|
2835 |
+
<span class="yks-mailchimp-redirect-checkbox-holder">
|
2836 |
+
<input type="checkbox" name="yks_mailchimp_redirect_<?php echo $list['id']; ?>" class="yks_mailchimp_redirect" id="yks-mailchimp-redirect-<?php echo $list['id']; ?>" value="1" <?php if(isset($field['yks_mailchimp_redirect_'.$list['id']])) { echo ($field['yks_mailchimp_redirect_'.$list['id']] == 1 ? 'checked="checked"' : ''); } ?> />
|
2837 |
+
<span class="description yks-margin-left"><?php _e( 'choose a page to redirect the user to after they submit the form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
2838 |
+
<!-- drop down of registered posts/pages -->
|
2839 |
+
<li id="pages" class="yks_mc_pages_dropdown_<?php echo $list['id']; ?>" <?php if(!isset($field['yks_mailchimp_redirect_'.$list['id']]) || $field['yks_mailchimp_redirect_'.$list['id']] == '' ) { echo 'style="list-style:none;display:none;"'; } else { echo 'style="list-style:none;"'; } ?> >
|
2840 |
+
<h4><?php _e( 'Select A Post/Page' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
|
2841 |
+
<form action="<? bloginfo('url'); ?>" method="get">
|
2842 |
+
<select id="page_id" name="page_id_<?php echo $list['id']; ?>" >
|
2843 |
+
<?php
|
2844 |
+
// set up variables for the queries
|
2845 |
+
global $post;
|
2846 |
+
global $page;
|
2847 |
+
$post_types = apply_filters( 'yks_redirect_add_post_types' , array( 'post' ) , 10 );
|
2848 |
+
$args_posts = array( 'post_type' => $post_types , 'numberposts' => -1);
|
2849 |
+
$args_pages = array(
|
2850 |
+
'sort_order' => 'ASC',
|
2851 |
+
'sort_column' => 'post_title',
|
2852 |
+
'hierarchical' => 1,
|
2853 |
+
'exclude' => '',
|
2854 |
+
'include' => '',
|
2855 |
+
'meta_key' => '',
|
2856 |
+
'meta_value' => '',
|
2857 |
+
'authors' => '',
|
2858 |
+
'child_of' => 0,
|
2859 |
+
'parent' => -1,
|
2860 |
+
'exclude_tree' => '',
|
2861 |
+
'number' => '',
|
2862 |
+
'offset' => 0,
|
2863 |
+
'post_type' => 'page',
|
2864 |
+
'post_status' => 'publish'
|
2865 |
+
);
|
2866 |
+
$pages = get_pages($args_pages);
|
2867 |
+
// print_r($pages);
|
2868 |
+
|
2869 |
+
$posts = get_posts($args_posts);
|
2870 |
+
// print_r($posts);
|
2871 |
+
?>
|
2872 |
+
<optgroup label="Posts"><?php
|
2873 |
+
|
2874 |
+
// throwing error -> must resolve
|
2875 |
+
foreach( $posts as $post ) : setup_postdata($post); ?>
|
2876 |
+
<option <?php if(isset($field['page_id_'.$list['id']])) { selected( $field['page_id_'.$list['id']], $post->ID ); } ?> value="<?php echo $post->ID; ?>"><?php the_title(); ?></option>
|
2877 |
+
<?php endforeach; ?>
|
2878 |
+
|
2879 |
+
</optgroup>
|
2880 |
+
<optgroup label="Pages">
|
2881 |
+
<?php
|
2882 |
+
foreach( $pages as $page ) : ?>
|
2883 |
+
<option <?php if(isset($field['page_id_'.$list['id']])) { selected( $field['page_id_'.$list['id']], $page->ID ); } ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option>
|
2884 |
+
<?php endforeach; ?>
|
2885 |
+
</optgroup>
|
2886 |
+
</select>
|
2887 |
+
</form>
|
2888 |
+
</li>
|
2889 |
+
</span>
|
2890 |
+
</td>
|
2891 |
+
</tr>
|
2892 |
+
<!-- display color picker here, to customize the form styles! -->
|
2893 |
+
<tr valign="top">
|
2894 |
+
<th scope="row"><label for="yks-mailchimp-url-redirect"><?php _e( 'Custom Styles' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
|
2895 |
+
<td>
|
2896 |
+
<span class="yks-mailchimp-custom-styles-holder">
|
2897 |
+
<input type="checkbox" name="yks_mailchimp_custom_styles_<?php echo $list['id']; ?>" class="yks_mailchimp_custom_styles" id="yks-mailchimp-custom-styles-<?php echo $list['id']; ?>" value="1" <?php if ( isset( $list['custom_styles']['active'] ) && $list['custom_styles']['active'] == 1 ) { echo 'checked=checked'; } ?> <?php if ( isset( $list['custom_template']['active'] ) && $list['custom_template']['active'] == 1 ) { echo 'disabled=disabled'; } ?> />
|
2898 |
+
<span class="description yks-margin-left"><?php _e( 'set custom styles for this form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
2899 |
+
<!-- drop down of registered posts/pages -->
|
2900 |
+
<li id="custom-style-list" class="yks_mc_pages_dropdown_<?php echo $list['id']; ?>" <?php if( !isset($list['custom_styles']) || $list['custom_styles']['active'] == '0') { echo 'style="list-style:none;display:none;"'; } else { echo 'style="list-style:none;"'; } ?> >
|
2901 |
+
|
2902 |
+
<h4><?php _e( 'Custom Form Styles' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="#TB_inline?width=600&inlineId=formPreviewContainer" class="thickbox button-secondary populatePreviewFormContainer">preview form</a></h4>
|
2903 |
+
|
2904 |
+
<table class="custom_style_table style_table_left yks-mailchimp-fields-container yks-mailchimp-fields-list">
|
2905 |
|
2906 |
+
<tr class="yks-mailchimp-fields-list-row">
|
2907 |
+
<td><?php _e( 'Form Background Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
|
2908 |
+
<td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_background_color'] ) ) { echo $list['custom_styles']['yks_mc_form_background_color']; } else { echo '#fff'; } ?>" class="yks-mc-color-picker" name="yks-mc-background-color" data-default-color="#fff" /></td>
|
2909 |
+
</tr>
|
2910 |
+
<tr class="yks-mailchimp-fields-list-row">
|
2911 |
+
<td><?php _e( 'Text Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
|
2912 |
+
<td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_text_color'] ) ) { echo $list['custom_styles']['yks_mc_form_text_color']; } else { echo '#333'; } ?>" class="yks-mc-color-picker" name="yks-mc-text-color" data-default-color="#333" /></td>
|
2913 |
+
</tr>
|
2914 |
+
<tr class="yks-mailchimp-fields-list-row">
|
2915 |
+
<td><?php _e( 'Submit Button Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
|
2916 |
+
<td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_submit_button_color'] ) ) { echo $list['custom_styles']['yks_mc_submit_button_color']; } else { echo '#3ed664'; } ?>" class="yks-mc-color-picker" name="yks-mc-submit-button-color" data-default-color="#3ed664" /></td>
|
2917 |
+
</tr>
|
2918 |
+
<tr class="yks-mailchimp-fields-list-row">
|
2919 |
+
<td><?php _e( 'Submit Button Text Color' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
|
2920 |
+
<td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_submit_button_text_color'] ) ) { echo $list['custom_styles']['yks_mc_submit_button_text_color']; } else { echo '#fff'; } ?>" class="yks-mc-color-picker" name="yks-mc-submit-button-text-color" data-default-color="#fff" /></td>
|
2921 |
+
</tr>
|
2922 |
+
</table>
|
2923 |
+
|
2924 |
+
|
2925 |
+
|
2926 |
+
<table class="custom_style_table style_table_right yks-mailchimp-fields-container yks-mailchimp-fields-list">
|
2927 |
+
<tr class="yks-mailchimp-fields-list-row">
|
2928 |
+
<td><?php _e( 'Form Padding' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
|
2929 |
+
<td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_padding'] ) ) { echo $list['custom_styles']['yks_mc_form_padding'].$list['custom_styles']['yks_mc_form_padding_measurement']; } else { echo '1em'; } ?>" name="yks-mc-form-padding" /></td>
|
2930 |
+
</tr>
|
2931 |
+
<tr class="yks-mailchimp-fields-list-row">
|
2932 |
+
<td><?php _e( 'Form Width (% works best)' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
|
2933 |
+
<td class="custom-styles-input-td"><input type="text" value="<?php if ( isset( $list['custom_styles']['yks_mc_form_width'] ) ) { echo $list['custom_styles']['yks_mc_form_width']; } else { echo '100%'; } ?>" name="yks-mc-form-width" /></td>
|
2934 |
+
</tr>
|
2935 |
+
<tr class="yks-mailchimp-fields-list-row">
|
2936 |
+
<td><?php _e( 'Form Alignment' , 'yikes-inc-easy-mailchimp-extender' ); ?></td>
|
2937 |
+
<td class="custom-styles-input-td">
|
2938 |
+
<select name="yks-mc-form-alignment">
|
2939 |
+
|
2940 |
+
<option value="none" <?php if ( !isset( $list['custom_styles']['yks_mc_form_alignment'] ) || $list['custom_styles']['yks_mc_form_alignment'] == 'none' ) { echo 'selected="selected"'; } ?>><?php _e( 'None' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
|
2941 |
+
<option value="left" <?php if ( isset( $list['custom_styles']['yks_mc_form_alignment'] ) && $list['custom_styles']['yks_mc_form_alignment'] == 'left' ) { echo 'selected="selected"'; } ?>><?php _e( 'Left' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
|
2942 |
+
<option value="center" <?php if ( isset( $list['custom_styles']['yks_mc_form_alignment'] ) && $list['custom_styles']['yks_mc_form_alignment'] == 'center' ) { echo 'selected="selected"'; } ?>><?php _e( 'Center' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
|
2943 |
+
<option value="right" <?php if ( isset( $list['custom_styles']['yks_mc_form_alignment'] ) && $list['custom_styles']['yks_mc_form_alignment'] == 'right' ) { echo 'selected="selected"'; } ?>><?php _e( 'Right' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
|
2944 |
+
</select>
|
2945 |
+
</td>
|
2946 |
+
</tr>
|
2947 |
+
</table>
|
2948 |
+
|
2949 |
+
</li>
|
2950 |
+
</span>
|
2951 |
+
</td>
|
2952 |
+
</tr>
|
2953 |
+
<tr valign="top">
|
2954 |
+
<th scope="row"><label for="yks-mailchimp-url-redirect"><?php _e( 'Form Template' , 'yikes-inc-easy-mailchimp-extender' ); ?></label></th>
|
2955 |
+
<td>
|
2956 |
+
<span class="yks-mailchimp-custom-template-holder">
|
2957 |
+
<input type="checkbox" name="yks_mailchimp_custom_template_<?php echo $list['id']; ?>" class="yks_mailchimp_custom_template" id="yks-mailchimp-custom-template-<?php echo $list['id']; ?>" value="1" <?php if ( isset( $list['custom_template']['active'] ) && $list['custom_template']['active'] == 1 ) { echo 'checked=checked'; } ?> <?php if ( isset( $list['custom_styles']['active'] ) && $list['custom_styles']['active']== 1 ) { echo 'disabled=disabled'; } ?> />
|
2958 |
+
<span class="description yks-margin-left"><?php _e( 'set a template for this form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
2959 |
+
<!-- template selection dropdown -->
|
2960 |
+
<li id="custom-template-list" class="yks_mc_template_dropdown_<?php echo $list['id']; ?>" <?php if( !isset($list['custom_template']) || $list['custom_template']['active'] == '0') { echo 'style="list-style:none;display:none;"'; } else { echo 'style="list-style:none;"'; } ?> >
|
2961 |
+
<span class="template-dropdown-list">
|
2962 |
+
|
2963 |
+
<h4><?php _e( 'Select a Template' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="#TB_inline?width=600&inlineId=formPreviewContainer" class="thickbox button-secondary populatePreviewFormContainer custom_template">preview form</a> <?php if( !is_dir( get_stylesheet_directory() . '/yikes-mailchimp-user-templates' ) ) { ?> <a href="#" onclick="return false;" class="button-secondary import_template_boilerplates">import boilerplate files</a><a href="#TB_inline?width=600&height=550&inlineId=user_template_how_to" class="thickbox whats-this-help">whats this?</a><?php } ?></h4>
|
2964 |
+
<?php
|
2965 |
+
// build our custom template dropdown
|
2966 |
+
$this->buildCustomTemplateDropdown($list);
|
2967 |
+
?>
|
2968 |
+
</span>
|
2969 |
+
</li>
|
2970 |
+
<li style="list-style:none;margin-top:1em;">
|
2971 |
+
<span class="description"><?php _e( 'note : some light css styling may be necessary to fit in with your theme.' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
2972 |
+
</li>
|
2973 |
+
|
2974 |
+
</span>
|
2975 |
+
</td>
|
2976 |
+
|
2977 |
+
|
2978 |
+
</tr>
|
2979 |
+
<!-- end custom template selection -->
|
2980 |
+
</td>
|
2981 |
+
</tr>
|
2982 |
+
<tr>
|
2983 |
+
<td></td>
|
2984 |
+
<td>
|
2985 |
+
<input type="submit" name="submit" class="yks-mailchimp-list-update button-primary" value="<?php _e( 'Save Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" rel="<?php echo $list['id']; ?>" />
|
2986 |
+
<input type="button" name="delete" class="yks-mailchimp-delete button-primary" value="<?php _e( 'Delete Form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" rel="<?php echo $list['id']; ?>" data-title="<?php echo $thename; ?>" />
|
2987 |
+
<input type="button" name="import" class="yks-mailchimp-import button-primary" value="<?php _e( 'Re-Import Form Fields from MailChimp' , 'yikes-inc-easy-mailchimp-extender' ); ?>" rel="<?php echo $list['id']; ?>" />
|
2988 |
+
</td>
|
2989 |
+
</tr>
|
2990 |
+
</tbody>
|
2991 |
+
</table>
|
2992 |
+
</form>
|
2993 |
+
</div>
|
2994 |
+
</div>
|
2995 |
+
<?php
|
2996 |
+
$i++;
|
2997 |
+
}
|
2998 |
+
?>
|
2999 |
+
<!-- run loop to display content here -->
|
3000 |
+
<!-- thickbox for our hidden content, we will display subscribed peoples here based on which link is clicked -->
|
3001 |
+
<?php add_thickbox(); ?>
|
3002 |
+
<div id="yikes-mailchimp-subscribers-box" style="display:none;">
|
3003 |
+
<img class="mailChimp_get_subscribers_preloader" src="<?php echo admin_url().'/images/wpspin_light.gif'; ?>" alt="preloader" >
|
3004 |
+
<div class="yks_mc_subscribers">
|
3005 |
+
</div>
|
3006 |
</div>
|
3007 |
<?php
|
3008 |
+
}
|
3009 |
+
$output = ob_get_contents();
|
3010 |
+
ob_end_clean();
|
3011 |
+
return $output;
|
3012 |
+
}
|
3013 |
+
|
3014 |
+
// Generate the Merge Variable containers on the lists page
|
3015 |
+
// we use this function to re-import merge variables from mailchimp
|
3016 |
+
public function generateMergeVariableContainers($listArr=false)
|
3017 |
+
{
|
3018 |
+
$listArr = ($listArr == false ? $this->optionVal['lists'] : $listArr);
|
3019 |
+
$thelistdata = $this->getListsData(); //Get list names from API
|
3020 |
+
// if there are any imported lists in the array
|
3021 |
+
if(count($listArr) > 0)
|
3022 |
+
{
|
3023 |
+
ob_start();
|
3024 |
+
// loop over each lists and build the page
|
3025 |
+
$i = 1;
|
3026 |
+
foreach($listArr as $list)
|
3027 |
+
{
|
3028 |
+
|
3029 |
+
$get_list_data = $this->getListsData();
|
3030 |
+
?>
|
3031 |
+
<td class="yks-mailchimp-fields-td" id="yks-mailchimp-fields-td_<?php echo $list['id']; ?>">
|
3032 |
+
<fieldset class="yks-mailchimp-fields-container" id="yks-mailchimp-fields-container_<?php echo $list['id']; ?>">
|
3033 |
+
<legend class="screen-reader-text"><span><?php _e( 'Active Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></legend>
|
3034 |
+
<div class="yks-mailchimp-fields-list" id="yks-mailchimp-fields-list_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
|
3035 |
+
<!-- create sortable rows populated with mailchimp data -->
|
3036 |
+
<?php
|
3037 |
+
$num = 1;
|
3038 |
+
foreach($list['fields'] as $field) { ?>
|
3039 |
+
<div class="yks-mailchimp-fields-list-row">
|
3040 |
+
<label title="<?php echo $field['name']; ?>" rel="<?php echo $field['id']; ?>">
|
3041 |
+
<span class="yks-mailchimp-sorthandle"><?php _e( 'Drag' , 'yikes-inc-easy-mailchimp-extender' ); ?> & <?php _e( 'drop' , 'yikes-inc-easy-mailchimp-extender' ); ?></span>
|
3042 |
+
<input type="checkbox" name="<?php echo $field['name']; ?>" id="<?php echo $field['id']; ?>" value="1" <?php echo ($field['active'] == 1 ? 'checked="checked"' : ''); ?><?php echo ($field['require'] == 1 ? 'disabled="disabled"' : ''); ?> />
|
3043 |
+
|
3044 |
+
<div class="yks-mailchimp-field-name"><?php echo $field['label']; ?></div>
|
3045 |
+
</label>
|
3046 |
+
<span class="yks-mailchimp-field-merge"><span class="description"><?php _e( 'Merge field' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> *|<input type="text" class="merge_field_input" name="<?php echo $field['name']; ?>-merge" id="<?php echo $field['id']; ?>-merge" value="<?php echo $field['merge']; ?>"<?php echo (($field['locked'] == 1 || $field['merge'] == false) ? ' disabled="disabled"' : ''); ?> />|*</span>
|
3047 |
+
<span class="yks-mailchimp-field-placeholder"><span class="description"><?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> *|<input type="text" name="placeholder-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-placeholder" placeholder="<?php echo $field['label']; ?>" value="<?php if(isset($field['placeholder-'.$list['id'].'-'.$num])) { echo $field['placeholder-'.$list['id'].'-'.$num]; } ?>" />|*</span>
|
3048 |
+
<span class="yks-mailchimp-field-custom-field-class"><span class="description"><?php _e( 'Custom Class' , 'yikes-inc-easy-mailchimp-extender' ); ?>:</span> *|<input type="text" name="custom-field-class-<?php echo $list['id'].'-'.$num; ?>" id="<?php echo $field['id']; ?>-custom-field-class" value="<?php if(isset($field['custom-field-class-'.$list['id'].'-'.$num])) { echo $field['custom-field-class-'.$list['id'].'-'.$num]; } ?>" />|*</span>
|
3049 |
+
</div>
|
3050 |
+
<?php
|
3051 |
+
$num++;
|
3052 |
+
} ?>
|
3053 |
+
</div>
|
3054 |
+
</fieldset>
|
3055 |
+
</td>
|
3056 |
+
<?php
|
3057 |
+
$i++;
|
3058 |
}
|
3059 |
}
|
3060 |
$output = ob_get_contents();
|
3061 |
ob_end_clean();
|
3062 |
return $output;
|
3063 |
}
|
3064 |
+
// end merge variable container
|
3065 |
+
|
3066 |
// Generate our front end JavaScript , used to submit forms
|
3067 |
public function getFrontendFormJavascript($list='')
|
3068 |
{
|
3169 |
// Display the form inside of a table
|
3170 |
// if the user has selected table as their flavor on the settings page
|
3171 |
// make sure this matches exactly with the div flavor below (currently does not)
|
3172 |
+
case '0':
|
3173 |
?>
|
3174 |
<!-- BEGIN TABLE FLAVOR -->
|
3175 |
<table class="yks-mailchimpFormTable">
|
3292 |
// Display the form inside of a div
|
3293 |
// if the user has selected div as their flavor on the settings page
|
3294 |
case '1':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3295 |
?>
|
3296 |
+
<div class="yks-mailchimpFormDiv">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3297 |
<?php
|
3298 |
+
/* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
|
3299 |
+
if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
|
3300 |
+
$reCAPTCHA_style = $this->optionVal['recaptcha-style'];
|
3301 |
+
|
3302 |
+
// if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
|
3303 |
+
if ( $this->yks_mc_is_user_localhost() ) {
|
3304 |
+
$reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
|
3305 |
+
} else {
|
3306 |
+
$reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
|
3307 |
}
|
3308 |
+
// set up the CAPTCHA theme
|
3309 |
+
?>
|
3310 |
+
<script>var RecaptchaOptions = {
|
3311 |
+
theme : '<?php echo $reCAPTCHA_style; ?>'
|
3312 |
+
};
|
3313 |
+
</script>
|
3314 |
+
<?php
|
3315 |
+
$this->includeRECAPTCHAlib();
|
3316 |
+
$reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
|
3317 |
+
$reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
|
3318 |
+
}
|
3319 |
+
$num = 1;
|
3320 |
+
|
3321 |
+
foreach($list['fields'] as $field) : if($field['active'] == 1) :
|
3322 |
+
|
3323 |
+
// get field placeholders
|
3324 |
+
$form_id = explode( '-', $field['id']);
|
3325 |
+
|
3326 |
+
$field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
|
3327 |
+
echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
|
3328 |
+
?>
|
3329 |
+
<!-- javascript to populate the correct form fields, with the specified place-holder value, on the lists page -->
|
3330 |
+
<script>
|
3331 |
+
jQuery(document).ready(function() {
|
3332 |
+
var hiddenInputClass = '<?php echo $field['name']; ?>';
|
3333 |
+
// alert('<?php echo $num; ?>');
|
3334 |
+
var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
|
3335 |
+
jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
|
3336 |
+
});
|
3337 |
+
</script>
|
3338 |
+
<?php
|
3339 |
+
if ($field['require'] == 1) // if the field is required (set in MailChimp), display the red required star
|
3340 |
+
{
|
3341 |
+
$reqindicator = " <span class='yks-required-label'>*</span>";
|
3342 |
+
$reqlabel = " yks-mailchimpFormDivRowLabel-required";
|
3343 |
+
}
|
3344 |
+
else // else don't
|
3345 |
+
{
|
3346 |
+
$reqindicator = "";
|
3347 |
+
$reqlabel = "";
|
3348 |
+
}
|
3349 |
+
?>
|
3350 |
+
<div class="yks-mailchimpFormDivRow">
|
3351 |
+
<label class="prompt yks-mailchimpFormDivRowLabel<?php echo $reqlabel; ?>" for="<?php echo $field['id']; ?>"><?php echo $field['label']; ?><?php echo $reqindicator; ?></label>
|
3352 |
+
<div class="yks-mailchimpFormDivRowField">
|
3353 |
+
<!-- run our function to generate the input fields for the form, passing in the field -->
|
3354 |
+
<?php echo $this->getFrontendFormDisplay_field($field,$num); ?>
|
3355 |
+
</div>
|
3356 |
+
</div>
|
3357 |
+
<?php
|
3358 |
+
$num++;
|
3359 |
+
endif; endforeach;
|
3360 |
?>
|
3361 |
+
<!-- add our nonce field for security purposes -->
|
3362 |
<div class="yks-mailchimpFormDivRow">
|
3363 |
+
<?php wp_nonce_field( 'yks_mc_front_end_form_'.$form_id[1] ); ?>
|
|
|
|
|
|
|
|
|
3364 |
</div>
|
3365 |
+
|
3366 |
+
<div class="yks-mailchimpFormDivRow">
|
3367 |
+
<!-- run our function to generate the interest group fields for the form, passing in the form id -->
|
3368 |
+
<?php $this->getInterestGroups($form_id[1]); ?>
|
3369 |
+
<div class="yks-mailchimpFormDivSubmit">
|
3370 |
+
<?php
|
3371 |
+
if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
|
3372 |
+
echo $reCAPTCHA_image;
|
3373 |
+
} else if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] == '' || $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-private-api-key'] == '') {
|
3374 |
+
echo '<div class="yks_mc_recaptcha_api_key_error">'. __('reCAPTCHA API Key Error. Please double check your API Keys.' , 'yikes-inc-easy-mailchimp-extender') . '</div>';
|
3375 |
+
}
|
3376 |
+
?>
|
3377 |
+
<p><input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="<?php if($submit_text != '') { echo $submit_text; } else { echo 'Sign Up'; } ?>" /></p>
|
3378 |
+
</div>
|
3379 |
+
</div>
|
3380 |
+
</div>
|
3381 |
+
<?php
|
3382 |
+
// Create and store our variables for the redirection
|
3383 |
+
$form_id = explode('-', $field['id']); // get the form ID
|
3384 |
+
$redirect_value = (isset($field['yks_mailchimp_redirect_'.$form_id[1]]) ? $field['yks_mailchimp_redirect_'.$form_id[1]] : ''); // get the redirect value from the lists page redirect checkbox
|
3385 |
+
$redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
|
3386 |
+
$site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
|
3387 |
+
$redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
|
3388 |
+
// if redirection was set up for this form, print out our javascript to complete the redirect
|
3389 |
+
if ($redirect_value == 1) {
|
3390 |
+
?>
|
3391 |
+
<script>
|
3392 |
+
jQuery(document).ready(function() {
|
3393 |
+
// jquery redirect on form submission
|
3394 |
+
var formRedirectPage = '<?php echo $redirect_url ?>';
|
3395 |
+
var formID = '<?php echo $form_id[0].'-'.$form_id[1]; ?>';
|
3396 |
+
jQuery('#yks-mailchimp-form_'+formID).submit(function() {
|
3397 |
+
var interval = setInterval(function() {
|
3398 |
+
if ( jQuery('.yks-success').is(':visible') ) {
|
3399 |
+
window.location.replace(formRedirectPage);
|
3400 |
+
clearInterval(interval);
|
3401 |
+
return;
|
3402 |
+
}
|
3403 |
+
//do whatever here..
|
3404 |
+
}, 2000);
|
3405 |
+
});
|
3406 |
+
});
|
3407 |
+
</script>
|
3408 |
+
<?php
|
3409 |
+
}
|
3410 |
+
break;
|
3411 |
+
}
|
3412 |
+
$output = ob_get_contents();
|
3413 |
+
ob_end_clean();
|
3414 |
+
return $output;
|
3415 |
+
}
|
3416 |
+
|
3417 |
+
// Generate the form on the front end of the site
|
3418 |
+
// this is what the user will see, and interact with
|
3419 |
+
public function getFrontendFormDisplay_placeholder_labels($list='', $submit_text)
|
3420 |
+
{
|
3421 |
+
if($list === '') return false;
|
3422 |
+
ob_start();
|
3423 |
+
switch($this->optionVal['flavor'])
|
3424 |
+
{
|
3425 |
+
default:
|
3426 |
+
// Display the form inside of a table
|
3427 |
+
// if the user has selected table as their flavor on the settings page
|
3428 |
+
// make sure this matches exactly with the div flavor below (currently does not)
|
3429 |
+
case '0':
|
3430 |
+
?>
|
3431 |
+
<!-- BEGIN TABLE FLAVOR -->
|
3432 |
+
<table class="yks-mailchimpFormTable">
|
3433 |
+
<?php
|
3434 |
+
/* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
|
3435 |
+
if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
|
3436 |
+
|
3437 |
+
$reCAPTCHA_style = $this->optionVal['recaptcha-style'];
|
3438 |
+
|
3439 |
+
// if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
|
3440 |
+
if ( $this->yks_mc_is_user_localhost() ) {
|
3441 |
+
$reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
|
3442 |
+
} else {
|
3443 |
+
$reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
|
3444 |
+
}
|
3445 |
+
// set up the CAPTCHA theme
|
3446 |
+
?>
|
3447 |
+
<script>var RecaptchaOptions = {
|
3448 |
+
theme : '<?php echo $reCAPTCHA_style; ?>'
|
3449 |
+
};
|
3450 |
+
</script>
|
3451 |
+
<?php
|
3452 |
+
$this->includeRECAPTCHAlib();
|
3453 |
+
$reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
|
3454 |
+
$reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
|
3455 |
+
|
3456 |
+
}
|
3457 |
+
$num = 1;
|
3458 |
+
foreach($list['fields'] as $field) : if($field['active'] == 1) :
|
3459 |
+
// get field placeholders
|
3460 |
+
$form_id = explode( '-', $field['id']);
|
3461 |
+
$field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
|
3462 |
+
echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
|
3463 |
+
|
3464 |
+
// add our nonce field for security purposes
|
3465 |
+
?>
|
3466 |
+
<tr class="yks-mailchimpFormTableRow">
|
3467 |
+
<?php wp_nonce_field( 'yks_mc_front_end_form_'.$form_id[1] ); ?>
|
3468 |
+
</tr>
|
3469 |
+
|
3470 |
+
<!-- javascript to populate the correct form fields, with the specified place-holder value, on the lists page -->
|
3471 |
+
<script>
|
3472 |
+
jQuery(document).ready(function() {
|
3473 |
+
var hiddenInputClass = '<?php echo $field['name']; ?>';
|
3474 |
+
// alert('<?php echo $num; ?>');
|
3475 |
+
var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
|
3476 |
+
jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
|
3477 |
+
});
|
3478 |
+
</script>
|
3479 |
+
<?php
|
3480 |
+
if ($field['require'] == 1) // if the field is required (set in MailChimp), display the red required star
|
3481 |
+
{
|
3482 |
+
$reqindicator = " <span class='yks-required-label'>*</span>";
|
3483 |
+
$reqlabel = " yks-mailchimpFormTableRowLabel-required";
|
3484 |
+
}
|
3485 |
+
else // else don't
|
3486 |
+
{
|
3487 |
+
$reqindicator = "";
|
3488 |
+
$reqlabel = "";
|
3489 |
+
}
|
3490 |
+
?>
|
3491 |
+
<tr class="yks-mailchimpFormTableRow">
|
3492 |
+
<!-- run our function to generate the input fields for the form, passing in the field -->
|
3493 |
+
<?php echo $this->getFrontendFormDisplay_field($field); ?>
|
3494 |
+
</tr>
|
3495 |
+
<?php
|
3496 |
+
$num++;
|
3497 |
+
endif; endforeach;
|
3498 |
+
?>
|
3499 |
+
<tr class="yks-mailchimpFormTableRow">
|
3500 |
+
<!-- run our function to generate the interest group fields for the form, passing in the form id -->
|
3501 |
+
<?php echo $this->getInterestGroups($form_id[1]); ?>
|
3502 |
+
<td class="yks-mailchimpFormTableSubmit">
|
3503 |
+
<?php
|
3504 |
+
if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
|
3505 |
+
echo $reCAPTCHA_image;
|
3506 |
+
} else if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] == '' || $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-private-api-key'] == '') {
|
3507 |
+
echo '<div class="yks_mc_recaptcha_api_key_error">'. __('reCAPTCHA API Key Error. Please double check your API Keys.' , 'yikes-inc-easy-mailchimp-extender') . '</div>';
|
3508 |
+
}
|
3509 |
+
?>
|
3510 |
+
<input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="<?php if($submit_text != '') { echo $submit_text; } else { echo 'Sign Up'; } ?>" />
|
3511 |
+
</td>
|
3512 |
+
</tr>
|
3513 |
+
</table>
|
3514 |
<?php
|
3515 |
// Create and store our variables for the redirection
|
3516 |
$form_id = explode('-', $field['id']); // get the form ID
|
3518 |
$redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
|
3519 |
$site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
|
3520 |
$redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
|
3521 |
+
// if redirection was set up for this form, print out our javascript to complete the redirect
|
3522 |
+
if ($redirect_value == 1) { // only redirect if successful form submission <-----
|
3523 |
+
?>
|
3524 |
+
<script>
|
3525 |
+
jQuery(document).ready(function() {
|
3526 |
+
// jquery redirect on form submission
|
3527 |
+
var formRedirectPage = '<?php echo $redirect_url ?>';
|
3528 |
+
var formID = '<?php echo $form_id[0].'-'.$form_id[1]; ?>';
|
3529 |
+
jQuery('#yks-mailchimp-form_'+formID).submit(function() {
|
3530 |
+
var interval = setInterval(function() {
|
3531 |
+
if ( jQuery('.yks-success').is(':visible') ) {
|
3532 |
+
window.location.replace(formRedirectPage);
|
3533 |
+
clearInterval(interval);
|
3534 |
+
return;
|
3535 |
+
}
|
3536 |
+
//do whatever here..
|
3537 |
+
}, 2000);
|
3538 |
+
});
|
3539 |
+
});
|
3540 |
+
</script>
|
3541 |
+
<?php
|
3542 |
+
}
|
3543 |
+
break;
|
3544 |
+
|
3545 |
+
// END TABLE FLAVOR
|
3546 |
+
|
3547 |
+
// Display the form inside of a div
|
3548 |
+
// if the user has selected div as their flavor on the settings page
|
3549 |
+
case '1':
|
3550 |
+
?>
|
3551 |
+
<div class="yks-mailchimpFormDiv">
|
3552 |
+
<?php
|
3553 |
+
/* if reCAPTCHA is enabled, we want to display the CAPTCHA form */
|
3554 |
+
if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
|
3555 |
+
$reCAPTCHA_style = $this->optionVal['recaptcha-style'];
|
3556 |
+
|
3557 |
+
// if on localhost , we should replace backward slash (\) with forward slashes (/) to prevent escaped characters
|
3558 |
+
if ( $this->yks_mc_is_user_localhost() ) {
|
3559 |
+
$reCAPTCHA_lib_path = str_replace( '\\' , '/' , YKSEME_PATH."lib/recaptchalib.php" );
|
3560 |
+
} else {
|
3561 |
+
$reCAPTCHA_lib_path = YKSEME_PATH."lib/recaptchalib.php.";
|
3562 |
+
}
|
3563 |
+
// set up the CAPTCHA theme
|
3564 |
+
?>
|
3565 |
+
<script>var RecaptchaOptions = {
|
3566 |
+
theme : '<?php echo $reCAPTCHA_style; ?>'
|
3567 |
+
};
|
3568 |
+
</script>
|
3569 |
+
<?php
|
3570 |
+
$this->includeRECAPTCHAlib();
|
3571 |
+
$reCAPTCHA_api_key = $this->optionVal['recaptcha-api-key'];
|
3572 |
+
$reCAPTCHA_image = recaptcha_get_html($reCAPTCHA_api_key);
|
3573 |
+
}
|
3574 |
+
$num = 1;
|
3575 |
+
|
3576 |
+
foreach($list['fields'] as $field) : if($field['active'] == 1) :
|
3577 |
+
|
3578 |
+
// get field placeholders
|
3579 |
+
$form_id = explode( '-', $field['id']);
|
3580 |
+
|
3581 |
+
$field_placeholder_ = (isset($field['placeholder-'.$form_id[1].'-'.$num]) ? $field['placeholder-'.$form_id[1].'-'.$num] : '');
|
3582 |
+
echo '<input type="hidden" class="'.$field['name'].'_placeholder_value" value="'.$field_placeholder_.'">';
|
3583 |
+
?>
|
3584 |
+
<!-- javascript to populate the correct form fields, with the specified place-holder value, on the lists page -->
|
3585 |
+
<script>
|
3586 |
+
jQuery(document).ready(function() {
|
3587 |
+
var hiddenInputClass = '<?php echo $field['name']; ?>';
|
3588 |
+
// alert('<?php echo $num; ?>');
|
3589 |
+
var hiddenInputClassValue = jQuery('.'+hiddenInputClass+'_placeholder_value').val();
|
3590 |
+
jQuery('input[name="'+hiddenInputClass+'"]').attr("placeholder", hiddenInputClassValue);
|
3591 |
+
});
|
3592 |
+
</script>
|
3593 |
+
<?php
|
3594 |
+
if ($field['require'] == 1) // if the field is required (set in MailChimp), display the red required star
|
3595 |
+
{
|
3596 |
+
$reqindicator = " <span class='yks-required-label'>*</span>";
|
3597 |
+
$reqlabel = " yks-mailchimpFormDivRowLabel-required";
|
3598 |
+
}
|
3599 |
+
else // else don't
|
3600 |
+
{
|
3601 |
+
$reqindicator = "";
|
3602 |
+
$reqlabel = "";
|
3603 |
+
}
|
3604 |
+
?>
|
3605 |
+
<div class="yks-mailchimpFormDivRow">
|
3606 |
+
<div class="yks-mailchimpFormDivRowField">
|
3607 |
+
<!-- run our function to generate the input fields for the form, passing in the field -->
|
3608 |
+
<?php echo $this->getFrontendFormDisplay_field($field,$num); ?>
|
3609 |
+
</div>
|
3610 |
+
</div>
|
3611 |
+
<?php
|
3612 |
+
$num++;
|
3613 |
+
endif; endforeach;
|
3614 |
+
?>
|
3615 |
+
<!-- add our nonce field for security purposes -->
|
3616 |
+
<div class="yks-mailchimpFormDivRow">
|
3617 |
+
<?php wp_nonce_field( 'yks_mc_front_end_form_'.$form_id[1] ); ?>
|
3618 |
+
</div>
|
3619 |
+
|
3620 |
+
<div class="yks-mailchimpFormDivRow">
|
3621 |
+
<!-- run our function to generate the interest group fields for the form, passing in the form id -->
|
3622 |
+
<?php $this->getInterestGroups($form_id[1]); ?>
|
3623 |
+
<div class="yks-mailchimpFormDivSubmit">
|
3624 |
+
<?php
|
3625 |
+
if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] != '' && $this->optionVal['recaptcha-private-api-key'] != '' ) {
|
3626 |
+
echo $reCAPTCHA_image;
|
3627 |
+
} else if ( $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-api-key'] == '' || $this->optionVal['recaptcha-setting'] == '1' && $this->optionVal['recaptcha-private-api-key'] == '') {
|
3628 |
+
echo '<div class="yks_mc_recaptcha_api_key_error">'. __('reCAPTCHA API Key Error. Please double check your API Keys.' , 'yikes-inc-easy-mailchimp-extender') . '</div>';
|
3629 |
+
}
|
3630 |
+
?>
|
3631 |
+
<p><input type="submit" class="ykfmc-submit" id="ykfmc-submit_<?php echo $list['id']; ?>" value="<?php if($submit_text != '') { echo $submit_text; } else { echo 'Sign Up'; } ?>" /></p>
|
3632 |
+
</div>
|
3633 |
+
</div>
|
3634 |
+
</div>
|
3635 |
+
<?php
|
3636 |
+
// Create and store our variables for the redirection
|
3637 |
+
$form_id = explode('-', $field['id']); // get the form ID
|
3638 |
+
$redirect_value = (isset($field['yks_mailchimp_redirect_'.$form_id[1]]) ? $field['yks_mailchimp_redirect_'.$form_id[1]] : ''); // get the redirect value from the lists page redirect checkbox
|
3639 |
+
$redirect_page = (isset($field['page_id_'.$form_id[1]]) ? $field['page_id_'.$form_id[1]] : '') ; // get the redirect page that was set in the pages dropdown on the lists page
|
3640 |
+
$site_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // grab and store the current sites URL
|
3641 |
+
$redirect_url = get_permalink($redirect_page); // get the permalink of the page we are going to redirect too
|
3642 |
// if redirection was set up for this form, print out our javascript to complete the redirect
|
3643 |
if ($redirect_value == 1) {
|
3644 |
?>
|
3670 |
|
3671 |
// Generate the input fields for the form on the front end of the site
|
3672 |
// based on the $field['type'] that is returned from MailChimp
|
3673 |
+
private function getFrontendFormDisplay_field($field=false,$num)
|
3674 |
{
|
3675 |
if($field === false) return false;
|
3676 |
$o = '';
|
|
|
3677 |
$fieldID = $field['id'];
|
3678 |
+
$exploded_field_id = explode( '-' , $fieldID );
|
3679 |
+
$form_id = $exploded_field_id[1];
|
3680 |
+
|
3681 |
+
// check to see if the custom class has been set up...
|
3682 |
+
if ( isset( $field['custom-field-class-'.$form_id.'-'.$num] ) ) {
|
3683 |
+
$custom_class = $field['custom-field-class-'.$form_id.'-'.$num];
|
3684 |
+
} else {
|
3685 |
+
$custom_class = '';
|
3686 |
+
}
|
3687 |
|
3688 |
switch($field['type'])
|
3689 |
{
|
3696 |
case 'website':
|
3697 |
case 'imageurl':
|
3698 |
// custom placeholder value goes here
|
3699 |
+
$o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : '') . ' ' . $custom_class . '" id="'.$field['id'].'" value="" />';
|
3700 |
+
|
3701 |
break;
|
3702 |
case 'dropdown':
|
3703 |
+
$o .= '<select name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'">';
|
3704 |
if(count($field['choices']) > 0) : foreach($field['choices'] as $ok => $ov) :
|
3705 |
$o .= '<option value="'.htmlentities($ov, ENT_QUOTES).'">'.$ov.'</option>';
|
3706 |
endforeach; endif;
|
3708 |
break;
|
3709 |
case 'address':
|
3710 |
|
3711 |
+
$o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'" value="" /><span class="yks-mailchimp-form-tooltip">Street Address</span>';
|
3712 |
+
$o .= '<input type="text" name="'.$field['name'].'-add2" class="'.$field['name'].'-add2'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-add2" value="" /><span class="yks-mailchimp-form-tooltip">Apt/Suite</span>';
|
3713 |
+
$o .= '<input type="text" name="'.$field['name'].'-city" class="'.$field['name'].'-city'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-city" value="" /><span class="yks-mailchimp-form-tooltip">City</span>';
|
3714 |
+
$o .= '<input type="text" name="'.$field['name'].'-state" class="'.$field['name'].'-state'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-state" value="" /><span class="yks-mailchimp-form-tooltip">State</span>';
|
3715 |
+
$o .= '<input type="text" name="'.$field['name'].'-zip" class="'.$field['name'].'-zip'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-zip" value="" /><span class="yks-mailchimp-form-tooltip">Zip</span>';
|
3716 |
break;
|
3717 |
case 'radio':
|
3718 |
if(count($field['choices']) > 0) : $ct=0; foreach($field['choices'] as $ok => $ov) :
|
3719 |
$ct++;
|
3720 |
+
$o .= '<label for="'.$field['id'].'-'.$ok.'"><input type="radio" name="'.$field['name'].'" class="'.$field['name'].($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'-'.$ok.'" value="'.htmlentities($ov, ENT_QUOTES).'" />'.$ov.'</label>';
|
3721 |
if($ct < count($field['choices']))
|
3722 |
$o .= '<br />';
|
3723 |
endforeach; endif;
|
3724 |
break;
|
3725 |
case 'date':
|
3726 |
case 'birthday':
|
3727 |
+
$o .= '<input type="text" name="'.$field['name'].'" class="'.$field['name'].' yks-field-type-date'.($field['require'] == 1 ? ' yks-require' : ''). ' ' . $custom_class .'" id="'.$field['id'].'" value="" />';
|
3728 |
break;
|
3729 |
+
|
3730 |
+
|
3731 |
}
|
3732 |
+
|
3733 |
return $o;
|
3734 |
}
|
3735 |
|
3736 |
+
|
3737 |
/***** DROPDOWNS
|
3738 |
****************************************************************************************************/
|
3739 |
// not sure we need these any more
|
3790 |
{
|
3791 |
if(call_user_func(array(&$this, $updateFunction)))
|
3792 |
{
|
3793 |
+
update_option( YKSEME_OPTION, YKSEME_VERSION_CURRENT );
|
3794 |
$this->runUpdateTasks();
|
3795 |
}
|
3796 |
}
|
3869 |
return true;
|
3870 |
}
|
3871 |
|
3872 |
+
// generate a thickbox container
|
3873 |
+
// to display our new merge variable
|
3874 |
+
// buttons
|
3875 |
+
// To Do : version 5.2
|
3876 |
+
function generateNewMergeVariableContainer() {
|
3877 |
+
?>
|
3878 |
+
<div id="newMergeVariableContainer" style="display:none;">
|
3879 |
+
<p>
|
3880 |
+
<h4 style="width:100%;text-align:center;">Select New Field</h4>
|
3881 |
+
<p>
|
3882 |
+
<a href="#" onclick="return false;" class="button-secondary">Text</a>
|
3883 |
+
<a href="#" onclick="return false;" class="button-secondary">First Name</a>
|
3884 |
+
<a href="#" onclick="return false;" class="button-secondary">Last Name</a>
|
3885 |
+
<a href="#" onclick="return false;" class="button-secondary">Number</a>
|
3886 |
+
<a href="#" onclick="return false;" class="button-secondary">Date</a>
|
3887 |
+
<a href="#" onclick="return false;" class="button-secondary">Dropdown</a>
|
3888 |
+
<a href="#" onclick="return false;" class="button-secondary">Birthday</a>
|
3889 |
+
<a href="#" onclick="return false;" class="button-secondary">Address</a>
|
3890 |
+
<a href="#" onclick="return false;" class="button-secondary">Zip Code</a>
|
3891 |
+
<a href="#" onclick="return false;" class="button-secondary">Phone</a>
|
3892 |
+
<a href="#" onclick="return false;" class="button-secondary">Website</a>
|
3893 |
+
<a href="#" onclick="return false;" class="button-secondary">Image</a>
|
3894 |
+
</p>
|
3895 |
+
</p>
|
3896 |
+
</div>
|
3897 |
+
<?php
|
3898 |
+
}
|
3899 |
+
|
3900 |
+
// generate a thickbox container
|
3901 |
+
// to display a preview of the form
|
3902 |
+
function generateFormPreviewContainer() {
|
3903 |
+
?>
|
3904 |
+
<div id="formPreviewContainer" style="display:none;">
|
3905 |
+
<?php echo '<img src="' . admin_url() . '/images/wpspin_light.gif" alt="preloader" style="margin-left: 50%; margin-top: 25%;">'; ?>
|
3906 |
+
</div>
|
3907 |
+
<?php
|
3908 |
+
}
|
3909 |
+
|
3910 |
+
// generate a thickbox container
|
3911 |
+
// to display a how to in using custom template files
|
3912 |
+
function generateUserTemplateHowTo() {
|
3913 |
+
?>
|
3914 |
+
<div id="user_template_how_to" style="display:none;">
|
3915 |
+
<a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank"><img style="float:left;margin-bottom:0;width:75px;" src="<?php echo YKSEME_URL; ?>/images/yikes_logo.png" alt="YIKES, Inc." id="yksme-yikes-logo" /></a>
|
3916 |
+
<h4 class="user_template_how_to_title"><?php _e( 'Custom User Template Files' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
|
3917 |
+
|
3918 |
+
<p style="margin-top: 2.5em;" ><?php _e( 'With the latest version of YIKES Inc. Easy MailChimp Extender you can now extend the plugin beyond what it can do out of the box. Now you can create your own MailChimp sign up template files and use them with any list , anywhere on your site. We have provided you with a few bundled templates, as well as two boilerplate template files for easy customization.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
|
3919 |
+
|
3920 |
+
<p><?php _e( 'You can create your own templates in two ways.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
|
3921 |
+
<hr />
|
3922 |
+
<ul>
|
3923 |
+
<li><h4><?php _e( 'Automatic Method :' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4><p><?php _e( "The easiest way is to import the template files from the plugin automatically. You can do this by clicking on the 'import boilerplate files' button. This will copy over the necessary files right into your theme. From there you can start editing the template files found in your theme root inside of the newly created 'yikes-inc-easy-mailchimp-extender' directory." , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
|
3924 |
+
<a href="#" onclick="return false;" class="button-secondary import_template_boilerplates" style="width:148px;display:block;margin:0 auto;"><?php _e( "import boilerplate files" , "yikes-inc-easy-mailchimp-extender" ); ?></a>
|
3925 |
+
<hr />
|
3926 |
+
<li><h4><?php _e( 'Manual Method' , 'yikes-inc-easy-mailchimp-extender' ); ?> :</h4><p><?php _e( "If the automatic method doesn't work for you, you can manually copy over the necessary files." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> <p><?php _e( "Copy the following directory" , "yikes-inc-easy-mailchimp-extender" ); ?> :<br /> <em class="yks-mc-file-path"><?php echo YKSEME_PATH . 'templates/yikes-mailchimp-user-templates'; ?></em> <br /><?php _e( " into your theme root, found at " , "yikes-inc-easy-mailchimp-extender" ); ?><br /> <em class="yks-mc-file-path"><?php echo get_stylesheet_directory_uri(); ?></em></p></li>
|
3927 |
+
<hr />
|
3928 |
+
<li><h5><?php _e( "Notes" , "yikes-inc-easy-mailchimp-extender" ); ?></h5></li>
|
3929 |
+
<ul>
|
3930 |
+
<li><p><?php _e( "You can also copy over any of the default bundled themes into the 'yikes-mailchimp-user-templates' directory to customize the look and feel of a default bundled template file." , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
|
3931 |
+
<li><p><?php _e( "If you are having any difficulties copying over the template files, or need help using them please open a support ticket on our" , "yikes-inc-easy-mailchimp-extender" ); ?> <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank"><?php _e( "github issue tracker" , "yikes-inc-easy-mailchimp-extender" ); ?></a>.</p></li>
|
3932 |
+
</ul>
|
3933 |
+
</div>
|
3934 |
+
<?php
|
3935 |
+
}
|
3936 |
+
|
3937 |
+
|
3938 |
+
// generate a thickbox container
|
3939 |
+
// to display a preview of the form
|
3940 |
+
function getFormPreview($shortcode,$form_title,$form_bg_color,$form_text_color,$form_submit_button_color,$form_submit_button_text_color,$form_padding,$form_width,$form_alignment) {
|
3941 |
+
?>
|
3942 |
+
<h4 style="width:100%;text-align:center;">"<?php echo trim( $form_title ); ?>" Form Preview</h4>
|
3943 |
+
<div class="yks_mc_preview_form_container"><?php echo do_shortcode( stripslashes( $shortcode ) ); ?></div>
|
3944 |
+
<!-- override the styles for our preview container -->
|
3945 |
+
<style>
|
3946 |
+
.yks-mailchimpFormContainer {
|
3947 |
+
background: <?php echo $form_bg_color; ?> !important;
|
3948 |
+
padding: <?php echo $form_padding; ?> !important;
|
3949 |
+
color: <?php echo $form_text_color; ?> !important;
|
3950 |
+
width: <?php echo $form_width; ?> !important;
|
3951 |
+
<?php
|
3952 |
+
if ( $form_alignment == 'left' ) {
|
3953 |
+
?>
|
3954 |
+
display: block;
|
3955 |
+
float: left;
|
3956 |
+
<?php
|
3957 |
+
} elseif ( $form_alignment == 'center' ) {
|
3958 |
+
?>
|
3959 |
+
display: block;
|
3960 |
+
margin: 0 auto;
|
3961 |
+
<?php
|
3962 |
+
} elseif ( $form_alignment == 'right' ) {
|
3963 |
+
?>
|
3964 |
+
display: block;
|
3965 |
+
float: right;
|
3966 |
+
<?php
|
3967 |
+
}
|
3968 |
+
?>
|
3969 |
+
}
|
3970 |
+
.yks-mailchimpFormDivRowLabel, .yks_mc_interest_group_label {
|
3971 |
+
color: <?php echo $form_text_color; ?> !important;
|
3972 |
+
}
|
3973 |
+
.ykfmc-submit {
|
3974 |
+
background: <?php echo $form_submit_button_color; ?> !important;
|
3975 |
+
color: <?php echo $form_submit_button_text_color; ?> !important;
|
3976 |
+
}
|
3977 |
+
.yks_mc_interest_group_holder input[type=radio], .yks_mc_interest_group_holder input[type=checkbox] {
|
3978 |
+
margin:0 5px 0 0 !important;
|
3979 |
+
}
|
3980 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists form[name="yks-mailchimp-form"] {
|
3981 |
+
padding: 0 !important;
|
3982 |
+
}
|
3983 |
+
</style>
|
3984 |
+
<?php
|
3985 |
+
}
|
3986 |
+
|
3987 |
+
|
3988 |
+
// Get the selected form template screenshot
|
3989 |
+
function getTemplateScreenshot( $template_name , $template_screenshot , $template_path ) {
|
3990 |
+
|
3991 |
+
$default_headers = array(
|
3992 |
+
'YIKES Inc. MailChimp Template',
|
3993 |
+
'YIKES Inc. MailChimp Template Author',
|
3994 |
+
'YIKES Inc. MailChimp Template Description'
|
3995 |
+
);
|
3996 |
+
// end pre-packaged templates
|
3997 |
+
$template_file_data = get_file_data( $template_path , $default_headers );
|
3998 |
+
|
3999 |
+
?>
|
4000 |
+
<div id="selected_template_preview_container">
|
4001 |
+
<span class="selected_template_preview_header">
|
4002 |
+
<h3 class="template_name"><?php echo $template_name; ?></h3>
|
4003 |
+
|
4004 |
+
<p class="template_author"><strong><?php _e( "Author " , "yikes-inc-easy-mailchimp-extender" ); ?> :</strong> <em> <?php echo $template_file_data[1]; ?></em></p>
|
4005 |
+
</span>
|
4006 |
+
|
4007 |
+
<p><strong><?php _e( "Description" , "yikes-inc-easy-mailchimp-extender" ); ?> :</strong> <?php echo $template_file_data[2]; ?></p>
|
4008 |
+
|
4009 |
+
<hr />
|
4010 |
+
|
4011 |
+
<img class="template_screenshot preview_template_screenshot" style="max-width:100%;" src="<?php echo YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/' . str_replace( ' ' , '_' , $template_name ) . '/' . $template_screenshot; ?>">
|
4012 |
+
</div>
|
4013 |
+
<?php
|
4014 |
+
}
|
4015 |
+
|
4016 |
/**
|
4017 |
* This update needs to pull in all of the custom form
|
4018 |
* data for each of the lists, unfortunately it has to replace
|
4036 |
$this->optionVal['version'] = '2.2.1';
|
4037 |
return true;
|
4038 |
}
|
4039 |
+
|
4040 |
+
// Copy the user template file from within the plugin
|
4041 |
+
// into the users theme root
|
4042 |
+
public function copyUserTemplatesToUserTheme() {
|
4043 |
+
$src = YKSEME_PATH . 'templates/yikes-mailchimp-user-templates';
|
4044 |
+
$dst = get_stylesheet_directory() . '/yikes-mailchimp-user-templates';
|
4045 |
+
|
4046 |
+
function recurse_copy($src,$dst) {
|
4047 |
+
$dir = opendir($src);
|
4048 |
+
// mkdir( $dst . '/yiks-mailchimp-user-templates/' );
|
4049 |
+
mkdir( $dst );
|
4050 |
+
while(false !== ( $file = readdir($dir)) ) {
|
4051 |
+
if (( $file != '.' ) && ( $file != '..' )) {
|
4052 |
+
if ( is_dir($src . '/' . $file) ) {
|
4053 |
+
recurse_copy($src . '/' . $file,$dst . '/' . $file);
|
4054 |
+
}
|
4055 |
+
else {
|
4056 |
+
copy($src . '/' . $file,$dst . '/' . $file);
|
4057 |
+
}
|
4058 |
+
}
|
4059 |
+
}
|
4060 |
+
closedir($dir);
|
4061 |
+
}
|
4062 |
+
recurse_copy( $src , $dst );
|
4063 |
+
|
4064 |
+
|
4065 |
+
}
|
4066 |
+
|
4067 |
+
|
4068 |
+
// recursive directory scanning
|
4069 |
+
// used to retreive template files from bundled+user template directories
|
4070 |
+
function buildCustomTemplateDropdown($list) {
|
4071 |
+
|
4072 |
+
$bundled_template_directory = YKSEME_PATH . 'templates/yikes-mailchimp-bundled-templates/';
|
4073 |
+
$bundled_template_scan = scandir($bundled_template_directory);
|
4074 |
+
|
4075 |
+
$custom_template_directory = get_stylesheet_directory() . '/yikes-mailchimp-user-templates/';
|
4076 |
+
|
4077 |
+
// only scan the directory when files DO exist
|
4078 |
+
if( is_dir( $custom_template_directory ) ) {
|
4079 |
+
$custom_template_scan = scandir($custom_template_directory);
|
4080 |
+
}
|
4081 |
+
|
4082 |
+
echo '<select class="template-selection-dropdown" name="yks-mc-template-file-selection" >';
|
4083 |
+
|
4084 |
+
/* Bundled Template Dropdown Loop */
|
4085 |
+
echo '<optgroup label="Bundled Templates">';
|
4086 |
+
foreach( $bundled_template_scan as $bundled_template ) {
|
4087 |
+
if( $bundled_template != '.' && $bundled_template != '..' ) {
|
4088 |
+
if( is_dir( $bundled_template_directory . $bundled_template ) ) {
|
4089 |
+
$template_path = $this->getTemplateFilePath($bundled_template_directory.$bundled_template);
|
4090 |
+
}
|
4091 |
+
// set the selected option
|
4092 |
+
if ( $list['custom_template']['template_file'] == $template_path ) {
|
4093 |
+
echo '<option value="' . $template_path . '" selected="selected" >' . str_replace( '_' , ' ' , $bundled_template ) . '</option>';
|
4094 |
+
} else {
|
4095 |
+
echo '<option value="' . $template_path . '">' . str_replace( '_' , ' ' , $bundled_template ) . '</option>';
|
4096 |
+
}
|
4097 |
+
|
4098 |
+
}
|
4099 |
+
}
|
4100 |
+
echo '</optgroup>';
|
4101 |
+
|
4102 |
+
|
4103 |
+
echo '<optgroup label="Custom Templates">';
|
4104 |
+
|
4105 |
+
/* Custom Template Dropdown Loop */
|
4106 |
+
if( is_dir( get_stylesheet_directory() . '/yikes-mailchimp-user-templates' ) && count( $custom_template_scan ) >= 1 ) {
|
4107 |
+
|
4108 |
+
foreach( $custom_template_scan as $custom_template ) {
|
4109 |
+
if( $custom_template != '.' && $custom_template != '..' ) {
|
4110 |
+
if( is_dir( $custom_template_directory . $custom_template ) ) {
|
4111 |
+
$custom_template_path = $this->getTemplateFilePath($custom_template_directory.$custom_template);
|
4112 |
+
}
|
4113 |
+
// set the selected option
|
4114 |
+
if ( $list['custom_template']['template_file'] == $custom_template_path ) {
|
4115 |
+
echo '<option value="' . $custom_template_path . '" selected="selected" >' . str_replace( '_' , ' ' , $custom_template ) . '</option>';
|
4116 |
+
} else {
|
4117 |
+
echo '<option value="' . $custom_template_path . '">' . str_replace( '_' , ' ' , $custom_template ) . '</option>';
|
4118 |
+
}
|
4119 |
+
|
4120 |
+
}
|
4121 |
+
}
|
4122 |
+
|
4123 |
+
} else {
|
4124 |
+
echo '<option value="" disabled="disabled">None Found</option>';
|
4125 |
+
}
|
4126 |
+
|
4127 |
+
echo '</optgroup>';
|
4128 |
+
|
4129 |
+
echo '</select>';
|
4130 |
+
|
4131 |
+
|
4132 |
+
|
4133 |
+
}
|
4134 |
+
|
4135 |
+
// function to return our form template path
|
4136 |
+
function getTemplateFilePath($directory) {
|
4137 |
+
|
4138 |
+
$get_files = scandir($directory);
|
4139 |
+
$sub_files = array();
|
4140 |
+
|
4141 |
+
foreach( $get_files as $file ) {
|
4142 |
+
|
4143 |
+
if($file != '.' && $file != '..') {
|
4144 |
+
$explode_file = explode( '.' , $file );
|
4145 |
+
$file_extension = $explode_file[1];
|
4146 |
+
if ( $file_extension == 'php' ) {
|
4147 |
+
$file_extension_path = $directory . '/' . $file;
|
4148 |
+
}
|
4149 |
+
|
4150 |
+
}
|
4151 |
+
}
|
4152 |
+
|
4153 |
+
return $file_extension_path;
|
4154 |
+
|
4155 |
+
}
|
4156 |
|
4157 |
/**
|
4158 |
* This update needs to pull in all of the custom form
|
4276 |
'LNAME' => $commenter_last_name
|
4277 |
),
|
4278 |
'double_optin' => $optin, // double optin value (retreived from the settings page)
|
4279 |
+
'send_welcome' => true
|
4280 |
));
|
4281 |
return "done";
|
4282 |
} catch( Exception $e ) { // catch any errors returned from MailChimp
|
4926 |
|
4927 |
/** Change Default HeartBeat API Pulse Time */
|
4928 |
function yks_mc_tweak_heartbeat_settings( $settings ) {
|
4929 |
+
$settings['interval'] = 45; //Anything between 15-60
|
4930 |
return $settings;
|
4931 |
}
|
4932 |
|
css/style.ykseme.css
CHANGED
@@ -84,7 +84,6 @@
|
|
84 |
text-align:center;
|
85 |
float:left;
|
86 |
margin-right:.25em;
|
87 |
-
margin-top:.55em;
|
88 |
}
|
89 |
|
90 |
.yks-mc-success-icon {
|
@@ -110,7 +109,8 @@
|
|
110 |
|
111 |
#yks_mc_reset_plugin_settings p {
|
112 |
float:left;
|
113 |
-
width:
|
|
|
114 |
}
|
115 |
|
116 |
/* Widget Icon !! */
|
@@ -262,10 +262,25 @@
|
|
262 |
}
|
263 |
|
264 |
.widget_yikes_mc_widget input, .widget_yikes_mc_widget .yks-mailchimpFormDivRowField {
|
265 |
-
width:100%;
|
|
|
|
|
|
|
|
|
|
|
266 |
}
|
267 |
.yks-mailchimpFormDivRowField input {
|
268 |
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
}
|
270 |
|
271 |
.widget_yikes_mc_widget .yks-require-description {
|
@@ -448,6 +463,10 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
448 |
|
449 |
/* Configure Lists page*/
|
450 |
|
|
|
|
|
|
|
|
|
451 |
.yks-notice-toggle {
|
452 |
background: #c9cced !important;
|
453 |
border-color: #9ea0ba !important;
|
@@ -469,7 +488,7 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
469 |
.yks-mailchimp-fields-placeholder {
|
470 |
background: #DEDEDE;
|
471 |
display: block;
|
472 |
-
height:
|
473 |
}
|
474 |
|
475 |
.yks-mailchimp-sorthandle {
|
@@ -496,7 +515,7 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
496 |
|
497 |
.yks-mailchimp-field-name {
|
498 |
display: inline-block;
|
499 |
-
width:
|
500 |
}
|
501 |
|
502 |
.yks-mailchimp-field-merge {
|
@@ -506,14 +525,6 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
506 |
width: 100px;
|
507 |
}
|
508 |
|
509 |
-
#yks-list-wrapper .yks-list-container {
|
510 |
-
border-bottom: 3px dashed #DEDEDE;
|
511 |
-
}
|
512 |
-
|
513 |
-
#yks-list-wrapper .yks-list-container:last-child {
|
514 |
-
border-bottom: 0px dashed #DEDEDE !important;
|
515 |
-
}
|
516 |
-
|
517 |
.yks-mailchimp-fields-list {
|
518 |
background-color: #F9F9F9;
|
519 |
border: 1px solid #EEE;
|
@@ -524,8 +535,7 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
524 |
.yks-mailchimp-fields-list .yks-mailchimp-fields-list-row:nth-child(odd) {
|
525 |
}
|
526 |
.yks-mailchimp-fields-list .yks-mailchimp-fields-list-row {
|
527 |
-
|
528 |
-
height: 30px;
|
529 |
padding-top: 3px;
|
530 |
}
|
531 |
.yks-mailchimp-fields-list .yks-mailchimp-fields-list-row label {
|
@@ -535,6 +545,7 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
535 |
.yks-mailchimp-listname {
|
536 |
font-size: 1.4em !important;
|
537 |
font-weight: 600;
|
|
|
538 |
}
|
539 |
|
540 |
.yks-mailchimp-redirect-checkbox-holder {
|
@@ -568,7 +579,9 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
568 |
}
|
569 |
|
570 |
.displayListSubscribers {
|
571 |
-
font-size:
|
|
|
|
|
572 |
}
|
573 |
|
574 |
.yks-view-subscriber-profile {
|
@@ -728,7 +741,7 @@ body.mailchimp-forms_page_yks-mailchimp-about-yikes #ykseme-page-header {
|
|
728 |
}
|
729 |
|
730 |
/****** Interest Group Stypes ******/
|
731 |
-
.yks_mc_interest_group_text
|
732 |
display:block;
|
733 |
margin-top:1em;
|
734 |
}
|
@@ -770,13 +783,14 @@ td.yks_mc_table_dropdown_interest_group_holder, td.yks-mailchimpFormTableSubmit
|
|
770 |
.widget .yks_mc_table_td:last-child {
|
771 |
border-top:0;
|
772 |
border-bottom:0;
|
|
|
773 |
}
|
774 |
|
775 |
.yikes_mc_interest_group_radio {
|
776 |
margin-right: .5em;
|
777 |
}
|
778 |
|
779 |
-
|
780 |
display:inline-block;
|
781 |
width:100%;
|
782 |
}
|
@@ -910,8 +924,8 @@ label[for="single-optin-message"], label[for="double-optin-message"] {
|
|
910 |
|
911 |
|
912 |
/** Date Picker Styles **/
|
913 |
-
.yks-mailchimpFormDatepickerContainer .ui-datepicker-prev, .yks-mailchimpFormDatepickerContainer .ui-datepicker-next {
|
914 |
-
|
915 |
}
|
916 |
|
917 |
/* Form Error Classes */
|
@@ -1505,6 +1519,167 @@ textarea#debug_loaded_apache_modules {
|
|
1505 |
}
|
1506 |
|
1507 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1508 |
/***** New Chimp Chatter Item + Star *****/
|
1509 |
.new-chatter-item td:first-child:before {
|
1510 |
content: "\f155";
|
@@ -1552,4 +1727,9 @@ textarea#debug_loaded_apache_modules {
|
|
1552 |
|
1553 |
|
1554 |
|
|
|
|
|
|
|
|
|
|
|
1555 |
}
|
84 |
text-align:center;
|
85 |
float:left;
|
86 |
margin-right:.25em;
|
|
|
87 |
}
|
88 |
|
89 |
.yks-mc-success-icon {
|
109 |
|
110 |
#yks_mc_reset_plugin_settings p {
|
111 |
float:left;
|
112 |
+
width:75%;
|
113 |
+
margin-top: 1em;
|
114 |
}
|
115 |
|
116 |
/* Widget Icon !! */
|
262 |
}
|
263 |
|
264 |
.widget_yikes_mc_widget input, .widget_yikes_mc_widget .yks-mailchimpFormDivRowField {
|
265 |
+
width: 100%;
|
266 |
+
display:block;
|
267 |
+
padding: 10px;
|
268 |
+
-moz-box-sizing: border-box;
|
269 |
+
-webkit-box-sizing: border-box;
|
270 |
+
box-sizing: border-box;
|
271 |
}
|
272 |
.yks-mailchimpFormDivRowField input {
|
273 |
width: 100%;
|
274 |
+
display:block;
|
275 |
+
padding: 10px;
|
276 |
+
-moz-box-sizing: border-box;
|
277 |
+
-webkit-box-sizing: border-box;
|
278 |
+
box-sizing: border-box;
|
279 |
+
}
|
280 |
+
/* Make radio buttons and checkboxes not 100% as it throws off layouts */
|
281 |
+
.yks-mailchimpFormDivRowField input[type="radio"], .yks-mailchimpFormDivRowField input[type="checbox"] {
|
282 |
+
width: auto;
|
283 |
+
float:left;
|
284 |
}
|
285 |
|
286 |
.widget_yikes_mc_widget .yks-require-description {
|
463 |
|
464 |
/* Configure Lists page*/
|
465 |
|
466 |
+
.merge_field_input {
|
467 |
+
max-width:85px;
|
468 |
+
}
|
469 |
+
|
470 |
.yks-notice-toggle {
|
471 |
background: #c9cced !important;
|
472 |
border-color: #9ea0ba !important;
|
488 |
.yks-mailchimp-fields-placeholder {
|
489 |
background: #DEDEDE;
|
490 |
display: block;
|
491 |
+
height: 40px;
|
492 |
}
|
493 |
|
494 |
.yks-mailchimp-sorthandle {
|
515 |
|
516 |
.yks-mailchimp-field-name {
|
517 |
display: inline-block;
|
518 |
+
width: 175px;
|
519 |
}
|
520 |
|
521 |
.yks-mailchimp-field-merge {
|
525 |
width: 100px;
|
526 |
}
|
527 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
.yks-mailchimp-fields-list {
|
529 |
background-color: #F9F9F9;
|
530 |
border: 1px solid #EEE;
|
535 |
.yks-mailchimp-fields-list .yks-mailchimp-fields-list-row:nth-child(odd) {
|
536 |
}
|
537 |
.yks-mailchimp-fields-list .yks-mailchimp-fields-list-row {
|
538 |
+
height: 40px;
|
|
|
539 |
padding-top: 3px;
|
540 |
}
|
541 |
.yks-mailchimp-fields-list .yks-mailchimp-fields-list-row label {
|
545 |
.yks-mailchimp-listname {
|
546 |
font-size: 1.4em !important;
|
547 |
font-weight: 600;
|
548 |
+
padding-left: 0 !important;
|
549 |
}
|
550 |
|
551 |
.yks-mailchimp-redirect-checkbox-holder {
|
579 |
}
|
580 |
|
581 |
.displayListSubscribers {
|
582 |
+
font-size: 9px !important;
|
583 |
+
margin-top: -5px !important;
|
584 |
+
margin-left: 5px !important;
|
585 |
}
|
586 |
|
587 |
.yks-view-subscriber-profile {
|
741 |
}
|
742 |
|
743 |
/****** Interest Group Stypes ******/
|
744 |
+
.yks_mc_interest_group_text {
|
745 |
display:block;
|
746 |
margin-top:1em;
|
747 |
}
|
783 |
.widget .yks_mc_table_td:last-child {
|
784 |
border-top:0;
|
785 |
border-bottom:0;
|
786 |
+
display:block;
|
787 |
}
|
788 |
|
789 |
.yikes_mc_interest_group_radio {
|
790 |
margin-right: .5em;
|
791 |
}
|
792 |
|
793 |
+
#content .yks_mc_interest_radio_button_holder, #content .yks_mc_table_td {
|
794 |
display:inline-block;
|
795 |
width:100%;
|
796 |
}
|
924 |
|
925 |
|
926 |
/** Date Picker Styles **/
|
927 |
+
.yks-mailchimpFormDatepickerContainer .ui-datepicker-prev:hover, .yks-mailchimpFormDatepickerContainer .ui-datepicker-next:hover {
|
928 |
+
cursor: pointer;
|
929 |
}
|
930 |
|
931 |
/* Form Error Classes */
|
1519 |
}
|
1520 |
|
1521 |
|
1522 |
+
/** New List Page Styles **/
|
1523 |
+
#yks-list-select {
|
1524 |
+
vertical-align: top !important;
|
1525 |
+
margin-right: 1em;
|
1526 |
+
}
|
1527 |
+
|
1528 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists {
|
1529 |
+
background: transparent;
|
1530 |
+
}
|
1531 |
+
|
1532 |
+
.yks-mc-list-title-toggle {
|
1533 |
+
display:block;
|
1534 |
+
width: 100%;
|
1535 |
+
font-size: 19px;
|
1536 |
+
}
|
1537 |
+
|
1538 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .panel {
|
1539 |
+
margin-bottom: 0;
|
1540 |
+
padding: .35em;
|
1541 |
+
}
|
1542 |
+
|
1543 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .panel-body {
|
1544 |
+
padding: 0;
|
1545 |
+
margin-top: -.75em;
|
1546 |
+
position: relative;
|
1547 |
+
background: #fefefe;
|
1548 |
+
}
|
1549 |
+
|
1550 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .yks-admin-form {
|
1551 |
+
margin-bottom:0;
|
1552 |
+
}
|
1553 |
+
|
1554 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .panel-heading {
|
1555 |
+
margin: .25em 0;
|
1556 |
+
padding: .5em 1em;
|
1557 |
+
}
|
1558 |
+
|
1559 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .panel-default {
|
1560 |
+
color: #333;
|
1561 |
+
background-color: #f5f5f5;
|
1562 |
+
border-color: #ddd;
|
1563 |
+
position: relative;
|
1564 |
+
z-index: 9998;
|
1565 |
+
display: inline-block;
|
1566 |
+
}
|
1567 |
+
|
1568 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .yks-list-container {
|
1569 |
+
padding-left: .5em;
|
1570 |
+
border:1px solid #ddd;
|
1571 |
+
border-radius: 3px;
|
1572 |
+
background: #fefefe;
|
1573 |
+
}
|
1574 |
+
|
1575 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists form[name="yks-mailchimp-form"] {
|
1576 |
+
padding: 0 1.5em;
|
1577 |
+
}
|
1578 |
+
|
1579 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .panel-heading .yks_mc_list_title {
|
1580 |
+
float: left;
|
1581 |
+
}
|
1582 |
+
|
1583 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .panel-heading .yks_mc_subscriber_count {
|
1584 |
+
float: right;
|
1585 |
+
}
|
1586 |
+
|
1587 |
+
body.mailchimp-forms_page_yks-mailchimp-form-lists .yks-list-container h4 {
|
1588 |
+
line-height: 1.5;
|
1589 |
+
}
|
1590 |
+
|
1591 |
+
|
1592 |
+
/*** Template Preview Box **/
|
1593 |
+
.selected_template_preview_header {
|
1594 |
+
display: inline-block;
|
1595 |
+
width: 100%;
|
1596 |
+
}
|
1597 |
+
|
1598 |
+
.preview_template_screenshot {
|
1599 |
+
display:block;
|
1600 |
+
margin:0 auto;
|
1601 |
+
}
|
1602 |
+
|
1603 |
+
.selected_template_preview_header .template_name {
|
1604 |
+
float: left;
|
1605 |
+
text-decoration: underline;
|
1606 |
+
}
|
1607 |
+
|
1608 |
+
.selected_template_preview_header .template_author {
|
1609 |
+
float: right;
|
1610 |
+
margin-top: 20px;
|
1611 |
+
}
|
1612 |
+
|
1613 |
+
.selected_template_preview_header .template_preview {
|
1614 |
+
display: block;
|
1615 |
+
margin: 0 auto;
|
1616 |
+
}
|
1617 |
+
|
1618 |
+
/** User Template How To **/
|
1619 |
+
.user_template_how_to_title {
|
1620 |
+
margin-top: 1em;
|
1621 |
+
padding-left: 30%;
|
1622 |
+
text-decoration: underline;
|
1623 |
+
}
|
1624 |
+
.whats-this-help {
|
1625 |
+
font-size: 12px;
|
1626 |
+
line-height:1.5;
|
1627 |
+
margin-left: .5em;
|
1628 |
+
}
|
1629 |
+
|
1630 |
+
.yks-mc-file-path {
|
1631 |
+
color: red;
|
1632 |
+
}
|
1633 |
+
|
1634 |
+
/** Color Picker **/
|
1635 |
+
.wp-picker-holder {
|
1636 |
+
position:absolute;
|
1637 |
+
z-index: 99999999;
|
1638 |
+
}
|
1639 |
+
|
1640 |
+
.custom_style_table {
|
1641 |
+
width: 50%;
|
1642 |
+
}
|
1643 |
+
|
1644 |
+
.custom_style_table .yks-mailchimp-fields-list-row td {
|
1645 |
+
width: 50%;
|
1646 |
+
text-align:center;
|
1647 |
+
}
|
1648 |
+
.custom_style_table .yks-mailchimp-fields-list-row td:first-child {
|
1649 |
+
text-align: left;
|
1650 |
+
}
|
1651 |
+
|
1652 |
+
.custom_style_table .yks-mailchimp-fields-list .yks-mailchimp-fields-list-row {
|
1653 |
+
display: inline-block;
|
1654 |
+
}
|
1655 |
+
|
1656 |
+
td.custom-styles-input-td {
|
1657 |
+
height: 58px !important;
|
1658 |
+
}
|
1659 |
+
|
1660 |
+
.custom-styles-input-td {
|
1661 |
+
text-align:right;
|
1662 |
+
}
|
1663 |
+
|
1664 |
+
.style_table_left {
|
1665 |
+
float:left;
|
1666 |
+
}
|
1667 |
+
.style_table_right {
|
1668 |
+
float:left;
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
|
1672 |
+
.populatePreviewFormContainer {
|
1673 |
+
display: block;
|
1674 |
+
margin-top: 2em;
|
1675 |
+
}
|
1676 |
+
|
1677 |
+
|
1678 |
+
input[name="yks-mc-form-padding"], input[name="yks-mc-form-width"], select[name="yks-mc-form-alignment"] {
|
1679 |
+
width: 111px;
|
1680 |
+
text-align:center;
|
1681 |
+
}
|
1682 |
+
|
1683 |
/***** New Chimp Chatter Item + Star *****/
|
1684 |
.new-chatter-item td:first-child:before {
|
1685 |
content: "\f155";
|
1727 |
|
1728 |
|
1729 |
|
1730 |
+
}
|
1731 |
+
|
1732 |
+
|
1733 |
+
.yks_mc_interest_group_label:hover {
|
1734 |
+
cursor: pointer;
|
1735 |
}
|
images/Thumbs.db
DELETED
Binary file
|
images/pagination/Thumbs.db
DELETED
Binary file
|
images/smoothness/Thumbs.db
DELETED
Binary file
|
images/welcome_page/Custom_Templates.jpg
ADDED
Binary file
|
images/welcome_page/Form_Customizer.jpg
ADDED
Binary file
|
images/welcome_page/Manage_List_Styles.jpg
ADDED
Binary file
|
images/welcome_page/browse_subscribers.jpg
ADDED
Binary file
|
images/welcome_page/custom_class_names.jpg
ADDED
Binary file
|
images/welcome_page/slide_images/header_optin_template_city_skyline.jpg
ADDED
Binary file
|
images/welcome_page/slide_images/header_optin_template_sub-head-bar.jpg
ADDED
Binary file
|
images/welcome_page/slide_images/header_optin_template_vacation.jpg
ADDED
Binary file
|
images/welcome_page/track_stats.jpg
ADDED
Binary file
|
js/jquery.1.7.1.min.js
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
2 |
-
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
|
3 |
-
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
|
4 |
-
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
|
|
|
|
|
|
|
|
lib/lib.ajax.php
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
add_action('wp_ajax_yks_mailchimp_form', 'ykseme_ajaxActions');
|
3 |
|
4 |
-
|
|
|
|
|
5 |
|
6 |
function ykseme_ajaxActions()
|
7 |
{
|
1 |
<?php
|
2 |
+
|
3 |
+
/* Setup our Private Actions */
|
4 |
add_action('wp_ajax_yks_mailchimp_form', 'ykseme_ajaxActions');
|
5 |
|
6 |
+
/* Setup our Public actions */
|
7 |
+
add_action('wp_ajax_yks_mailchimp_form_submit', 'ykseme_publicAjaxActions');
|
8 |
+
add_action('wp_ajax_nopriv_yks_mailchimp_form_submit', 'ykseme_publicAjaxActions');
|
9 |
|
10 |
function ykseme_ajaxActions()
|
11 |
{
|
pages/lists.php
CHANGED
@@ -14,13 +14,16 @@
|
|
14 |
<script type="text/javascript">
|
15 |
jQuery(document).ready(function($)
|
16 |
{
|
|
|
|
|
|
|
17 |
function noListsCheck()
|
18 |
{
|
19 |
if($('#yks-list-wrapper .yks-list-container').size() <= 0)
|
20 |
{
|
21 |
var plugin_directory_url = '<?php echo plugin_dir_url( __FILE__ ); ?>';
|
22 |
$('#yks-lists-dropdown').next().css('opacity',0);
|
23 |
-
$('#yks-list-wrapper').css({ 'background' : 'url("'+plugin_directory_url+'../images/yks_mc_lets_get_started.png")', 'height' : '175px' , 'width' : '400px' , 'background-repeat' : 'no-repeat' , 'background-position' : 'center', 'margin-top' : '-
|
24 |
}
|
25 |
}
|
26 |
function EnterListID (lid, name)
|
@@ -45,11 +48,17 @@
|
|
45 |
{
|
46 |
$('#yks-list-wrapper').html('');
|
47 |
}
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
else
|
55 |
{
|
@@ -61,6 +70,7 @@
|
|
61 |
}
|
62 |
},
|
63 |
modal: true,
|
|
|
64 |
resizable: false
|
65 |
});
|
66 |
}
|
@@ -166,16 +176,19 @@
|
|
166 |
}
|
167 |
},
|
168 |
modal: true,
|
|
|
169 |
resizable: false
|
170 |
});
|
171 |
}
|
172 |
return false;
|
173 |
});
|
174 |
-
// function which
|
175 |
$('.yks-mailchimp-list-update').live('click', function(e){
|
176 |
var i = $(this).attr('rel');
|
177 |
var f = '#yks-mailchimp-form_'+i;
|
178 |
var theButton = $(this);
|
|
|
|
|
179 |
$.ajax({
|
180 |
type: 'POST',
|
181 |
url: ajaxurl,
|
@@ -207,7 +220,12 @@
|
|
207 |
}
|
208 |
console.log(MAILCHIMP);
|
209 |
}
|
210 |
-
}
|
|
|
|
|
|
|
|
|
|
|
211 |
});
|
212 |
return false;
|
213 |
});
|
@@ -235,7 +253,8 @@
|
|
235 |
{
|
236 |
if(MAILCHIMP == '1')
|
237 |
{
|
238 |
-
$('#yks-list-container_'+i).fadeOut('fast'
|
|
|
239 |
$(this).remove();
|
240 |
scrollToElement($('#yks-list-wrapper'));
|
241 |
noListsCheck();
|
@@ -249,6 +268,7 @@
|
|
249 |
}
|
250 |
},
|
251 |
modal: true,
|
|
|
252 |
resizable: false
|
253 |
});
|
254 |
|
@@ -257,20 +277,31 @@
|
|
257 |
// function which imports a specified list from MailChimp
|
258 |
$('.yks-mailchimp-import').live('click', function(e){
|
259 |
var i = $(this).attr('rel');
|
260 |
-
var form_name = $(this).parents('
|
261 |
-
|
262 |
|
263 |
-
$("<div id='yks_mc_reset_plugin_settings'><div class='yks-mc-icon-yks-mc-warning yks-mc-delete-form-warning-icon'></div><p><?php _e("Are you sure you want to re-import this
|
264 |
-
title : "Re-Import Form?",
|
265 |
buttons : {
|
266 |
"Yes" : function() {
|
267 |
$(this).dialog("close");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
$.ajax({
|
269 |
type: 'POST',
|
270 |
url: ajaxurl,
|
271 |
data: {
|
272 |
action: 'yks_mailchimp_form',
|
273 |
-
form_action: '
|
274 |
id: i
|
275 |
},
|
276 |
dataType: 'json',
|
@@ -278,42 +309,55 @@
|
|
278 |
{
|
279 |
if(MAILCHIMP != '-1')
|
280 |
{
|
281 |
-
|
282 |
-
$('#yks-
|
283 |
-
|
284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
title : "Form Successfully Updated",
|
286 |
buttons : {
|
287 |
"Ok" : function() {
|
288 |
$(this).dialog("close");
|
|
|
289 |
}
|
290 |
},
|
291 |
modal: true,
|
|
|
292 |
resizable: false
|
293 |
-
});
|
294 |
-
initializeScrollableLists();
|
295 |
}
|
296 |
else
|
297 |
{
|
|
|
298 |
$("<div id='yks_mc_reset_plugin_settings'><div class='dashicons dashicons-yes yks-mc-success-icon'></div><p><?php _e("It looks like this form is already up to date!", "yikes-inc-easy-mailchimp-extender" ); ?></p></div>").dialog({
|
299 |
title : "Form Up To Date",
|
300 |
buttons : {
|
301 |
"Ok" : function() {
|
302 |
$(this).dialog("close");
|
|
|
303 |
}
|
304 |
},
|
305 |
modal: true,
|
|
|
306 |
resizable: false
|
307 |
});
|
|
|
308 |
}
|
309 |
}
|
310 |
-
|
311 |
},
|
312 |
"Cancel" : function() {
|
313 |
$(this).dialog("close");
|
|
|
314 |
}
|
315 |
},
|
316 |
modal: true,
|
|
|
317 |
resizable: false
|
318 |
});
|
319 |
|
@@ -354,7 +398,7 @@
|
|
354 |
// passes the list_id and list_name to the PHP function that makes the API call
|
355 |
jQuery('#yks-list-wrapper').delegate('.displayListSubscribers', 'click', function() {
|
356 |
var specifiedListID = jQuery(this).attr('rel');
|
357 |
-
var thisListName = jQuery(this).parents('
|
358 |
|
359 |
// run our ajax function and pass along our clicked link ID
|
360 |
$.ajax({
|
@@ -485,6 +529,28 @@
|
|
485 |
}
|
486 |
});
|
487 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
jQuery('.yks_mc_subscribers').delegate('.yks-view-subscriber-profile', 'click', function() {
|
489 |
// create our variables that will be passed over to MailChimp
|
490 |
var user_email = jQuery(this).attr('rel');
|
@@ -540,6 +606,169 @@
|
|
540 |
// we don't want it included in the list selection drop down
|
541 |
jQuery('#yks-list-select').find('option[value="subscriber-count"]').remove();
|
542 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
});
|
544 |
</script>
|
545 |
|
@@ -585,4 +814,13 @@
|
|
585 |
<?php echo $this->generateListContainers(); ?>
|
586 |
</div>
|
587 |
<?php } //end else statement if there is an api key ?>
|
588 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
<script type="text/javascript">
|
15 |
jQuery(document).ready(function($)
|
16 |
{
|
17 |
+
|
18 |
+
$('.yks-mc-color-picker').wpColorPicker();
|
19 |
+
|
20 |
function noListsCheck()
|
21 |
{
|
22 |
if($('#yks-list-wrapper .yks-list-container').size() <= 0)
|
23 |
{
|
24 |
var plugin_directory_url = '<?php echo plugin_dir_url( __FILE__ ); ?>';
|
25 |
$('#yks-lists-dropdown').next().css('opacity',0);
|
26 |
+
$('#yks-list-wrapper').css({ 'background' : 'url("'+plugin_directory_url+'../images/yks_mc_lets_get_started.png")', 'height' : '175px' , 'width' : '400px' , 'background-repeat' : 'no-repeat' , 'background-position' : 'center', 'margin-top' : '-2em' });
|
27 |
}
|
28 |
}
|
29 |
function EnterListID (lid, name)
|
48 |
{
|
49 |
$('#yks-list-wrapper').html('');
|
50 |
}
|
51 |
+
$('#yks-list-wrapper').append(MAILCHIMP);
|
52 |
+
var container_length = $('#yks-list-wrapper').find('.panel-collapse').length;
|
53 |
+
$('#yks-list-wrapper').find('.panel-collapse').last().removeAttr('id').attr('id','coallpse_'+container_length);
|
54 |
+
$('#yks-list-wrapper').find('.panel-heading').last().removeAttr('href').attr('href','#coallpse_'+container_length);
|
55 |
+
$('#yks-lists-dropdown').next().css('opacity',1);
|
56 |
+
$('#yks-list-wrapper').css({ 'background' : 'transparent', 'height' : 'auto' , 'width' : 'auto', 'margin-top' : '0' });
|
57 |
+
scrollToElement($('#yks-list-wrapper .panel-heading').last());
|
58 |
+
$('#yks-list-wrapper').find('.panel-heading').last().removeClass( 'collapsed' );
|
59 |
+
$('#yks-list-wrapper').find('.panel-collapse').last().removeClass( 'collapse' ).addClass('collapse in');
|
60 |
+
initializeScrollableLists();
|
61 |
+
$('.yks-mc-color-picker').wpColorPicker();
|
62 |
}
|
63 |
else
|
64 |
{
|
70 |
}
|
71 |
},
|
72 |
modal: true,
|
73 |
+
draggable: false,
|
74 |
resizable: false
|
75 |
});
|
76 |
}
|
176 |
}
|
177 |
},
|
178 |
modal: true,
|
179 |
+
draggable: false,
|
180 |
resizable: false
|
181 |
});
|
182 |
}
|
183 |
return false;
|
184 |
});
|
185 |
+
// function which saves all of our settings
|
186 |
$('.yks-mailchimp-list-update').live('click', function(e){
|
187 |
var i = $(this).attr('rel');
|
188 |
var f = '#yks-mailchimp-form_'+i;
|
189 |
var theButton = $(this);
|
190 |
+
|
191 |
+
// alert($(f).serialize());
|
192 |
$.ajax({
|
193 |
type: 'POST',
|
194 |
url: ajaxurl,
|
220 |
}
|
221 |
console.log(MAILCHIMP);
|
222 |
}
|
223 |
+
},
|
224 |
+
error: function(MAILCHIMP)
|
225 |
+
{
|
226 |
+
alert(MAILCHIMP);
|
227 |
+
console.log(MAILCHIMP);
|
228 |
+
}
|
229 |
});
|
230 |
return false;
|
231 |
});
|
253 |
{
|
254 |
if(MAILCHIMP == '1')
|
255 |
{
|
256 |
+
$('#yks-list-container_'+i).parents('.panel-body').prev().fadeOut('fast');
|
257 |
+
$('#yks-list-container_'+i).parents('.panel-body').fadeOut('fast',function() {
|
258 |
$(this).remove();
|
259 |
scrollToElement($('#yks-list-wrapper'));
|
260 |
noListsCheck();
|
268 |
}
|
269 |
},
|
270 |
modal: true,
|
271 |
+
draggable: false,
|
272 |
resizable: false
|
273 |
});
|
274 |
|
277 |
// function which imports a specified list from MailChimp
|
278 |
$('.yks-mailchimp-import').live('click', function(e){
|
279 |
var i = $(this).attr('rel');
|
280 |
+
var form_name = $(this).parents('.panel-body').prev().find('.yks_mc_list_title').text().trim();
|
281 |
+
var clicked_import_button = $(this);
|
282 |
|
283 |
+
$("<div id='yks_mc_reset_plugin_settings'><div class='yks-mc-icon-yks-mc-warning yks-mc-delete-form-warning-icon'></div><p><?php _e("Are you sure you want to re-import this forms fields from MailChimp?",'yikes-inc-easy-mailchimp-extender'); ?></p></div>").dialog({
|
284 |
+
title : "Re-Import Form Fields?",
|
285 |
buttons : {
|
286 |
"Yes" : function() {
|
287 |
$(this).dialog("close");
|
288 |
+
|
289 |
+
// display a temporary 'loading' modal for user feedback
|
290 |
+
$('<div id="yks_mc_reimporting_fields_dialog"><img class="yks-mc-reset-plugin-settings-preloader" src="<?php echo plugin_dir_url(__FILE__).'../images/preloader.gif'; ?>" alt="preloader" /><p style="width:100%;text-align:center;"><?php _e( "Re-Importing Form Fields" , "yikes-inc-easy-mailchimp-extender" ); ?></p></div>').dialog({
|
291 |
+
title : "Please Hold",
|
292 |
+
modal: true,
|
293 |
+
draggable: false,
|
294 |
+
resizable: false
|
295 |
+
});
|
296 |
+
|
297 |
+
var this_success_message = clicked_import_button.parents('.panel-body').find('#yks-status');
|
298 |
+
clicked_import_button.parents('.panel-body').find('#yks-status').remove();
|
299 |
$.ajax({
|
300 |
type: 'POST',
|
301 |
url: ajaxurl,
|
302 |
data: {
|
303 |
action: 'yks_mailchimp_form',
|
304 |
+
form_action: 'merge_variables_reImport',
|
305 |
id: i
|
306 |
},
|
307 |
dataType: 'json',
|
309 |
{
|
310 |
if(MAILCHIMP != '-1')
|
311 |
{
|
312 |
+
$('#yks_mc_reimporting_fields_dialog').dialog("destroy");
|
313 |
+
$($('#yks-mailchimp-fields-td_'+i)).replaceWith(MAILCHIMP);
|
314 |
+
$('#yks-mailchimp-fields-td_'+i).yksYellowFade();
|
315 |
+
clicked_import_button.parents('.form-table').find('.yks-mailchimp-list-update').click();
|
316 |
+
setTimeout(function() {
|
317 |
+
clicked_import_button.parents('.panel-body').find('#yks-status-error').before(this_success_message);
|
318 |
+
}, 5000);
|
319 |
+
// alert the user that it was a success
|
320 |
+
$('<div id="yks_mc_reset_plugin_settings"><div class="dashicons dashicons-yes yks-mc-success-icon"></div><p><?php _e( "Your MailChimp form" , "yikes-inc-easy-mailchimp-extender" ); ?><strong> "'+form_name+'" </strong><?php _e(" was successfully updated", "yikes-inc-easy-mailchimp-extender" ); ?></p></div>').dialog({
|
321 |
+
|
322 |
title : "Form Successfully Updated",
|
323 |
buttons : {
|
324 |
"Ok" : function() {
|
325 |
$(this).dialog("close");
|
326 |
+
return false;
|
327 |
}
|
328 |
},
|
329 |
modal: true,
|
330 |
+
draggable: false,
|
331 |
resizable: false
|
332 |
+
});
|
|
|
333 |
}
|
334 |
else
|
335 |
{
|
336 |
+
$('#yks_mc_reimporting_fields_dialog').dialog("destroy");
|
337 |
$("<div id='yks_mc_reset_plugin_settings'><div class='dashicons dashicons-yes yks-mc-success-icon'></div><p><?php _e("It looks like this form is already up to date!", "yikes-inc-easy-mailchimp-extender" ); ?></p></div>").dialog({
|
338 |
title : "Form Up To Date",
|
339 |
buttons : {
|
340 |
"Ok" : function() {
|
341 |
$(this).dialog("close");
|
342 |
+
return false;
|
343 |
}
|
344 |
},
|
345 |
modal: true,
|
346 |
+
draggable: false,
|
347 |
resizable: false
|
348 |
});
|
349 |
+
return false;
|
350 |
}
|
351 |
}
|
352 |
+
});
|
353 |
},
|
354 |
"Cancel" : function() {
|
355 |
$(this).dialog("close");
|
356 |
+
return false;
|
357 |
}
|
358 |
},
|
359 |
modal: true,
|
360 |
+
draggable: false,
|
361 |
resizable: false
|
362 |
});
|
363 |
|
398 |
// passes the list_id and list_name to the PHP function that makes the API call
|
399 |
jQuery('#yks-list-wrapper').delegate('.displayListSubscribers', 'click', function() {
|
400 |
var specifiedListID = jQuery(this).attr('rel');
|
401 |
+
var thisListName = jQuery(this).parents('.panel-body').prev().find('.yks_mc_list_title').text();
|
402 |
|
403 |
// run our ajax function and pass along our clicked link ID
|
404 |
$.ajax({
|
529 |
}
|
530 |
});
|
531 |
|
532 |
+
// if the custom styles box is checked, slide down and reveal the custom styles options, else hide it
|
533 |
+
jQuery('#yks-list-wrapper').delegate('.yks_mailchimp_custom_styles', 'click', function() {
|
534 |
+
if (jQuery(this).attr("checked")) {
|
535 |
+
jQuery(this).parents('.form-table').find('input.yks_mailchimp_custom_template').removeAttr( 'checked' ).attr( 'disabled','disabled' );
|
536 |
+
jQuery(this).parents('.yks-mailchimp-custom-styles-holder').find('#custom-style-list').slideDown();
|
537 |
+
} else {
|
538 |
+
jQuery(this).parents('.yks-mailchimp-custom-styles-holder').find('#custom-style-list').slideUp();
|
539 |
+
jQuery(this).parents('.form-table').find('input.yks_mailchimp_custom_template').removeAttr( 'disabled','disabled' );
|
540 |
+
}
|
541 |
+
});
|
542 |
+
|
543 |
+
// if the custom template box is checked, slide down and reveal the custom template options, else hide it
|
544 |
+
jQuery('#yks-list-wrapper').delegate('.yks_mailchimp_custom_template', 'click', function() {
|
545 |
+
if (jQuery(this).attr("checked")) {
|
546 |
+
jQuery(this).parents('.form-table').find('input.yks_mailchimp_custom_styles').removeAttr( 'checked' ).attr( 'disabled','disabled' );
|
547 |
+
jQuery(this).parents('.yks-mailchimp-custom-template-holder').find('#custom-template-list').slideDown();
|
548 |
+
} else {
|
549 |
+
jQuery(this).parents('.yks-mailchimp-custom-template-holder').find('#custom-template-list').slideUp();
|
550 |
+
jQuery(this).parents('.form-table').find('input.yks_mailchimp_custom_styles').removeAttr( 'disabled','disabled' );
|
551 |
+
}
|
552 |
+
});
|
553 |
+
|
554 |
jQuery('.yks_mc_subscribers').delegate('.yks-view-subscriber-profile', 'click', function() {
|
555 |
// create our variables that will be passed over to MailChimp
|
556 |
var user_email = jQuery(this).attr('rel');
|
606 |
// we don't want it included in the list selection drop down
|
607 |
jQuery('#yks-list-select').find('option[value="subscriber-count"]').remove();
|
608 |
|
609 |
+
|
610 |
+
jQuery('.populatePreviewFormContainer').click(function() {
|
611 |
+
|
612 |
+
if ( jQuery(this).hasClass( 'custom_template' ) ) {
|
613 |
+
|
614 |
+
var selected_form = jQuery(this).parents( '#custom-template-list' ).find( '.template-selection-dropdown' ).val();
|
615 |
+
|
616 |
+
var selected_form = selected_form.substring(selected_form.lastIndexOf("/"));
|
617 |
+
|
618 |
+
var selected_form_screenshot = selected_form.replace( '/' , '' ).replace( '.php' , '.jpg');
|
619 |
+
|
620 |
+
var selected_form_text = jQuery(this).parents( '#custom-template-list' ).find( '.template-selection-dropdown option:selected' ).text();
|
621 |
+
|
622 |
+
var template_path = jQuery(this).parents( '#custom-template-list' ).find( '.template-selection-dropdown' ).val();
|
623 |
+
|
624 |
+
$.ajax({
|
625 |
+
type: "POST",
|
626 |
+
url: ajaxurl,
|
627 |
+
data: {
|
628 |
+
action: "yks_mailchimp_form", // pass data to this ajax function
|
629 |
+
form_action: "yks_mc_get_custom_template_preview", // our data will finall be passed through this function
|
630 |
+
template_name : selected_form_text,
|
631 |
+
selected_form_screenshot: selected_form_screenshot,
|
632 |
+
template_path: template_path
|
633 |
+
},
|
634 |
+
dataType: "html", // again must pass as HTML and not JSON
|
635 |
+
success: function(MAILCHIMP)
|
636 |
+
{
|
637 |
+
jQuery('#TB_window').find('#TB_ajaxContent').html(MAILCHIMP);
|
638 |
+
},
|
639 |
+
error: function(xhr) {
|
640 |
+
console.log('error : '+MAILCHIMP);
|
641 |
+
}
|
642 |
+
});
|
643 |
+
|
644 |
+
} else {
|
645 |
+
|
646 |
+
var form_shortcode = jQuery(this).parents('.form-table').find('.yks-mailchimp-shortcode').find('.shortcode-code').text();
|
647 |
+
var form_title = jQuery(this).parents('.panel-body').prev().find('.yks_mc_list_title').text();
|
648 |
+
// get our temp colors to pass to the modal
|
649 |
+
var form_bg_color = jQuery(this).parents('#custom-style-list').find('input[name="yks-mc-background-color"]').val();
|
650 |
+
var form_text_color = jQuery(this).parents('#custom-style-list').find('input[name="yks-mc-text-color"]').val();
|
651 |
+
var form_submit_button_color = jQuery(this).parents('#custom-style-list').find('input[name="yks-mc-submit-button-color"]').val();
|
652 |
+
var form_submit_button_text_color = jQuery(this).parents('#custom-style-list').find('input[name="yks-mc-submit-button-text-color"]').val();
|
653 |
+
var form_padding = jQuery(this).parents('#custom-style-list').find('input[name="yks-mc-form-padding"]').val();
|
654 |
+
var form_width = jQuery(this).parents('#custom-style-list').find('input[name="yks-mc-form-width"]').val();
|
655 |
+
var form_alignment = jQuery(this).parents('#custom-style-list').find('select[name="yks-mc-form-alignment"]').val();
|
656 |
+
|
657 |
+
$.ajax({
|
658 |
+
type: "POST",
|
659 |
+
url: ajaxurl,
|
660 |
+
data: {
|
661 |
+
action: "yks_mailchimp_form", // pass data to this ajax function
|
662 |
+
form_action: "yks_mc_get_form_preview", // our data will finall be passed through this function
|
663 |
+
shortcode: form_shortcode,
|
664 |
+
form_title: form_title,
|
665 |
+
form_bg_color : form_bg_color,
|
666 |
+
form_text_color : form_text_color,
|
667 |
+
form_submit_button_color : form_submit_button_color,
|
668 |
+
form_submit_button_text_color : form_submit_button_text_color,
|
669 |
+
form_padding : form_padding,
|
670 |
+
form_width : form_width,
|
671 |
+
form_alignment : form_alignment
|
672 |
+
},
|
673 |
+
dataType: "html", // again must pass as HTML and not JSON
|
674 |
+
success: function(MAILCHIMP)
|
675 |
+
{
|
676 |
+
jQuery('#TB_window').find('#TB_ajaxContent').html(MAILCHIMP);
|
677 |
+
},
|
678 |
+
error: function(xhr) {
|
679 |
+
console.log('error : '+MAILCHIMP);
|
680 |
+
}
|
681 |
+
});
|
682 |
+
|
683 |
+
}
|
684 |
+
|
685 |
+
});
|
686 |
+
|
687 |
+
// import the boilerplate files for the user!
|
688 |
+
jQuery('.import_template_boilerplates').click(function() {
|
689 |
+
$("<div id='yks_mc_reset_plugin_settings'><div style='float:left;margin-left:20px;margin-right:40px;margin-top:.25em;font-size:3em;' class='dashicons dashicons-portfolio'></div><p><?php _e("Are you sure you want to import the custom template boilerplate files? This will create a directory in your theme root with the necessary files to create your own custom MailChimp signup templates.","yikes-inc-easy-mailchimp-extender"); ?></p></div>").dialog({
|
690 |
+
title : "Import Boilerplate Template Files?",
|
691 |
+
buttons : {
|
692 |
+
"Yes" : function() {
|
693 |
+
|
694 |
+
$.ajax({
|
695 |
+
type: "POST",
|
696 |
+
url: ajaxurl,
|
697 |
+
data: {
|
698 |
+
action: "yks_mailchimp_form", // pass data to this ajax function
|
699 |
+
form_action: "copy_user_templates_to_theme" // our data will finall be passed through this function
|
700 |
+
},
|
701 |
+
dataType: "json", // again must pass as HTML and not JSON
|
702 |
+
success: function(MAILCHIMP)
|
703 |
+
{
|
704 |
+
$("<div id='yks_mc_reset_plugin_settings'><div style='float:left;margin-left:20px;margin-right:40px;margin-top:.25em;font-size:3em;' class='dashicons dashicons-portfolio'></div><p><?php _e("Custom template boilerplate files succesfully imported. You can find them inside your theme folder, inside the 'yikes-mailchimp-user-template' directory.","yikes-inc-easy-mailchimp-extender"); ?></p><p><img style='display:block;margin:0 auto;' class='yks-mc-reset-plugin-settings-preloader' src='<?php echo plugin_dir_url(__FILE__)."../images/preloader.gif"; ?>'</p></div>").dialog({
|
705 |
+
modal: true,
|
706 |
+
draggable: false,
|
707 |
+
resizable: false,
|
708 |
+
width: 400
|
709 |
+
});
|
710 |
+
setTimeout(function() {
|
711 |
+
location.reload();
|
712 |
+
}, 2400 );
|
713 |
+
},
|
714 |
+
error: function(xhr) {
|
715 |
+
alert('Error Importing Boilerplate Files.');
|
716 |
+
console.log(xhr);
|
717 |
+
}
|
718 |
+
});
|
719 |
+
|
720 |
+
// run our ajax to import the boilerplate files
|
721 |
+
$(this).dialog("close");
|
722 |
+
},
|
723 |
+
"Cancel" : function() {
|
724 |
+
$(this).dialog("close");
|
725 |
+
}
|
726 |
+
},
|
727 |
+
modal: true,
|
728 |
+
draggable: false,
|
729 |
+
resizable: false,
|
730 |
+
width: 400
|
731 |
+
});
|
732 |
+
});
|
733 |
+
|
734 |
+
// clear the modal div when invisible
|
735 |
+
setInterval(function() {
|
736 |
+
if ( jQuery( '.yks_mc_preview_form_container' ).is(':visible') ) {
|
737 |
+
return;
|
738 |
+
} else {
|
739 |
+
jQuery( '.yks_mc_preview_form_container' ).html('<?php echo '<img src="' . admin_url() . '/images/wpspin_light.gif" alt="preloader" style="margin-left: 50%; margin-top: 25%;">'; ?>');
|
740 |
+
jQuery( '.yks_mc_preview_form_container' ).prev().remove();
|
741 |
+
}
|
742 |
+
} , 1200 );
|
743 |
+
|
744 |
+
|
745 |
+
jQuery('.template-selection-dropdown').change(function() {
|
746 |
+
var selected_dropdown = jQuery(this);
|
747 |
+
var label = selected_dropdown.find('option:selected').parent().attr('label');
|
748 |
+
if ( label == 'Custom Templates' ) {
|
749 |
+
selected_dropdown.parents( '#custom-template-list' ).find( '.populatePreviewFormContainer' ).attr( 'disabled' , 'disabled' ).removeClass( 'thickbox' );
|
750 |
+
} else {
|
751 |
+
selected_dropdown.parents( '#custom-template-list' ).find( '.populatePreviewFormContainer' ).removeAttr( 'disabled' ).addClass( 'thickbox' );
|
752 |
+
}
|
753 |
+
});
|
754 |
+
|
755 |
+
jQuery( '.template-selection-dropdown' ).each( function() {
|
756 |
+
var label = jQuery(this).find('option:selected').parent().attr('label');
|
757 |
+
if ( label == 'Custom Templates' ) {
|
758 |
+
jQuery(this).parents( '#custom-template-list' ).find( '.populatePreviewFormContainer' ).attr( 'disabled' , 'disabled' ).removeClass( 'thickbox' );
|
759 |
+
}
|
760 |
+
});
|
761 |
+
|
762 |
+
// clear the selected_template_preview_container modal when invisible
|
763 |
+
setInterval(function() {
|
764 |
+
if ( jQuery( '#selected_template_preview_container' ).is(':visible') ) {
|
765 |
+
return;
|
766 |
+
} else {
|
767 |
+
jQuery( '#selected_template_preview_container' ).html('<?php echo '<img src="' . admin_url() . '/images/wpspin_light.gif" alt="preloader" style="margin-left: 50%; margin-top: 25%;">'; ?>');
|
768 |
+
}
|
769 |
+
} , 1200 );
|
770 |
+
|
771 |
+
|
772 |
});
|
773 |
</script>
|
774 |
|
814 |
<?php echo $this->generateListContainers(); ?>
|
815 |
</div>
|
816 |
<?php } //end else statement if there is an api key ?>
|
817 |
+
</div>
|
818 |
+
|
819 |
+
<?php
|
820 |
+
// need to update javascript for this
|
821 |
+
// generates our thickbox with new fields to add
|
822 |
+
// ajax retreive from MailChimp
|
823 |
+
echo $this->generateNewMergeVariableContainer();
|
824 |
+
echo $this->generateFormPreviewContainer();
|
825 |
+
echo $this->generateUserTemplateHowTo();
|
826 |
+
?>
|
pages/options.php
CHANGED
@@ -134,6 +134,8 @@ jQuery(document).ready(function ($) {
|
|
134 |
// Ajax function which is fired when the user types in a value into the API input field
|
135 |
function yikes_mc_api_key_validate() {
|
136 |
jQuery('.mailChimp_api_key_validation_message').hide();
|
|
|
|
|
137 |
// delay the function incase the user has deleted their API key
|
138 |
setTimeout(function() {
|
139 |
|
@@ -173,20 +175,20 @@ jQuery(document).ready(function ($) {
|
|
173 |
var new_replaced_text = replaced_text.replace("You must provide a MailChimp API key", "<select><option value='refreshThePage'>Save Settings and Refresh The Page</option></select>");
|
174 |
jQuery('#ajax_list_replace').html(new_replaced_text);
|
175 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
176 |
-
jQuery('.mailChimp_api_key_validation_message').html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-checkmark.png'; ?>" alt=message > <?php _e('Valid API Key','yikes-inc-easy-mailchimp-extender'); ?>').css("color", "green").fadeIn();
|
177 |
jQuery('#submit').removeAttr('disabled');
|
178 |
});
|
179 |
// if our response contains 'Invalid MailChimp API Key' - display an error
|
180 |
} else if (response.indexOf('Invalid Mailchimp API Key') > -1) {
|
181 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
182 |
-
jQuery('.mailChimp_api_key_validation_message').html("<img src=<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?> alt=message > <?php _e("Sorry, that is an invalid MailChimp API key.","yikes-inc-easy-mailchimp-extender"); ?>").css("color", "red").fadeIn();
|
183 |
jQuery('#submit').attr('disabled','disabled');
|
184 |
});
|
185 |
console.log('MailChimp API Response : '+response);
|
186 |
} else {
|
187 |
// if our response contains anything else, other than whats above, just let them know its invalid
|
188 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
189 |
-
jQuery('.mailChimp_api_key_validation_message').html("<img src=<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?> alt=message > <?php _e("Sorry, that is an invalid MailChimp API key. Please check the console for further information.","yikes-inc-easy-mailchimp-extender"); ?>").css("color", "red").fadeIn();
|
190 |
});
|
191 |
console.log('MailChimp API Response : '+response);
|
192 |
jQuery('#submit').attr('disabled','disabled');
|
@@ -196,7 +198,7 @@ jQuery(document).ready(function ($) {
|
|
196 |
} else {
|
197 |
// if the length of the API input value is less than 1 (aka 0)
|
198 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
199 |
-
jQuery('.mailChimp_api_key_validation_message').html("<img src=<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?> alt=message > <?php _e("Error: Please enter a valid Mail Chimp API Key.", "yikes-inc-easy-mailchimp-extender"); ?>").css("color", "red").fadeIn();
|
200 |
});
|
201 |
}
|
202 |
}
|
@@ -209,8 +211,10 @@ jQuery(document).ready(function ($) {
|
|
209 |
yikes_mc_api_key_validate();
|
210 |
});
|
211 |
|
212 |
-
|
213 |
-
|
|
|
|
|
214 |
|
215 |
// Reset Plugin Ajax Request
|
216 |
$('#yks-mc-reset-plugin-settings').click(function(e) {
|
@@ -386,11 +390,11 @@ jQuery(document).ready(function() {
|
|
386 |
<div class="update-nag">
|
387 |
<span class="yks-mc-icon-notice"><h3><?php _e( 'LocalHost Detected :', 'yikes-inc-easy-mailchimp-extender' ); ?></h3></span>
|
388 |
<p><?php _e( 'It looks like your using Easy MailChimp Forms by YIKES Inc. on localhost.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
|
389 |
-
<p><?php _e( 'If you are unable to validate your API key, and receive the error message' , 'yikes-inc-easy-mailchimp-extender' ); ?><em
|
390 |
</div>
|
391 |
<?php } ?>
|
392 |
|
393 |
-
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form"
|
394 |
<table class="form-table yks-admin-form">
|
395 |
<tbody>
|
396 |
|
@@ -398,7 +402,7 @@ jQuery(document).ready(function() {
|
|
398 |
<tr valign="top">
|
399 |
<th scope="row"><label for="yks-mailchimp-api-key"><?php _e('Your Mailchimp API Key','yikes-inc-easy-mailchimp-extender'); ?></label></th>
|
400 |
<td>
|
401 |
-
<input name="yks-mailchimp-api-key" type="password" id="yks-mailchimp-api-key" value="<?php echo $this->yikes_mc_encryptIt($this->optionVal['api-key']); ?>" class="regular-text"
|
402 |
</td>
|
403 |
</tr>
|
404 |
<!-- MailChimp API Key Description -->
|
@@ -480,6 +484,20 @@ jQuery(document).ready(function() {
|
|
480 |
<?php _e('Text to display above interest groups. Leave blank to use MailChimp interest group names.','yikes-inc-easy-mailchimp-extender'); ?>
|
481 |
</td>
|
482 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
483 |
<tr valign="top">
|
484 |
<!-- Display OPTIN CHECKBOX SETTING -->
|
485 |
<th scope="row"><label for="yks-mailchimp-optIn-checkbox"><?php _e('Display opt-in checkbox on comment forms?','yikes-inc-easy-mailchimp-extender'); ?></label></th>
|
134 |
// Ajax function which is fired when the user types in a value into the API input field
|
135 |
function yikes_mc_api_key_validate() {
|
136 |
jQuery('.mailChimp_api_key_validation_message').hide();
|
137 |
+
jQuery('#yks-mailchimp-api-key').parents('td').find('.mailChimp_api_key_validation_message').last().hide();
|
138 |
+
jQuery('#submit').attr('disabled','disabled');
|
139 |
// delay the function incase the user has deleted their API key
|
140 |
setTimeout(function() {
|
141 |
|
175 |
var new_replaced_text = replaced_text.replace("You must provide a MailChimp API key", "<select><option value='refreshThePage'>Save Settings and Refresh The Page</option></select>");
|
176 |
jQuery('#ajax_list_replace').html(new_replaced_text);
|
177 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
178 |
+
jQuery('#yks-mailchimp-api-key').parents('td').find('.mailChimp_api_key_validation_message').first().html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-checkmark.png'; ?>" alt=message > <?php _e('Valid API Key','yikes-inc-easy-mailchimp-extender'); ?>').css("color", "green").fadeIn();
|
179 |
jQuery('#submit').removeAttr('disabled');
|
180 |
});
|
181 |
// if our response contains 'Invalid MailChimp API Key' - display an error
|
182 |
} else if (response.indexOf('Invalid Mailchimp API Key') > -1) {
|
183 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
184 |
+
jQuery('#yks-mailchimp-api-key').parents('td').find('.mailChimp_api_key_validation_message').first().html("<img src=<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?> alt=message > <?php _e("Sorry, that is an invalid MailChimp API key.","yikes-inc-easy-mailchimp-extender"); ?>").css("color", "red").fadeIn();
|
185 |
jQuery('#submit').attr('disabled','disabled');
|
186 |
});
|
187 |
console.log('MailChimp API Response : '+response);
|
188 |
} else {
|
189 |
// if our response contains anything else, other than whats above, just let them know its invalid
|
190 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
191 |
+
jQuery('#yks-mailchimp-api-key').parents('td').find('.mailChimp_api_key_validation_message').first().html("<img src=<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?> alt=message > <?php _e("Sorry, that is an invalid MailChimp API key. Please check the console for further information.","yikes-inc-easy-mailchimp-extender"); ?>").css("color", "red").fadeIn();
|
192 |
});
|
193 |
console.log('MailChimp API Response : '+response);
|
194 |
jQuery('#submit').attr('disabled','disabled');
|
198 |
} else {
|
199 |
// if the length of the API input value is less than 1 (aka 0)
|
200 |
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
|
201 |
+
jQuery('#yks-mailchimp-api-key').parents('td').find('.mailChimp_api_key_validation_message').first().html("<img src=<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png'; ?> alt=message > <?php _e("Error: Please enter a valid Mail Chimp API Key.", "yikes-inc-easy-mailchimp-extender"); ?>").css("color", "red").fadeIn();
|
202 |
});
|
203 |
}
|
204 |
}
|
211 |
yikes_mc_api_key_validate();
|
212 |
});
|
213 |
|
214 |
+
/** Enable our Button if a valid key was previously saved **/
|
215 |
+
<?php if ( get_option( 'api_validation' ) == 'valid_api_key' ) { ?>
|
216 |
+
jQuery('#submit').removeAttr('disabled');
|
217 |
+
<?php } ?>
|
218 |
|
219 |
// Reset Plugin Ajax Request
|
220 |
$('#yks-mc-reset-plugin-settings').click(function(e) {
|
390 |
<div class="update-nag">
|
391 |
<span class="yks-mc-icon-notice"><h3><?php _e( 'LocalHost Detected :', 'yikes-inc-easy-mailchimp-extender' ); ?></h3></span>
|
392 |
<p><?php _e( 'It looks like your using Easy MailChimp Forms by YIKES Inc. on localhost.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
|
393 |
+
<p><?php _e( 'If you are unable to validate your API key, and receive the error message' , 'yikes-inc-easy-mailchimp-extender' ); ?><em> <?php _e('SSL certificate problem: unable to get local issuer certificate', 'yikes-inc-easy-mailchimp-extender' ); ?></em> <?php _e('follow the tutorial located ', 'yikes-inc-easy-mailchimp-extender' ); ?><a href="http://redwebturtle.blogspot.com/2013/09/mailchimp-api-v20-ssl-error-solution.html" target="_blank">here</a></p>
|
394 |
</div>
|
395 |
<?php } ?>
|
396 |
|
397 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form">
|
398 |
<table class="form-table yks-admin-form">
|
399 |
<tbody>
|
400 |
|
402 |
<tr valign="top">
|
403 |
<th scope="row"><label for="yks-mailchimp-api-key"><?php _e('Your Mailchimp API Key','yikes-inc-easy-mailchimp-extender'); ?></label></th>
|
404 |
<td>
|
405 |
+
<input name="yks-mailchimp-api-key" type="password" id="yks-mailchimp-api-key" value="<?php echo $this->yikes_mc_encryptIt($this->optionVal['api-key']); ?>" class="regular-text" /><span class="mailChimp_api_key_validation_message"></span><img class="mailChimp_api_key_preloader" src="<?php echo admin_url().'/images/wpspin_light.gif'; ?>" alt="preloader" ><span class="mailChimp_api_key_validation"></span><?php if ( get_option( 'api_validation' ) == 'valid_api_key' ) { echo '<span class="mailChimp_api_key_validation_message" style="color: green; display: inline;"><img src="'.plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-checkmark.png" alt="message">' . __(' Valid API Key','yikes-inc-easy-mailchimp-extender') . '</span>'; } else { echo '<span class="mailChimp_api_key_validation_message" style="display: inline; color: red;"><img src="' .plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-error-icon.png" alt="message">' . __(' Sorry, that is an invalid MailChimp API key. Please check the console for further information','yikes-inc-easy-mailchimp-extender') . '</span>'; } ?>
|
406 |
</td>
|
407 |
</tr>
|
408 |
<!-- MailChimp API Key Description -->
|
484 |
<?php _e('Text to display above interest groups. Leave blank to use MailChimp interest group names.','yikes-inc-easy-mailchimp-extender'); ?>
|
485 |
</td>
|
486 |
</tr>
|
487 |
+
<tr valign="top">
|
488 |
+
<!-- jQuery UI -->
|
489 |
+
<th scope="row"><label for="yks-mailchimp-jquery-datepicker"><?php _e('Use JQuery UI Datepicker','yikes-inc-easy-mailchimp-extender'); ?></label></th>
|
490 |
+
<td>
|
491 |
+
<input type="checkbox" name="yks-mailchimp-jquery-datepicker" class="yks-mailchimp-interest-group-label" value="1" <?php if ( isset( $this->optionVal['yks-mailchimp-jquery-datepicker'] ) && $this->optionVal['yks-mailchimp-jquery-datepicker'] == '1' ) { echo 'checked="checked"'; } ?>/>
|
492 |
+
</td>
|
493 |
+
</tr>
|
494 |
+
<tr>
|
495 |
+
<td></td>
|
496 |
+
<!-- Custom Interest Group Label Description -->
|
497 |
+
<td class="yks-settings-description">
|
498 |
+
<?php _e('Enable this setting to use the jQuery UI datepicker for all date fields on the front end of your site. Disable if you have no date fields (will help prevent conflicts).','yikes-inc-easy-mailchimp-extender'); ?>
|
499 |
+
</td>
|
500 |
+
</tr>
|
501 |
<tr valign="top">
|
502 |
<!-- Display OPTIN CHECKBOX SETTING -->
|
503 |
<th scope="row"><label for="yks-mailchimp-optIn-checkbox"><?php _e('Display opt-in checkbox on comment forms?','yikes-inc-easy-mailchimp-extender'); ?></label></th>
|
pages/welcome.php
ADDED
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script>
|
2 |
+
jQuery(document).ready(function() {
|
3 |
+
jQuery(window).resize(function() {
|
4 |
+
var slider_width = jQuery('#slider-wrapper').css('width');
|
5 |
+
var slider_height = slider_width.replace( 'px' , '' ) * .25;
|
6 |
+
jQuery('#slider-wrapper').css('height',slider_height);
|
7 |
+
jQuery('.inner-wrapper').css('height',slider_height);
|
8 |
+
console.log('The Slider Height is Currently : '+slider_height);
|
9 |
+
console.log('The Slider Width is Currently : '+slider_width);
|
10 |
+
});
|
11 |
+
});
|
12 |
+
</script>
|
13 |
+
<style>
|
14 |
+
.yksme-page-welcome p {
|
15 |
+
font-size: 18px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.yksme-page-welcome .row p {
|
19 |
+
font-size: 16px;
|
20 |
+
}
|
21 |
+
|
22 |
+
.yksme-page-welcome .new_feature_image {
|
23 |
+
width: 100%;
|
24 |
+
}
|
25 |
+
|
26 |
+
.yksme-page-welcome .navbar-text:first-child {
|
27 |
+
margin-left: 0 !important;
|
28 |
+
}
|
29 |
+
|
30 |
+
.yksme-page-welcome #welcome-page-content {
|
31 |
+
border-right: 1px solid #cdcdcd;
|
32 |
+
}
|
33 |
+
|
34 |
+
.yksme-page-welcome #welcome-page-sidebar {
|
35 |
+
padding: 0 1.5em;
|
36 |
+
height: 100%;
|
37 |
+
}
|
38 |
+
|
39 |
+
.yksme-page-welcome #welcome-page-sidebar #yksme-yikes-logo {
|
40 |
+
width: 100%;
|
41 |
+
max-width: 222px;
|
42 |
+
display:block;
|
43 |
+
margin:0 auto;
|
44 |
+
}
|
45 |
+
|
46 |
+
.yksme-page-welcome #resource-nav {
|
47 |
+
list-style: none;
|
48 |
+
font-size: 17px;
|
49 |
+
}
|
50 |
+
|
51 |
+
.yksme-page-welcome .social-media-buttons {
|
52 |
+
display:block;
|
53 |
+
width: 100%;
|
54 |
+
text-align:center;
|
55 |
+
margin-top: 1.5em;
|
56 |
+
}
|
57 |
+
|
58 |
+
.yksme-page-welcome #welcome-page-sidebar hr {
|
59 |
+
display:block;
|
60 |
+
margin: 2em 0;
|
61 |
+
}
|
62 |
+
|
63 |
+
body.admin_page_yks-mailchimp-welcome {
|
64 |
+
background-color: transparent !important;
|
65 |
+
}
|
66 |
+
|
67 |
+
.yksme-page-welcome hr {
|
68 |
+
border-top: 1px solid rgba(213, 213, 213, 0.89);
|
69 |
+
}
|
70 |
+
|
71 |
+
.yksme-page-welcome #welcome-page-sidebar-resources {
|
72 |
+
text-align: center !important;
|
73 |
+
}
|
74 |
+
|
75 |
+
.yksme-page-welcome #welcome-page-sidebar-resources h2 {
|
76 |
+
padding-right: 0;
|
77 |
+
}
|
78 |
+
|
79 |
+
.yksme-page-welcome #welcome-page-sidebar-google-plus {
|
80 |
+
text-align:center;
|
81 |
+
}
|
82 |
+
|
83 |
+
.yksme-page-welcome .enter-api-key-link {
|
84 |
+
margin-left: 8px;
|
85 |
+
}
|
86 |
+
|
87 |
+
.yksme-page-welcome .enter-api-key-link a {
|
88 |
+
color: #428bca !important;
|
89 |
+
}
|
90 |
+
|
91 |
+
.yksme-page-welcome .navbar-header {
|
92 |
+
width: 100%;
|
93 |
+
}
|
94 |
+
|
95 |
+
.yksme-page-welcome .report-an-issue-link {
|
96 |
+
color: rgba(255, 0, 20, 0.28) !important;
|
97 |
+
}
|
98 |
+
|
99 |
+
.yksme-page-welcome .minor-imporvements-notice {
|
100 |
+
list-style: circle;
|
101 |
+
margin-left: 1.5em;
|
102 |
+
}
|
103 |
+
|
104 |
+
.yksme-page-welcome .minor-imporvements-notice li p {
|
105 |
+
font-size: 16px !important;
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
@media screen and (max-width:991px) {
|
111 |
+
|
112 |
+
.yksme-page-welcome #welcome-page-sidebar {
|
113 |
+
border-left: none !important;
|
114 |
+
border-top: 1px solid grey;
|
115 |
+
padding-top: 2em;
|
116 |
+
height: 100%;
|
117 |
+
}
|
118 |
+
|
119 |
+
.yksme-page-welcome #welcome-page-sidebar #yksme-yikes-logo {
|
120 |
+
width: 250px;
|
121 |
+
display: block;
|
122 |
+
margin: 0 auto;
|
123 |
+
}
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
+
|
131 |
+
#slider-wrapper{
|
132 |
+
width: 100%;
|
133 |
+
height: 306px;
|
134 |
+
margin: .5em auto;
|
135 |
+
position: relative;
|
136 |
+
margin-bottom: 0px;
|
137 |
+
background: rgba(0,0,0,0.5);
|
138 |
+
overflow: hidden;
|
139 |
+
}
|
140 |
+
|
141 |
+
#s1{
|
142 |
+
padding: 6px;
|
143 |
+
background: #FFFFFF;
|
144 |
+
position: absolute;
|
145 |
+
left: 50%;
|
146 |
+
bottom: 25px;
|
147 |
+
margin-left: -36px;
|
148 |
+
border-radius: 20px;
|
149 |
+
opacity: 0.3;
|
150 |
+
cursor: pointer;
|
151 |
+
z-index: 999;
|
152 |
+
}
|
153 |
+
|
154 |
+
#s2{
|
155 |
+
padding: 6px;
|
156 |
+
background: #FFFFFF;
|
157 |
+
position: absolute;
|
158 |
+
left: 50%;
|
159 |
+
bottom: 25px;
|
160 |
+
margin-left: -12px;
|
161 |
+
border-radius: 20px;
|
162 |
+
opacity: 0.3;
|
163 |
+
cursor: pointer;
|
164 |
+
z-index: 999;
|
165 |
+
}
|
166 |
+
|
167 |
+
#s3{
|
168 |
+
padding: 6px;
|
169 |
+
background: #FFFFFF;
|
170 |
+
position: absolute;
|
171 |
+
left: 50%;
|
172 |
+
bottom: 25px;
|
173 |
+
margin-left: 12px;
|
174 |
+
border-radius: 20px;
|
175 |
+
opacity: 0.3;
|
176 |
+
cursor: pointer;
|
177 |
+
z-index: 999;
|
178 |
+
}
|
179 |
+
|
180 |
+
#s4{
|
181 |
+
padding: 6px;
|
182 |
+
background: #FFFFFF;
|
183 |
+
position: absolute;
|
184 |
+
left: 50%;
|
185 |
+
bottom: 25px;
|
186 |
+
margin-left: 36px;
|
187 |
+
border-radius: 20px;
|
188 |
+
opacity: 0.3;
|
189 |
+
cursor: pointer;
|
190 |
+
z-index: 999;
|
191 |
+
}
|
192 |
+
|
193 |
+
#s1:hover, #s2:hover, #s3:hover, #s4:hover{ opacity: 1;}
|
194 |
+
|
195 |
+
.inner-wrapper{
|
196 |
+
width: 100%;
|
197 |
+
height: 306px;
|
198 |
+
position: absolute;
|
199 |
+
top: 0;
|
200 |
+
left: 0;
|
201 |
+
margin-bottom: 0px;
|
202 |
+
overflow: hidden;
|
203 |
+
}
|
204 |
+
.control{ display: none;}
|
205 |
+
|
206 |
+
#Slide1:checked ~ .overflow-wrapper{ margin-left: 0%; }
|
207 |
+
#Slide2:checked ~ .overflow-wrapper{ margin-left: -100%; }
|
208 |
+
#Slide3:checked ~ .overflow-wrapper{ margin-left: -200%; }
|
209 |
+
#Slide4:checked ~ .overflow-wrapper{ margin-left: -300%; }
|
210 |
+
|
211 |
+
#Slide1:checked + #s1 { opacity: 1; }
|
212 |
+
#Slide2:checked + #s2 { opacity: 1; }
|
213 |
+
#Slide3:checked + #s3 { opacity: 1; }
|
214 |
+
#Slide4:checked + #s4 { opacity: 1; }
|
215 |
+
|
216 |
+
.overflow-wrapper{
|
217 |
+
width: 400%;
|
218 |
+
height: 100%;
|
219 |
+
position: absolute;
|
220 |
+
top: 0;
|
221 |
+
left: 0;
|
222 |
+
overflow-y: hidden;
|
223 |
+
z-index: 1;
|
224 |
+
-webkit-transition: all 0.3s ease-in-out;
|
225 |
+
-moz-transition: all 0.3s ease-in-out;
|
226 |
+
-o-transition: all 0.3s ease-in-out;
|
227 |
+
transition: all 0.3s ease-in-out;
|
228 |
+
}
|
229 |
+
|
230 |
+
.slide img{
|
231 |
+
width: 25%;
|
232 |
+
float: left;
|
233 |
+
}
|
234 |
+
</style>
|
235 |
+
|
236 |
+
<!-- used for the media query -->
|
237 |
+
<meta name="viewport" content="width=device-width" />
|
238 |
+
|
239 |
+
<div class="wrap yksme-page-welcome">
|
240 |
+
|
241 |
+
<div id="ykseme-icon" class="icon32"></div>
|
242 |
+
|
243 |
+
<div id="welcome-page-content" class="col-md-9">
|
244 |
+
|
245 |
+
<?php if ( get_option( 'api_validation' ) == 'valid_api_key' ) { // update from a previous version (detected by viewing the api_validation option) ?>
|
246 |
+
<h1 id="ykseme-page-header">
|
247 |
+
<?php _e('Welcome to YIKES Inc. Easy MailChimp Extender','yikes-inc-easy-mailchimp-extender'); ?> v<?php echo YKSEME_VERSION_CURRENT; ?>
|
248 |
+
<p>Thanks for updating YIKES Inc. Easy MailChimp extender. We're sure you'll be pleased with the latest additions to the plugin!</p>
|
249 |
+
</h1>
|
250 |
+
<?php } else { // fresh install ?>
|
251 |
+
<h1 id="ykseme-page-header">
|
252 |
+
<?php _e('Welcome to YIKES Inc. Easy MailChimp Extender','yikes-inc-easy-mailchimp-extender'); ?> v<?php echo YKSEME_VERSION_CURRENT; ?>
|
253 |
+
</h1>
|
254 |
+
|
255 |
+
<p>Thanks for installing YIKES Inc. Easy MailChimp extender. We know you're going to love this plugin! Check out some of the features below, and get started by entering your API key.</p>
|
256 |
+
<?php } ?>
|
257 |
+
<nav class="navbar navbar-default" role="navigation">
|
258 |
+
<div class="container-fluid">
|
259 |
+
<!-- Brand and toggle get grouped for better mobile display -->
|
260 |
+
<div class="navbar-header">
|
261 |
+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
262 |
+
<span class="sr-only">Navigation</span>
|
263 |
+
<span class="icon-bar"></span>
|
264 |
+
<span class="icon-bar"></span>
|
265 |
+
<span class="icon-bar"></span>
|
266 |
+
</button>
|
267 |
+
|
268 |
+
<?php if ( get_option( 'api_validation' ) == 'valid_api_key' ) { // update from a previous version (detected by viewing the api_validation option) ?>
|
269 |
+
|
270 |
+
<p class="navbar-text"><a href="<?php echo admin_url(); ?>admin.php?page=yks-mailchimp-form" class="navbar-link">MailChimp Settings</a></p>
|
271 |
+
<p class="navbar-text"><a href="<?php echo admin_url(); ?>admin.php?page=yks-mailchimp-my-mailchimp" class="navbar-link">My MailChimp</a></p>
|
272 |
+
<p class="navbar-text"><a href="<?php echo admin_url(); ?>admin.php?page=yks-mailchimp-form-lists" class="navbar-link">Manage Lists</a></p>
|
273 |
+
<p class="navbar-text"><a href="<?php echo admin_url(); ?>admin.php?page=yks-mailchimp-about-yikes" class="navbar-link">About YIKES Inc</a></p>
|
274 |
+
<p class="navbar-text navbar-right"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues?q=is%3Aopen+is%3Aissue" target="_blank" class="navbar-link report-an-issue-link">Report an Issue</a></p>
|
275 |
+
|
276 |
+
<?php } else { // fresh install ?>
|
277 |
+
|
278 |
+
<p class="navbar-text" style="margin-right:0;">Get Started : <p class="navbar-text enter-api-key-link"> <a href="<?php echo admin_url(); ?>admin.php?page=yks-mailchimp-form" class="navbar-link"> Enter Your API Key Now</a></p></p>
|
279 |
+
|
280 |
+
<?php } ?>
|
281 |
+
</div>
|
282 |
+
</div>
|
283 |
+
</nav>
|
284 |
+
|
285 |
+
<hr />
|
286 |
+
|
287 |
+
<div class="row">
|
288 |
+
|
289 |
+
<div class="col-md-4">
|
290 |
+
<h2>Style Customization</h2>
|
291 |
+
<p>Style imported forms on the fly, to fit the look and feel of your site. All without writing code!</p>
|
292 |
+
<p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/Form_Customizer.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
|
293 |
+
</div>
|
294 |
+
|
295 |
+
<div class="col-md-4">
|
296 |
+
<h2>Templating Framework</h2>
|
297 |
+
<p>All new templating framework that allows you to use a bundled template, or easily create your own!</p>
|
298 |
+
<p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/Custom_Templates.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
|
299 |
+
</div>
|
300 |
+
|
301 |
+
<div class="col-md-4">
|
302 |
+
<h2>Custom Classes</h2>
|
303 |
+
<p>We've now added the ability to attach custom class names to specific form inputs for greater style control.</p>
|
304 |
+
<p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/Custom_Class_Names.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
|
305 |
+
</div>
|
306 |
+
|
307 |
+
<div class="col-md-4">
|
308 |
+
<h2>New Manage List Page Styles</h2>
|
309 |
+
<p>All new styles for the manage list page, allowing you to collapse forms that you don't immediatly need.</p>
|
310 |
+
<p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/Manage_List_styles.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
|
311 |
+
</div>
|
312 |
+
|
313 |
+
<div class="col-md-4">
|
314 |
+
<h2>Browse Subscribers</h2>
|
315 |
+
<p>View subscribers that have previously signed up, and remove them on the fly!</p>
|
316 |
+
<p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/browse_subscribers.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
|
317 |
+
</div>
|
318 |
+
|
319 |
+
<div class="col-md-4">
|
320 |
+
<h2>Track Campaign+Signup Statistics</h2>
|
321 |
+
<p>View all types of statistics related to your signup forms and sent campaigns.</p>
|
322 |
+
<p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/track_stats.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
|
323 |
+
</div>
|
324 |
+
|
325 |
+
</div>
|
326 |
+
|
327 |
+
<hr />
|
328 |
+
|
329 |
+
<div class="row">
|
330 |
+
|
331 |
+
<div class="col-md-6">
|
332 |
+
|
333 |
+
<h4>Other Minor Improvements</h4>
|
334 |
+
<ul class="minor-imporvements-notice" style="list-style:circle;">
|
335 |
+
<li><p>Added missing label to radio buttons inside forms</p></li>
|
336 |
+
<li><p>Added missing closing parentheses on subscriber count inside view subscribers page</p></li>
|
337 |
+
<li><p>Only run API Key check when a new key is entered (not each page load)</p></li>
|
338 |
+
<li><p>Repaired scripts+styles not properly loading when running a site not in English</p></li>
|
339 |
+
</ul>
|
340 |
+
|
341 |
+
</div>
|
342 |
+
|
343 |
+
<div class="col-md-6">
|
344 |
+
|
345 |
+
<h4>Performance Echancements</h4>
|
346 |
+
<ul class="minor-imporvements-notice" style="list-style:circle;">
|
347 |
+
<li><p>Removed enqueue of Google CDN jQuery</p></li>
|
348 |
+
<li><p>Enqueue scripts+styles on front end, only when a form is displayed</p></li>
|
349 |
+
<li><p>Performed various performance checks</p></li>
|
350 |
+
</ul>
|
351 |
+
|
352 |
+
</div>
|
353 |
+
|
354 |
+
</div>
|
355 |
+
|
356 |
+
<hr />
|
357 |
+
|
358 |
+
<h2>Sample Bundled Header Opt-In Forms</h2>
|
359 |
+
<div id="slider-wrapper">
|
360 |
+
<div class="inner-wrapper">
|
361 |
+
<input checked type="radio" name="slide" class="control" id="Slide1"/>
|
362 |
+
<label for="Slide1" id="s1"></label>
|
363 |
+
<input type="radio" name="slide" class="control" id="Slide2"/>
|
364 |
+
<label for="Slide2" id="s2"></label>
|
365 |
+
<input type="radio" name="slide" class="control" id="Slide3"/>
|
366 |
+
<label for="Slide3" id="s3"></label>
|
367 |
+
<div class="overflow-wrapper">
|
368 |
+
<a class="slide" href=""><img class="slide_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/slide_images/header_optin_template_city_skyline.jpg" alt="Header Optin Template - City Skyline" title="Header Optin Template - City Skyline" onclick="return false;" ></a>
|
369 |
+
<a class="slide" href=""><img class="slide_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/slide_images/header_optin_template_vacation.jpg" alt="Header Optin Template - Vacation" title="Header Optin Template - Vacation" onclick="return false;" ></a>
|
370 |
+
<a class="slide" href=""><img class="slide_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/slide_images/header_optin_template_sub-head-bar.jpg" alt="Header Optin Template - Vacation" title="Header Optin Template - Vacation" onclick="return false;" ></a>
|
371 |
+
</div>
|
372 |
+
</div>
|
373 |
+
</div>
|
374 |
+
|
375 |
+
</div>
|
376 |
+
|
377 |
+
|
378 |
+
<div id="welcome-page-sidebar" class="col-md-3">
|
379 |
+
|
380 |
+
<a href="http://www.yikesinc.com" title="YIKES, Inc." target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/yikes_logo.png" alt="YIKES, Inc." id="yksme-yikes-logo" /></a>
|
381 |
+
|
382 |
+
<hr />
|
383 |
+
|
384 |
+
<div class="b-sbn" style="margin-top:2em; text-align:center;">
|
385 |
+
<a href="http://www.bcorporation.net/yikes" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/bcorp.jpg" alt="Certified B Corporation"></a>
|
386 |
+
<a href="http://www.sbnphiladelphia.org/" target="_blank"><img src="<?php echo YKSEME_URL; ?>/images/sbn_logo.png" alt="Proud sponsor of the Sustainable Business Network of Philadelphia"></a>
|
387 |
+
</div>
|
388 |
+
|
389 |
+
<div class="social-media-buttons">
|
390 |
+
<a href="http://facebook.com/yikesinc" target="_blank" class="yks_mc_about_icon"><img src="<?php echo YKSEME_URL; ?>/images/facebook.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Facebook" height="24" width="24"></a>
|
391 |
+
<a href="http://twitter.com/yikesinc" target="_blank" class="yks_mc_about_icon"><img src="<?php echo YKSEME_URL; ?>/images/twitter.png" style="border: 0px none;" alt="YIKES Philadelphia Web design and Development Twitter" height="24" width="24"></a>
|
392 |
+
<a href="http://www.linkedin.com/companies/yikes-inc" title="Linkedin" target="_blank" class="yks_mc_about_icon"><img src="<?php echo YKSEME_URL; ?>/images/linkedin.png" alt="YIKES Philadelphia Web design and Development Linkedin" border="0" height="24" width="24"></a>
|
393 |
+
</div>
|
394 |
+
|
395 |
+
<hr />
|
396 |
+
|
397 |
+
<div id="welcome-page-sidebar-resources">
|
398 |
+
<h2>Resources</h2>
|
399 |
+
<ul id="resource-nav">
|
400 |
+
<li><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/other_notes/" title="Documentation" target="_blank" >Documentation</a></li>
|
401 |
+
<li><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues?q=is%3Aopen+is%3Aissue" title="Report an Issue" target="_blank" >Report an Issue</a></li>
|
402 |
+
<li><a href="http://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" title="Review" target="_blank" >Leave a Review</a></li>
|
403 |
+
<li><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/faq/" target="_blank" title="FAQ">FAQ</a></li>
|
404 |
+
</ul>
|
405 |
+
</div>
|
406 |
+
|
407 |
+
<hr />
|
408 |
+
|
409 |
+
<div id="welcome-page-sidebar-google-plus">
|
410 |
+
<!-- Google+ Company Info Follow Box -->
|
411 |
+
<!-- Place this tag where you want the widget to render. -->
|
412 |
+
<div class="g-page" data-width="273" data-href="https://plus.google.com/102712426677276794986" data-rel="publisher"></div>
|
413 |
+
</div>
|
414 |
+
|
415 |
+
</div>
|
416 |
+
|
417 |
+
</div>
|
418 |
+
|
419 |
+
|
420 |
+
<!-- Place this tag after the last widget tag. -->
|
421 |
+
<script type="text/javascript">
|
422 |
+
(function() {
|
423 |
+
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
424 |
+
po.src = 'https://apis.google.com/js/platform.js';
|
425 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
426 |
+
})();
|
427 |
+
</script>
|
process/ajax.php
CHANGED
@@ -15,18 +15,6 @@ default:
|
|
15 |
echo '-1';
|
16 |
break;
|
17 |
|
18 |
-
// temporary solution to the issue - v5.0.8 repair
|
19 |
-
// should be properly fixed in v5.1
|
20 |
-
case 'frontend_submit_form':
|
21 |
-
$action = $yksemeBase->addUserToMailchimp($_POST);
|
22 |
-
if($action == "done")
|
23 |
-
{
|
24 |
-
echo '1';
|
25 |
-
} else {
|
26 |
-
echo $action;
|
27 |
-
}
|
28 |
-
break;
|
29 |
-
|
30 |
case 'update_options':
|
31 |
$action = $yksemeBase->updateOptions($_POST);
|
32 |
if($action)
|
15 |
echo '-1';
|
16 |
break;
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
case 'update_options':
|
19 |
$action = $yksemeBase->updateOptions($_POST);
|
20 |
if($action)
|
process/public.ajax.php
CHANGED
@@ -11,7 +11,18 @@ if(!empty($_POST)
|
|
11 |
{
|
12 |
|
13 |
case 'frontend_submit_form':
|
14 |
-
$action = $yksemeBase->addUserToMailchimp($_POST);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
if($action == "done")
|
16 |
{
|
17 |
echo '1';
|
11 |
{
|
12 |
|
13 |
case 'frontend_submit_form':
|
14 |
+
$action = $yksemeBase->addUserToMailchimp($_POST,$update_existing='false');
|
15 |
+
if($action == "done")
|
16 |
+
{
|
17 |
+
echo '1';
|
18 |
+
} else {
|
19 |
+
echo $action;
|
20 |
+
}
|
21 |
+
break;
|
22 |
+
|
23 |
+
/* Resubmit form data - update previously subscribed user */
|
24 |
+
case 'frontend_resubmit_form_data':
|
25 |
+
$action = $yksemeBase->addUserToMailchimp($_POST,$update_existing='true');
|
26 |
if($action == "done")
|
27 |
{
|
28 |
echo '1';
|
readme.md
DELETED
@@ -1,588 +0,0 @@
|
|
1 |
-
Easy MailChimp Forms
|
2 |
-
===========
|
3 |
-
Easy MailChimp Forms allows you to painlessly add MailChimp signup forms to your WordPress site. You can add forms to posts, pages or sidebars with shortcodes, widgets or template tags. Simply copy and paste your MailChimp API Key into the plugin admin settings and it will pull in all your MailChimp lists. From there you can choose the lists you want to make forms for. For a single list you can check off the fields you want to include on your form and order them via an easy drag-and-drop interface. This plugin adds plenty of CSS selectors to the form code allowing you to completely customize the look of your forms.
|
4 |
-
|
5 |
-
**Note:** You will need a MailChimp API key to allow this plugin to communicate with your MailChimp account. For help on retrieving your API key, check out #4 of the [FAQ?](http://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/faq/ "FAQ") section. You can also read the MailChimp knowledge base article [Where can I find my API Key?](http://kb.mailchimp.com/article/where-can-i-find-my-api-key "Where can I find my API Key?").
|
6 |
-
|
7 |
-
Instructions on how to use the plugin can be [found on the FAQ](http://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/faq/ "found on the FAQ"). If you experience any problems, please submit a New Issue on our [Github Issue Tracker](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues "Github Issue Tracker") and we'll look in to it as soon as possible.
|
8 |
-
|
9 |
-
Features
|
10 |
-
===========
|
11 |
-
|
12 |
-
1. Complete Integration of MailChimp into WordPress
|
13 |
-
1. Easily import MailChimp forms from an active MailChimp account
|
14 |
-
1. View/Print Interactive Account Growth Reports and Campaign Reports (Statistics Tracking)
|
15 |
-
1. reCaptcha spam prevention baked in
|
16 |
-
1. Monitor MailChimp account activity
|
17 |
-
1. Use MailChimp Interest Group/Segments
|
18 |
-
1. Add MailChimp forms sidebars/widgetized areas with widgets
|
19 |
-
1. Set forms to single or double opt-in
|
20 |
-
1. Customize the success message
|
21 |
-
1. Customize the submit button text
|
22 |
-
1. Redirect users to a page on submission
|
23 |
-
1. Un-subscribe users from MailChimp lists
|
24 |
-
1. View subscriber MailChimp profiles
|
25 |
-
1. View individual form subscriber count
|
26 |
-
1. Display multiple forms on a single page
|
27 |
-
1. Add commenter's to your MailChimp lists with a comment form opt-in check box
|
28 |
-
1. Easily add forms to pages and posts with a button in the page/post editor
|
29 |
-
1. Use cURL error detection to troubleshoot MailChimp connection issues
|
30 |
-
|
31 |
-
Installation
|
32 |
-
===========
|
33 |
-
|
34 |
-
1. Download the plugin .zip file
|
35 |
-
1. Log in to yourdomain.com/wp-admin
|
36 |
-
1. Click Plugins -> Add New -> Upload
|
37 |
-
1. Activate the plugin
|
38 |
-
1. Go over to [MailChimp.com](http://www.mailchimp.com) and login.
|
39 |
-
1. On the right hand menu, click your profile picture and select 'Account Settings' and then go to 'Extras > API Keys'.
|
40 |
-
1. Enter your API key into the text field inside 'MailChimp Forms > MailChimp Settings'
|
41 |
-
1. Start importing forms from MailChimp and adding them to posts, pages and widgets!
|
42 |
-
|
43 |
-
Frequently Asked Questions
|
44 |
-
===========
|
45 |
-
|
46 |
-
#### Do I need to have a MailChimp Account?
|
47 |
-
Yes, you can register for one for free at [MailChimp](https://mailchimp.com/signup/ "MailChimp Signup").
|
48 |
-
|
49 |
-
#### Do I need to have lists already set up in MailChimp?
|
50 |
-
Yes, you have to have at least 1 list set up in MailChimp.
|
51 |
-
|
52 |
-
For more help, visit the MailChimp Support article [How do I create a new list?](http://kb.mailchimp.com/article/where-can-i-find-my-api-key "How do I create a new list?")
|
53 |
-
|
54 |
-
#### What do I do first?
|
55 |
-
The first step is to add your MailChimp API key. This will allow your site to communicate with your MailChimp account. This is done on the plugin "MailChimp Settings" page.
|
56 |
-
|
57 |
-
#### Where do I find my API Key?
|
58 |
-
From your MailChimp Dashboard, click on your account name in the upper left hand corner of the screen under the MailChimp logo to expose the "Account Settings" menu. Click on "Account Settings" to go to the Account Settings screen and the click on the "Extras" menu. Under "Extras" choose "API keys." From there you can create a new key if you do not already have one.
|
59 |
-
|
60 |
-
For more help, visit the MailChimp Support article [Where can I find my API Key?](http://kb.mailchimp.com/article/where-can-i-find-my-api-key "Where can I find my API Key?")
|
61 |
-
|
62 |
-
#### How to I add my MailChimp lists?
|
63 |
-
After you add your API key, the plugin will fetch all of your MailChimp list information and load it into the plugin admin. Go to the plugin "Manage List Forms" page to choose the lists you want to make forms for.
|
64 |
-
|
65 |
-
#### How do I add the MailChimp signup forms to my site?
|
66 |
-
You can use a shortcode to add a form to a page or post, use the MailChimp form button in the visual editor or use a widget to add it to a sidebar. Each list on the plugin "Manage List Forms" displays a shortcode at the top. Copy the shortcode and paste it into any post or page where you want a form to appear. For example, if my form had the shortcode [yks-mailchimp-list id="1234567891"] I would copy and paste that into the page or post I wanted to add that form to.
|
67 |
-
|
68 |
-
#### I input a valid MailChimp API key, but it returns invalid every time. I've already tried a new API key, but no dice. What's up?
|
69 |
-
|
70 |
-
**Step 1:** Ensure that cURL is enabled at the server level. You will see an error at the top of the settings page if cURL is disabled. If you see no error, continue to step 2.
|
71 |
-
|
72 |
-
**Step 2:** If you have entered your MailChimp API key and are still getting the error "*Error: Please enter a valid Mail Chimp API Key*," please check the developer console inside your browser for further information.
|
73 |
-
|
74 |
-
- Right-click in the API Key input field, and select 'Inpsect Element'
|
75 |
-
- Once the developer console is open, select the Console tab to see a more specific error.
|
76 |
-
|
77 |
-
For information on how to use your browser's developer console, read the WordPress Codex article, [Using Your Browser to Diagnose JavaScript Errors](http://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors).
|
78 |
-
|
79 |
-
**Possible Errors And Resolutions**
|
80 |
-
|
81 |
-
* Could not resolve host: xxxx.api.mailchimp.com - the host you have provided is incorrect. The host is the string after the last dash (example: us2)
|
82 |
-
* Invalid Mailchimp API Key: xxxxxxxxxxxxxxxxxx-xxx - Your API key is invalid. You can confirm a valid key by logging into [MailChimp](http://mailchimp.com) and checking the active API key registered to your account.
|
83 |
-
|
84 |
-
#### I don't want the form to be the 100% width. How can I adjust the width myself?
|
85 |
-
You can adjust the width of the forms on your site by changing the width of the element with the class .yks-mailchimpFormContainer. This is the parent container for the form. Adjusting this width will control the width of the input fields inside of it.
|
86 |
-
|
87 |
-
#### How can I translate this plugin?
|
88 |
-
Easy MailChimp Forms is now translated into multiple languages:
|
89 |
-
|
90 |
-
+ Arabic
|
91 |
-
+ Chinese
|
92 |
-
+ English
|
93 |
-
+ French
|
94 |
-
+ German
|
95 |
-
+ Greek
|
96 |
-
+ Hebrew
|
97 |
-
+ Hindi
|
98 |
-
+ Hong Kong
|
99 |
-
+ Italian
|
100 |
-
+ Japanese
|
101 |
-
+ Korean
|
102 |
-
+ Persian
|
103 |
-
+ Portuguese (Brazilian)
|
104 |
-
+ Portuguese (European)
|
105 |
-
+ Romanian
|
106 |
-
+ Russian
|
107 |
-
+ Spanish
|
108 |
-
+ Swedish
|
109 |
-
+ Taiwanese
|
110 |
-
+ Tamil
|
111 |
-
+ Urdu
|
112 |
-
+ Vietnamese
|
113 |
-
+ Welsh
|
114 |
-
|
115 |
-
Read the Codex article [Installing WordPress in Your Language](http://codex.wordpress.org/Installing_WordPress_in_Your_Language) for more information. Also, please refer to our [Developer Docs](http://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/other_notes/).
|
116 |
-
|
117 |
-
#### Do you provide any hooks, or filters for me to take advantage of?
|
118 |
-
Yes! With the 4.0 version of our plugin we have added a few hooks that allow you to add or manipulate existing data. Check out the [Other Notes](http://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/other_notes/) tab for more information.
|
119 |
-
|
120 |
-
#### When I input my API key and hit save, it immediately reverts to a much shorter string of text and returns invalid. What's going on?
|
121 |
-
You most likely have a password manager installed and active (LastPass, OnePass, TeamPassword etc.). The API key input field is set to type="password" for security reasons. Most password managers auto-fill password fields based on the URL of the current page. So, what happens when you click save is that the password manager auto fills in the field with the password that you have saved for your site, and thus returning 'invalid API key'. To resolve the issue you'll need to temporarily disable any active password manager and re-enter and save your API key. Once the key has been successfully saved, you can re-enable your password manager.
|
122 |
-
|
123 |
-
Developer Documentation
|
124 |
-
===========
|
125 |
-
<br />
|
126 |
-
## Text Domain
|
127 |
-
|
128 |
-
##### Name:
|
129 |
-
`yikes-inc-easy-mailchimp-extender`
|
130 |
-
|
131 |
-
##### Description :
|
132 |
-
90% of the plug-in is localized and ready for translation. This means that you can manipulate text using the provided text domain, using a gettext filter.
|
133 |
-
|
134 |
-
##### Accepted Parameters:
|
135 |
-
_N/A_
|
136 |
-
|
137 |
-
##### _Example_:
|
138 |
-
_This example will alter text on the admin dashboard on the manage lists page._
|
139 |
-
|
140 |
-
```php
|
141 |
-
<?php
|
142 |
-
/**
|
143 |
-
* Change Specific Test on the 'Manage List Forms' page.
|
144 |
-
*
|
145 |
-
*/
|
146 |
-
function theme_change_comment_field_names( $translated_text, $text, $domain ) {
|
147 |
-
|
148 |
-
switch ( $translated_text ) {
|
149 |
-
|
150 |
-
case 'Your Lists' :
|
151 |
-
|
152 |
-
$translated_text = __( 'MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' );
|
153 |
-
break;
|
154 |
-
|
155 |
-
case 'Save Form Settings' :
|
156 |
-
|
157 |
-
$translated_text = __( 'Save Form', 'yikes-inc-easy-mailchimp-extender' );
|
158 |
-
break;
|
159 |
-
|
160 |
-
case 'Create a Form For This List' :
|
161 |
-
|
162 |
-
$translated_text = __( '<== Import This List', 'yikes-inc-easy-mailchimp-extender' );
|
163 |
-
break;
|
164 |
-
|
165 |
-
}
|
166 |
-
|
167 |
-
return $translated_text;
|
168 |
-
}
|
169 |
-
add_filter( 'gettext', 'theme_change_comment_field_names', 20, 3 );
|
170 |
-
?>
|
171 |
-
```
|
172 |
-
<br />
|
173 |
-
## Hooks
|
174 |
-
|
175 |
-
|
176 |
-
##### Hook Name :
|
177 |
-
`yks_mc_before_form_$formID`
|
178 |
-
|
179 |
-
##### Description :
|
180 |
-
Used to place content before a specific MailChimp form. Use the form id to specify which form to place text before.
|
181 |
-
|
182 |
-
##### Accepted Parameters:
|
183 |
-
_N/A_
|
184 |
-
|
185 |
-
##### _Example_:
|
186 |
-
_This example will print out a thank you message before a specific form._
|
187 |
-
|
188 |
-
|
189 |
-
```php
|
190 |
-
/**
|
191 |
-
* Function to add text before the form with ID '0b071c0bd1'
|
192 |
-
* You can get form ID's from the 'MailChimp List' page
|
193 |
-
*/
|
194 |
-
function custom_before_form_action() {
|
195 |
-
echo '<p>Thanks for checking out our mailing list. Fill out the form below to get started!</p>';
|
196 |
-
}
|
197 |
-
add_action( 'yks_mc_before_form_0b071c0bd1' , 'custom_before_form_action' );
|
198 |
-
```
|
199 |
-
|
200 |
-
**Note**: in our add_action call we add the specific form ID to target a single form.
|
201 |
-
|
202 |
-
<br />
|
203 |
-
|
204 |
-
##### Hook Name :
|
205 |
-
`yks_mc_after_form_$formID`
|
206 |
-
|
207 |
-
##### Description :
|
208 |
-
Used to place content after a specific MailChimp form. Use the form id to specify which form to place text after.
|
209 |
-
|
210 |
-
##### Accepted Parameters:
|
211 |
-
_N/A_
|
212 |
-
|
213 |
-
##### _Example_:
|
214 |
-
_This example will print out a disclaimer message after a specific form._
|
215 |
-
|
216 |
-
|
217 |
-
```php
|
218 |
-
/**
|
219 |
-
* Function to add text after the form with ID '0b071c0bd1'
|
220 |
-
* You can get form ID's from the 'MailChimp List' page
|
221 |
-
*/
|
222 |
-
function custom_after_form_action() {
|
223 |
-
echo '<p><em>Your information is for internal use only, and will never be shared with or sold to anyone.</em></p>';
|
224 |
-
}
|
225 |
-
add_action( 'yks_mc_after_form_0b071c0bd1' , 'custom_after_form_action' );
|
226 |
-
```
|
227 |
-
|
228 |
-
**Note**: in our add_action call we add the specific form ID to target a single form.
|
229 |
-
|
230 |
-
<br />
|
231 |
-
|
232 |
-
##### Hook Name :
|
233 |
-
`yks_mc_before_form`
|
234 |
-
|
235 |
-
##### Description :
|
236 |
-
Used to place content before **all** MailChimp Forms.
|
237 |
-
|
238 |
-
##### Accepted Parameters:
|
239 |
-
_N/A_
|
240 |
-
|
241 |
-
##### _Example_:
|
242 |
-
```PHP
|
243 |
-
/**
|
244 |
-
* This example will print out a disclaimer to the user,
|
245 |
-
* above all MailChimp forms.
|
246 |
-
*/
|
247 |
-
function custom_before_all_forms_action() {
|
248 |
-
echo '<p><em>Your information is for internal use only, and will never be shared with or sold to anyone.</em></p>';
|
249 |
-
}
|
250 |
-
add_action( 'yks_mc_before_form' , 'custom_before_all_forms_action' );
|
251 |
-
```
|
252 |
-
|
253 |
-
<br />
|
254 |
-
|
255 |
-
##### Hook Name :
|
256 |
-
`yks_mc_after_form`
|
257 |
-
|
258 |
-
##### Description :
|
259 |
-
Used to place content after **all** MailChimp Forms.
|
260 |
-
|
261 |
-
##### Accepted Parameters:
|
262 |
-
_N/A_
|
263 |
-
|
264 |
-
##### _Example_:
|
265 |
-
```PHP
|
266 |
-
/**
|
267 |
-
* This example will print out a disclaimer to the user,
|
268 |
-
* below all MailChimp forms.
|
269 |
-
*/
|
270 |
-
function custom_after_all_forms_action() {
|
271 |
-
echo '<p><em>Your information is for internal use only, and will never be shared with or sold to anyone.</em></p>';
|
272 |
-
}
|
273 |
-
add_action( 'yks_mc_after_form' , 'custom_after_all_forms_action' );
|
274 |
-
```
|
275 |
-
|
276 |
-
<br />
|
277 |
-
|
278 |
-
## Filters
|
279 |
-
|
280 |
-
##### Filter Name :
|
281 |
-
`yikes_mc_get_form_data`
|
282 |
-
|
283 |
-
##### Accepted Parameters:
|
284 |
-
`$Form_ID` and `$merge_variables`
|
285 |
-
|
286 |
-
##### Parameter Info:
|
287 |
-
|
288 |
-
`$Form_ID` = the ID of the specific MailChimp Form ( can be retrieved from the 'MailChimp Forms > Manage List Forms' menu ).
|
289 |
-
|
290 |
-
`$merge_variables` = a multi-dimensional array containing all user entered data being sent to the MailChimp API (The email, first name, last name etc. will be contained here).
|
291 |
-
|
292 |
-
##### Description :
|
293 |
-
Used to catch user data, **from all forms**, before it gets sent to the mailchimp API. Useful when you want to manipulate data before being sent to the MailChimp API or if you'd like to use the entered data locally.
|
294 |
-
|
295 |
-
##### _Example_:
|
296 |
-
_This example will catch the user submitted data, **of all forms**, store the users firstname in a variable and then update the current logged in user firstname profile field with the value in the First Name MailChimp field._
|
297 |
-
|
298 |
-
```php
|
299 |
-
/**
|
300 |
-
* This example will catch the user submitted data, of all forms, store the users firstname in a variable and then update
|
301 |
-
* the current logged in user firstname profile field with the value in the First Name MailChimp field.
|
302 |
-
*/
|
303 |
-
function catch_user_data( $form_ID, $merge_variables ) {
|
304 |
-
// if the user is logged in
|
305 |
-
if ( is_user_logged_in() ) {
|
306 |
-
|
307 |
-
// get the logged in user id
|
308 |
-
$user_id = get_current_user_id();
|
309 |
-
|
310 |
-
// if the first name field is set
|
311 |
-
if ( isset( $merge_variables['FNAME'] ) ) {
|
312 |
-
|
313 |
-
// update logged in users first name with the provided name in MC form
|
314 |
-
wp_update_user( array( 'ID' => $user_id, 'first_name' => $merge_variables['FNAME'] ) );
|
315 |
-
|
316 |
-
// can be used for any of the fields in the form + any fields in the user profile
|
317 |
-
}
|
318 |
-
|
319 |
-
}
|
320 |
-
}
|
321 |
-
add_filter( 'yikes_mc_get_form_data' , 'catch_user_data', 10, 2 );
|
322 |
-
```
|
323 |
-
|
324 |
-
<br />
|
325 |
-
|
326 |
-
##### Filter Name :
|
327 |
-
`yikes_mc_get_form_data_$formID`
|
328 |
-
|
329 |
-
##### Accepted Parameters:
|
330 |
-
`$Form_ID` and `$merge_variables`
|
331 |
-
|
332 |
-
##### Parameter Info:
|
333 |
-
|
334 |
-
`$Form_ID` = the ID of the specific MailChimp Form ( can be retrieved from the 'MailChimp Forms > Manage List Forms' menu ).
|
335 |
-
|
336 |
-
`$merge_variables` = a multi-dimensional array containing all user entered data being sent to the MailChimp API (The email, first name, last name etc. will be contained here).
|
337 |
-
|
338 |
-
##### Description :
|
339 |
-
Used to catch user data, of a specific form, before it gets sent to the mailchimp API. Useful when you want to manipulate data before being sent to the MailChimp API or if you'd like to use the entered data locally.
|
340 |
-
|
341 |
-
##### _Example_:
|
342 |
-
_This example will catch the user submitted data **from a specific form**, store the users firstname in a variable and then update the current logged in user firstname profile field with the value in the First Name MailChimp field._
|
343 |
-
|
344 |
-
```php
|
345 |
-
/**
|
346 |
-
* This example will catch the user submitted data, store the users firstname in a variable and then update
|
347 |
-
* the current logged in user firstname profile field with the value in the First Name MailChimp field.
|
348 |
-
* This catches data from ALL forms being submitted.
|
349 |
-
*/
|
350 |
-
function catch_user_data_from_specific_form( $form_ID, $merge_variables ) {
|
351 |
-
// if the user is logged in
|
352 |
-
if ( is_user_logged_in() ) {
|
353 |
-
|
354 |
-
// get the logged in user id
|
355 |
-
$user_id = get_current_user_id();
|
356 |
-
|
357 |
-
// if the first name field is set
|
358 |
-
if ( isset( $merge_variables['FNAME'] ) ) {
|
359 |
-
|
360 |
-
// update logged in users first name with the provided name in MC form
|
361 |
-
wp_update_user( array( 'ID' => $user_id, 'first_name' => $merge_variables['FNAME'] ) );
|
362 |
-
|
363 |
-
// can be used for any of the fields in the form + any fields in the user profile
|
364 |
-
}
|
365 |
-
|
366 |
-
}
|
367 |
-
}
|
368 |
-
add_filter( 'yikes_mc_get_form_data_3d13f0f784' , 'catch_user_data_from_specific_form', 10, 2 );
|
369 |
-
```
|
370 |
-
|
371 |
-
## Helper Functions
|
372 |
-
|
373 |
-
##### Description :
|
374 |
-
These functions are defined inside of the Easy MailChimp plugin and they exist to help test and view the user data that is being submitted by the user through the MailChimp form. These functions will prevent the default form functionality, so no user data will be sent to MailChimp while testing.
|
375 |
-
|
376 |
-
These functions should be used in conjunction with the `yikes_mc_get_form_data` or the `yikes_mc_get_form_data_$formID` filters. Whatever data the user has provided will be returned for viewing.
|
377 |
-
|
378 |
-
##### Provided Functions :
|
379 |
-
`yks_mc_print_user_data( $form_ID, $merge_variables );` and `yks_mc_dump_user_data( $form_ID, $merge_variables );`
|
380 |
-
*Defined In: class.yksemeBase.php on line 2441 and 2510 respectively.*
|
381 |
-
|
382 |
-
##### _Example Useage_:
|
383 |
-
*Print User Data*
|
384 |
-
```php
|
385 |
-
<?php
|
386 |
-
/**
|
387 |
-
* This example will return all of the submitted
|
388 |
-
* user data In a nice readable format
|
389 |
-
*/
|
390 |
-
function print_user_data_from_form( $form_ID, $merge_variables ) {
|
391 |
-
if( class_exists( 'yksemeBase' ) ) {
|
392 |
-
$yikes_easy_mailchimp = new yksemeBase();
|
393 |
-
}
|
394 |
-
$yikes_easy_mailchimp->yks_mc_print_user_data( $form_ID, $merge_variables );
|
395 |
-
}
|
396 |
-
add_filter( 'yikes_mc_get_form_data' , 'print_user_data_from_form', 10, 2 );
|
397 |
-
?>
|
398 |
-
```
|
399 |
-
|
400 |
-
*Dump User Data*
|
401 |
-
```php
|
402 |
-
<?php
|
403 |
-
/**
|
404 |
-
* This example will dump all of the submitted
|
405 |
-
* user data, so you can see the full array of data
|
406 |
-
* being returned
|
407 |
-
*/
|
408 |
-
function dump_user_data_from_form( $form_ID, $merge_variables ) {
|
409 |
-
if( class_exists( 'yksemeBase' ) ) {
|
410 |
-
$yikes_easy_mailchimp = new yksemeBase();
|
411 |
-
}
|
412 |
-
$yikes_easy_mailchimp->yks_mc_dump_user_data( $form_ID, $merge_variables );
|
413 |
-
}
|
414 |
-
add_filter( 'yikes_mc_get_form_data' , 'dump_user_data_from_form', 10, 2 );
|
415 |
-
?>
|
416 |
-
```
|
417 |
-
|
418 |
-
Changes
|
419 |
-
===========
|
420 |
-
|
421 |
-
### 5.0.9 - October 3rd, 2014
|
422 |
-
* Added autocomplete="false" to API input field
|
423 |
-
* Added event listener to form submission (forms can now be placed in modals/slideout menus)
|
424 |
-
|
425 |
-
### 5.0.8 - September 23, 2014
|
426 |
-
* Band-aid fix for the -1 response returned from ajax.php
|
427 |
-
|
428 |
-
### 5.0.7 - September 19, 2014
|
429 |
-
* Security Vulnerability patched - props @g0blinResearch for privately disclosing the issue
|
430 |
-
|
431 |
-
### 5.0.6 - August 22, 2014
|
432 |
-
* fix bug with nonce security check when using table 'Preferred Form Layout' setting
|
433 |
-
|
434 |
-
### 5.0.5 - August 21, 2014
|
435 |
-
* added `stripslashes()` to the following settings fields :
|
436 |
-
- Single Opt-in Confirmation Message
|
437 |
-
- Double Opt-in Confirmation Message
|
438 |
-
- Interest Group Label
|
439 |
-
- Opt-in Checkbox Text
|
440 |
-
* Updated Readme FAQ
|
441 |
-
|
442 |
-
### 5.0.4 - August 6, 2014
|
443 |
-
* Update SSL conditional in main plugin file
|
444 |
-
* Added mcrypt module check, for API encryption
|
445 |
-
* Conditionally loaded scripts and styles in admin ( prevent conflicts )
|
446 |
-
* Included NONCE security checks on form submissions ( helps prevent CSRF and other attacks )
|
447 |
-
* Added proper update task function to add missing settings to the options page ( prevents undefined variables for new settings )
|
448 |
-
* Added missing styles to post page ( added missing icon to tinyMCE button )
|
449 |
-
* Added missing styles to widget page
|
450 |
-
* Adjusted Chimp Chatter activity time formatting to return correct time based on user time zone
|
451 |
-
* New Feature : Real time updates to Account Activity ( utilizing the heartbeat API )
|
452 |
-
* New Feature : Added account activity widget to dashboard ( with live updates using heartbeat API )
|
453 |
-
* Added screenshot of admin dashboard account activity widget
|
454 |
-
|
455 |
-
### 5.0.3
|
456 |
-
* Re-Apply missing styles to new 'My MailChimp' Section
|
457 |
-
|
458 |
-
### 5.0.2
|
459 |
-
* Remove extra spacing in provided short code, which caused parsing issues
|
460 |
-
|
461 |
-
### 5.0.1
|
462 |
-
* Remove global box-sizing CSS declaration
|
463 |
-
|
464 |
-
### 5.0
|
465 |
-
* Custom content filter to prevent other plugins from accidentally hooking in
|
466 |
-
* Updated translation files with new text and translations
|
467 |
-
* Added new screen shots
|
468 |
-
* Updated plugin activation hooks
|
469 |
-
* base64_encoded MailChimp API Key for privacy on multi-admin sites
|
470 |
-
* Added an entirely new "My MailChimp" section
|
471 |
-
* "My MailChimp" section now includes account overview details
|
472 |
-
* Added much needed campaign statistic tracking page
|
473 |
-
* Added ability to track Campaign Click/Opens with geo-data and interactive charts including world map
|
474 |
-
* Added account /listgrowth section with interactive bar chart
|
475 |
-
* Added "Chimp Chatter" feed to track account activity
|
476 |
-
* Ability to export interactive charts to png, jpg, svg
|
477 |
-
* Printable Campaign Reports
|
478 |
-
* View campaign
|
479 |
-
* Re-Branded entire Plugin
|
480 |
-
|
481 |
-
### 4.3
|
482 |
-
* Updated radio button fields
|
483 |
-
* Re-worked related JS and PHP functions
|
484 |
-
|
485 |
-
### 4.2.2
|
486 |
-
* Added open_basedir conditional check to toggle CURLOPT_FOLLOWLOCATION based on users server settings
|
487 |
-
* Prevents warning being thrown for users on shared hosts with an open_basedir set
|
488 |
-
|
489 |
-
### 4.2.1
|
490 |
-
* Removed all unnecessary Google tracking codes and functions
|
491 |
-
|
492 |
-
### 4.2
|
493 |
-
* Updated FAQ
|
494 |
-
* Re-worked the redirect for a better user experience
|
495 |
-
* Unified error messages into a single container on the front end
|
496 |
-
* Converted custom opt-in messages to utilize the WYSIWYG editors ( now allowing for html and images to be used in your success messages )
|
497 |
-
* Re-styled front end interest group containers
|
498 |
-
|
499 |
-
### 4.1
|
500 |
-
* Fixed JavaScript errors on when Address field is set to required
|
501 |
-
* Added user feedback on successful re-import of form
|
502 |
-
* Fixed some style issues
|
503 |
-
* Added animate.css
|
504 |
-
* Added class to required fields that were left empty
|
505 |
-
* Remove outdated jQuery
|
506 |
-
* Now error is appended to the form, instead of alerted through JavaScript
|
507 |
-
* Fixed date picker field, and images associated to it
|
508 |
-
* Added ability to include html mark-up to confirmation fields
|
509 |
-
|
510 |
-
### 4.0
|
511 |
-
* Added Interest Group/Segment Support
|
512 |
-
* Ability To See Number of Subscriber Per List
|
513 |
-
* View Subscribers MailChimp Profile
|
514 |
-
* Customize Segment Group Label
|
515 |
-
* Customize Submit Button Text
|
516 |
-
* Redirect User to Specified Page On Submission
|
517 |
-
* Customize Success Message
|
518 |
-
* Added cURL Server Error Checking
|
519 |
-
* Added further error checking to pages
|
520 |
-
* Added new hooks and filters ( see developer docs for examples )
|
521 |
-
* Translations added
|
522 |
-
|
523 |
-
### 3.0
|
524 |
-
* Update MailChimp API to v2.0
|
525 |
-
* Added API Validation Check on settings page
|
526 |
-
|
527 |
-
### 2.2.1
|
528 |
-
* Bugfix make sure label matches ID
|
529 |
-
|
530 |
-
### 2.2.0
|
531 |
-
* Change plugin name
|
532 |
-
* Add better MailChimp error messaging
|
533 |
-
* Add Advanced Error Messaging option
|
534 |
-
* Add required fields indication
|
535 |
-
* Improve admin UI
|
536 |
-
* Update FAQ and screenshots
|
537 |
-
* Add list name to forms on Manage List Forms page
|
538 |
-
* Implement fetching list fields via MailChimp API key
|
539 |
-
* Fix incorrect use of register_uninstall_hook()
|
540 |
-
|
541 |
-
### 2.1.0
|
542 |
-
* Fix more jquery conflict issues
|
543 |
-
* Clarification on how to add and manage list forms
|
544 |
-
|
545 |
-
### 2.0.3:
|
546 |
-
* Add labels to table option for form
|
547 |
-
|
548 |
-
### 2.0.2:
|
549 |
-
* Fix class MCAPI conflict issue
|
550 |
-
* Automatically check for jquery if not use version 1.7.1
|
551 |
-
* fix jquery conflict issue (specifically when multiple instance of "jQuery(document).ready..."
|
552 |
-
* fix jquery conflict with ".cycle" jquery command commonly used in slideshows.
|
553 |
-
* add jquery libraries 1.7.1 and prototype
|
554 |
-
* use "noConflict" in each jquery instance to avoid future conflicts.
|
555 |
-
* update Yikes about us info.
|
556 |
-
|
557 |
-
### 2.0.1:
|
558 |
-
* Now supports multiples of the same list
|
559 |
-
* Fixed the date format issue
|
560 |
-
* Removed prompt class from the field wrapper
|
561 |
-
* Updated plugin description
|
562 |
-
* Disallowed adding the same list twice on the admin side
|
563 |
-
* About page now links to the YIKES, Inc. page
|
564 |
-
|
565 |
-
### 2.0.0:
|
566 |
-
* Added import function to pull in existing custom fields
|
567 |
-
* Added new field handling to work with any list configuration
|
568 |
-
* Required fields in MailChimp are now reflected properly in the list view
|
569 |
-
* Added ability to choose Divs or Tables
|
570 |
-
|
571 |
-
### 1.3.1:
|
572 |
-
* Added nopriv ajax action for anonymous users
|
573 |
-
|
574 |
-
### 1.3.0:
|
575 |
-
* Added custom merge_vars field
|
576 |
-
|
577 |
-
### 1.2.0:
|
578 |
-
* Removed required from First Name and Last Name fields
|
579 |
-
* Added update routines for future versions
|
580 |
-
|
581 |
-
### 1.1.0:
|
582 |
-
* Changed the list logic and added a notice for the MERGE VAR naming schema
|
583 |
-
|
584 |
-
### 1.0.1:
|
585 |
-
* Changed CSS paths from Absolute to Relative
|
586 |
-
|
587 |
-
### 1.0.0:
|
588 |
-
* Initial Release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: yikesinc, hiwhatsup, liljimmi, eherman24, seriouslysean
|
|
3 |
Donate link: http://yikesinc.com
|
4 |
Tags: mailchimp, marketing, email, mailing lists, newsletter, sign up, forms, sign up form
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Easy MailChimp Forms allows you to painlessly add MailChimp sign up forms to your WordPress site and track user activity with interactive reports.
|
@@ -17,6 +17,8 @@ Easy MailChimp Forms allows you to painlessly add MailChimp sign up forms to you
|
|
17 |
|
18 |
**Features**
|
19 |
|
|
|
|
|
20 |
* Complete Integration of MailChimp into WordPress
|
21 |
* Easily import MailChimp forms from an active MailChimp account
|
22 |
* View/Print Interactive Account Growth Reports and Campaign Reports (Statistics Tracking)
|
@@ -136,6 +138,21 @@ Yes! Since version 4.4 of Easy MailChimp Extender, we have added [reCAPTCHA](htt
|
|
136 |
= When I input my API key and hit save, it immediately reverts to a much shorter string of text and returns invalid. What's going on? =
|
137 |
You most likely have a password manager installed and active (LastPass, OnePass, TeamPassword etc.). The API key input field is set to type="password" for security reasons. Most password managers auto-fill password fields based on the URL of the current page. So, what happens when you click save is that the password manager auto fills in the field with the password that you have saved for your site, and thus returning 'invalid API key'. To resolve the issue you'll need to temporarily disable any active password manager and re-enter and save your API key. Once the key has been successfully saved, you can re-enable your password manager.
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
== Developer Docs. ==
|
140 |
|
141 |
**Text Domain**
|
@@ -345,6 +362,104 @@ This example will catch the user submitted data, *of all forms*, store the users
|
|
345 |
`
|
346 |
<br />
|
347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
**Filter Name:**
|
349 |
`yikes_mc_get_form_data_$formID`
|
350 |
|
@@ -445,17 +560,38 @@ These functions should be used in conjunction with the `yikes_mc_get_form_data`
|
|
445 |
3. YIKES Easy MailChimp Account Activity Overview
|
446 |
4. YIKES Easy MailChimp Campaign Overview
|
447 |
5. YIKES Easy MailChimp Campaign Statistics Reports
|
448 |
-
6. Yikes Easy MailChimp Form Listing Page
|
449 |
7. View all subscribers of a given list, click to reveal individual subscriber info
|
450 |
8. Custom widget to easily add forms to sidebars and widgets
|
451 |
9. Form rendered on the front end of the site
|
452 |
10. Optional opt-in checkbox on the comment forms, easily add commenter's to your email list
|
453 |
11. Custom tinyMCE button allows you to easily add imported forms to pages and posts at the click of a button
|
454 |
12. About YIKES page
|
455 |
-
13.
|
|
|
456 |
|
457 |
== Changelog ==
|
458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
= 5.0.9 - October 3rd, 2014 =
|
460 |
|
461 |
**Fixes**
|
@@ -478,13 +614,11 @@ These functions should be used in conjunction with the `yikes_mc_get_form_data`
|
|
478 |
= 5.0.6 - August 22, 2014 =
|
479 |
|
480 |
**Fixes**
|
481 |
-
|
482 |
* fix bug with nonce security check when using table 'Preferred Form Layout' setting
|
483 |
|
484 |
= 5.0.5 - August 21, 2014 =
|
485 |
|
486 |
**Fixes**
|
487 |
-
|
488 |
- added `stripslashes()` to the following settings fields :
|
489 |
- Single Opt-in Confirmation Message
|
490 |
- Double Opt-in Confirmation Message
|
@@ -492,7 +626,6 @@ These functions should be used in conjunction with the `yikes_mc_get_form_data`
|
|
492 |
- Opt-in Checkbox Text
|
493 |
|
494 |
**Updates**
|
495 |
-
|
496 |
- Updated readme FAQ section
|
497 |
|
498 |
= 5.0.4 - August 6, 2014 =
|
@@ -654,29 +787,39 @@ These functions should be used in conjunction with the `yikes_mc_get_form_data`
|
|
654 |
|
655 |
== Upgrade Notice ==
|
656 |
|
|
|
|
|
|
|
|
|
657 |
= 5.0.9 - October 3rd, 2014 =
|
658 |
|
659 |
**Fixes**
|
|
|
660 |
* Added autocomplete="false" to API input field
|
|
|
661 |
|
662 |
= 5.0.8 - September 23, 2014 =
|
663 |
|
664 |
**Fixes**
|
|
|
665 |
* Band-aid fix for the -1 response returned from ajax.php
|
666 |
|
667 |
= 5.0.7 - September 19, 2014 =
|
668 |
|
669 |
**Fixes**
|
|
|
670 |
* Security Vulnerability patched - props @g0blinResearch for privately disclosing the issue
|
671 |
|
672 |
= 5.0.6 - August 22, 2014 =
|
673 |
|
674 |
**Fixes**
|
|
|
675 |
* fix bug with nonce security check when using table 'Preferred Form Layout' setting
|
676 |
|
677 |
= 5.0.5 - August 21, 2014 =
|
678 |
|
679 |
**Fixes**
|
|
|
680 |
- added `stripslashes()` to the following settings fields :
|
681 |
- Single Opt-in Confirmation Message
|
682 |
- Double Opt-in Confirmation Message
|
@@ -684,6 +827,7 @@ These functions should be used in conjunction with the `yikes_mc_get_form_data`
|
|
684 |
- Opt-in Checkbox Text
|
685 |
|
686 |
**Updates**
|
|
|
687 |
- Updated readme FAQ section
|
688 |
|
689 |
= 5.0.4 - August 6, 2014 =
|
3 |
Donate link: http://yikesinc.com
|
4 |
Tags: mailchimp, marketing, email, mailing lists, newsletter, sign up, forms, sign up form
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 3.9.2
|
7 |
+
Stable tag: 5.1
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Easy MailChimp Forms allows you to painlessly add MailChimp sign up forms to your WordPress site and track user activity with interactive reports.
|
17 |
|
18 |
**Features**
|
19 |
|
20 |
+
* Create your own signup form templates ( *new* )
|
21 |
+
* Style your forms without writing a single line of code ( *new* )
|
22 |
* Complete Integration of MailChimp into WordPress
|
23 |
* Easily import MailChimp forms from an active MailChimp account
|
24 |
* View/Print Interactive Account Growth Reports and Campaign Reports (Statistics Tracking)
|
138 |
= When I input my API key and hit save, it immediately reverts to a much shorter string of text and returns invalid. What's going on? =
|
139 |
You most likely have a password manager installed and active (LastPass, OnePass, TeamPassword etc.). The API key input field is set to type="password" for security reasons. Most password managers auto-fill password fields based on the URL of the current page. So, what happens when you click save is that the password manager auto fills in the field with the password that you have saved for your site, and thus returning 'invalid API key'. To resolve the issue you'll need to temporarily disable any active password manager and re-enter and save your API key. Once the key has been successfully saved, you can re-enable your password manager.
|
140 |
|
141 |
+
= How do I create my own custom MailChimp template? =
|
142 |
+
**Step 1:**
|
143 |
+
First you'll want to import the boilerplate template files bundled with the plugin. These are files that were created for easy customization. You can import the boilerplate files by going to the manage list forms page and clicking 'import boilerplate templates'.
|
144 |
+
|
145 |
+
<em>Note :</em> Alternatively, you can manually import the template files by copying the 'yikes-mailchimp-user-templates' directory inside of the plugin root ( 'yikes-inc-easy-mailchimp-extender/templates/' ) over to your theme root. ( ie: /wp-content/themes/twentyfourteen/ ).
|
146 |
+
|
147 |
+
**Step 2:**
|
148 |
+
Once imported you'll find the boilerplate files in your theme root. Each boilerplate template file comes with an associated .css file located inside of the styles directory. To get started on your first template, we recommend that you duplicate one of the existing boilerplate tempalate files and its associated .css file, and changing the name.
|
149 |
+
|
150 |
+
**Step 3:**
|
151 |
+
Finally, change the MailChimp template, author and description headers at the top of each template file. The 'MailChimp Template' header dictates the name of your template, and what will appear in the drop down field. You'll also want to make sure that the correct .css file is properly being enqueued at the top of the template file.
|
152 |
+
|
153 |
+
**Step 4:**
|
154 |
+
Once setup, you can assign the template to your form from the 'Manage List' page. Make sure to select the checkbox 'use custom form' and then in the drop down select your newly created template.
|
155 |
+
|
156 |
== Developer Docs. ==
|
157 |
|
158 |
**Text Domain**
|
362 |
`
|
363 |
<br />
|
364 |
|
365 |
+
**Filter Name:**
|
366 |
+
`yikes_mc_user_already_subscribed`
|
367 |
+
|
368 |
+
**Accepted Parameters:**
|
369 |
+
`$errorMessage` , `$update_user_link` and `$email`
|
370 |
+
|
371 |
+
**Parameter Info:**
|
372 |
+
|
373 |
+
`$errorMessage` = the error message returned by the MailChimp API. By Default : "email@domain.com is already subscribed to the list."
|
374 |
+
|
375 |
+
`$update_user_link` = the link that will re-submit the form to update the current users info. Default link text : "Update My Info"
|
376 |
+
|
377 |
+
`$email` = the email address provided in the Email field
|
378 |
+
|
379 |
+
**Description:**
|
380 |
+
Used to display a custom error message back to the user, when a user attempts to subscribe to a list they already exist on.
|
381 |
+
|
382 |
+
**Example:**
|
383 |
+
The following example will alter the error returned from the MailChimp API. Useful when you would like to provide a more custom error message. The 'Update' link will re-submit the form using the 'update_existing' parameter to update the current users profile.
|
384 |
+
|
385 |
+
`
|
386 |
+
<?php
|
387 |
+
/**
|
388 |
+
* This example will return a custom error message to the user when they attempt to subscribe to
|
389 |
+
* a list they already exist on. The following will show something similar "Sorry, John@johnsmith.com is already subscribed to this list. Please Update My Information."
|
390 |
+
*/
|
391 |
+
function custom_user_already_subscribed_error( $errorMessage , $update_user_link , $email ) {
|
392 |
+
$errorMessage = 'Sorry, ' . $email . ' is already subscribed to this list.';
|
393 |
+
$errorMessage .= str_replace( 'Update My Info.' , 'Please Update My Information' , $update_user_link );
|
394 |
+
return $errorMessage;
|
395 |
+
}
|
396 |
+
add_filter( 'yikes_mc_user_already_subscribed' , 'custom_user_already_subscribed_error' , 10 , 3 );
|
397 |
+
?>
|
398 |
+
`
|
399 |
+
<br />
|
400 |
+
|
401 |
+
**Filter Name:**
|
402 |
+
`yikes_mc_subscriber_update_message`
|
403 |
+
|
404 |
+
**Accepted Parameters:**
|
405 |
+
`$success_message`
|
406 |
+
|
407 |
+
**Parameter Info:**
|
408 |
+
|
409 |
+
`$success_message` = the success message to be displayed to the user, defaults to "Thanks, your information has been successfuly updated."
|
410 |
+
|
411 |
+
**Description:**
|
412 |
+
Used to alter the success message returned when a user updates their account information for a given list
|
413 |
+
|
414 |
+
**Example:**
|
415 |
+
The following example will alter success message displayed back to the user after they have updated their account information for a given list. Defualts to : "Thanks, your information has been successfuly updated."
|
416 |
+
|
417 |
+
`
|
418 |
+
<?php
|
419 |
+
/**
|
420 |
+
* The following example will alter the success message when a user re-submits
|
421 |
+
* the form data to update their information for a given form
|
422 |
+
*/
|
423 |
+
function custom_resubmit_info_message( $success_message ) {
|
424 |
+
$success_message = "Thanks for updating your info! You're so awesome!";
|
425 |
+
return $success_message;
|
426 |
+
}
|
427 |
+
add_filter( 'yikes_mc_subscriber_update_message' , 'custom_resubmit_info_message' , 10 );
|
428 |
+
?>
|
429 |
+
`
|
430 |
+
<br />
|
431 |
+
|
432 |
+
**Filter Name:**
|
433 |
+
`yks_redirect_add_post_types`
|
434 |
+
|
435 |
+
**Accepted Parameters:**
|
436 |
+
`$post_array `
|
437 |
+
|
438 |
+
**Parameter Info:**
|
439 |
+
|
440 |
+
`$post_array` = an array of post type names that you would like to be included into the drop down as a redirect option on the manage list page
|
441 |
+
|
442 |
+
**Description:**
|
443 |
+
Use this filter to add any number of custom post types to the redirect dropdown
|
444 |
+
|
445 |
+
**Example:**
|
446 |
+
The following example will add any and all posts with the custom post type 'portfolio' to the redirect dropdown
|
447 |
+
|
448 |
+
`
|
449 |
+
<?php
|
450 |
+
/**
|
451 |
+
* This example will add the custom post type 'portfolio' to the
|
452 |
+
* redirect dropdown on the manage list forms page
|
453 |
+
*/
|
454 |
+
function add_portfolio_post_type_to_yikes_redirect_dropdown( $post_array ) {
|
455 |
+
$post_array[] = 'portfolio';
|
456 |
+
return $post_array;
|
457 |
+
}
|
458 |
+
add_filter( 'yks_redirect_add_post_types' , 'add_portfolio_post_type_to_yikes_redirect_dropdown' );
|
459 |
+
?>
|
460 |
+
`
|
461 |
+
<br />
|
462 |
+
|
463 |
**Filter Name:**
|
464 |
`yikes_mc_get_form_data_$formID`
|
465 |
|
560 |
3. YIKES Easy MailChimp Account Activity Overview
|
561 |
4. YIKES Easy MailChimp Campaign Overview
|
562 |
5. YIKES Easy MailChimp Campaign Statistics Reports
|
563 |
+
6. *New* Yikes Easy MailChimp Redesigned Form Listing Page
|
564 |
7. View all subscribers of a given list, click to reveal individual subscriber info
|
565 |
8. Custom widget to easily add forms to sidebars and widgets
|
566 |
9. Form rendered on the front end of the site
|
567 |
10. Optional opt-in checkbox on the comment forms, easily add commenter's to your email list
|
568 |
11. Custom tinyMCE button allows you to easily add imported forms to pages and posts at the click of a button
|
569 |
12. About YIKES page
|
570 |
+
13. Admin Dashboard Widget - Account Activity ( With Live Updating )
|
571 |
+
14. *New* Form customizer, with simple UI including color pickers
|
572 |
|
573 |
== Changelog ==
|
574 |
|
575 |
+
= 5.1 - November 3, 2014 =
|
576 |
+
|
577 |
+
**Updates**
|
578 |
+
|
579 |
+
* Release v5.1
|
580 |
+
* Added brand new templating framework, to allow users to create custom form templates for use with any MailChimp List
|
581 |
+
* Re-style Manage List page
|
582 |
+
* Added missing label to radio buttons inside the form
|
583 |
+
* Added missing closing parentheses on subscriber count inside view subscribers page
|
584 |
+
* Added custom color picker to easily stylize forms without writing a single line of code
|
585 |
+
* Added ability to specify a custom class names for each field of the form ( easily add custom class names to MailChimp form fields for further customization )
|
586 |
+
* Only run API Key check when a new key is entered ( not on each page load )
|
587 |
+
* Added new Welcome page with features+update notifications for users
|
588 |
+
* Security vulnerability re-patched - props @g0blinResearch for privately disclosing the potential vulnerability
|
589 |
+
* Added `yks_redirect_add_post_types` filter, to allow custom post types to be added to the redirect drop down (view [docs](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/other_notes/) for example)
|
590 |
+
* Added `yikes_mc_user_already_subscribed` filter to allow users to alter the message displayed to the user when they are already subscribed to a given list (view [docs](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/other_notes/) for example)
|
591 |
+
* Added `yikes_mc_subscriber_update_message` filter, to alter the success message when a user updates their account information for a given list (view [docs](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/other_notes/) for example)
|
592 |
+
* Added a new link to allow users to update profile information if previously subscribed to a given list
|
593 |
+
* Added 5 bundled templates, and 2 boilerplate files for users to use as a starting point for new templates
|
594 |
+
|
595 |
= 5.0.9 - October 3rd, 2014 =
|
596 |
|
597 |
**Fixes**
|
614 |
= 5.0.6 - August 22, 2014 =
|
615 |
|
616 |
**Fixes**
|
|
|
617 |
* fix bug with nonce security check when using table 'Preferred Form Layout' setting
|
618 |
|
619 |
= 5.0.5 - August 21, 2014 =
|
620 |
|
621 |
**Fixes**
|
|
|
622 |
- added `stripslashes()` to the following settings fields :
|
623 |
- Single Opt-in Confirmation Message
|
624 |
- Double Opt-in Confirmation Message
|
626 |
- Opt-in Checkbox Text
|
627 |
|
628 |
**Updates**
|
|
|
629 |
- Updated readme FAQ section
|
630 |
|
631 |
= 5.0.4 - August 6, 2014 =
|
787 |
|
788 |
== Upgrade Notice ==
|
789 |
|
790 |
+
= 5.1 - November 3, 2014 =
|
791 |
+
|
792 |
+
We have added brand new functionality, allowing users to easily customize forms on the fly, through a familiar UI as well as a templating framework to allow users to design and implement their own custom forms. A minor security bug was patched in this release as well. We fixed an issue with the API key check running on each page load, and added a few new filters to allow users to alter text (please view the [docs](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/other_notes/) for example)
|
793 |
+
|
794 |
= 5.0.9 - October 3rd, 2014 =
|
795 |
|
796 |
**Fixes**
|
797 |
+
|
798 |
* Added autocomplete="false" to API input field
|
799 |
+
* Added event listener to form submission (forms can now be placed in modals/slideout menus)
|
800 |
|
801 |
= 5.0.8 - September 23, 2014 =
|
802 |
|
803 |
**Fixes**
|
804 |
+
|
805 |
* Band-aid fix for the -1 response returned from ajax.php
|
806 |
|
807 |
= 5.0.7 - September 19, 2014 =
|
808 |
|
809 |
**Fixes**
|
810 |
+
|
811 |
* Security Vulnerability patched - props @g0blinResearch for privately disclosing the issue
|
812 |
|
813 |
= 5.0.6 - August 22, 2014 =
|
814 |
|
815 |
**Fixes**
|
816 |
+
|
817 |
* fix bug with nonce security check when using table 'Preferred Form Layout' setting
|
818 |
|
819 |
= 5.0.5 - August 21, 2014 =
|
820 |
|
821 |
**Fixes**
|
822 |
+
|
823 |
- added `stripslashes()` to the following settings fields :
|
824 |
- Single Opt-in Confirmation Message
|
825 |
- Double Opt-in Confirmation Message
|
827 |
- Opt-in Checkbox Text
|
828 |
|
829 |
**Updates**
|
830 |
+
|
831 |
- Updated readme FAQ section
|
832 |
|
833 |
= 5.0.4 - August 6, 2014 =
|
templates/form_template.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="yks-mailchimpFormContainerInner" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
2 |
+
<div class="yks-require-description">
|
3 |
+
<span class='yks-required-label'>*</span> = <?php _e('required field','yikes-inc-easy-mailchimp-extender'); ?>
|
4 |
+
</div>
|
5 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" rel="<?php echo $list['id']; ?>">
|
6 |
+
<input type="hidden" name="yks-mailchimp-list-ct" id="yks-mailchimp-list-ct_<?php echo $list['id']; ?>" value="<?php echo $listCt; ?>" />
|
7 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
8 |
+
<?php echo $this->getFrontendFormDisplay($list, $submit_text); ?>
|
9 |
+
</form>
|
10 |
+
</div>
|
templates/mailChimpChatter-widget-template.php
CHANGED
@@ -1,128 +1,128 @@
|
|
1 |
-
<?php
|
2 |
-
// template for displaying the MailChimp
|
3 |
-
// Chatter Widget on the Dashboard
|
4 |
-
|
5 |
-
// loop over the response, to display
|
6 |
-
// appripriate messages back to the user
|
7 |
-
// style as best we can, similar to MailChimp
|
8 |
-
?>
|
9 |
-
|
10 |
-
<!-- widget specific styles -->
|
11 |
-
<style>
|
12 |
-
#yks_mc_account_activity_widget .inside {
|
13 |
-
padding: 0;
|
14 |
-
margin: 0;
|
15 |
-
}
|
16 |
-
|
17 |
-
#yks-admin-chimp-chatter , .chatter-content-row {
|
18 |
-
width: 100%;
|
19 |
-
display: table;
|
20 |
-
padding: .5em 0;
|
21 |
-
}
|
22 |
-
.chimp-chatter-image {
|
23 |
-
margin-left: 10px !important;
|
24 |
-
}
|
25 |
-
|
26 |
-
.chatter-content-row td:nth-child(2), .chatter-content-row td:nth-child(1) {
|
27 |
-
width: 65px !important;
|
28 |
-
text-align: center;
|
29 |
-
}
|
30 |
-
|
31 |
-
#yks_mc_account_activity_widget > h3 > span:before {
|
32 |
-
content: url('<?php echo plugins_url(); ?>/yikes-inc-easy-mailchimp-extender/images/yikes_logo_widget_icon.png');
|
33 |
-
width:33px;
|
34 |
-
float:left;
|
35 |
-
height:10px;
|
36 |
-
margin: -3px 10px 0 0px;
|
37 |
-
}
|
38 |
-
</style>
|
39 |
-
|
40 |
-
|
41 |
-
<div class="yks_mailChimp_Chatter">
|
42 |
-
<table id="yks-admin-chimp-chatter">
|
43 |
-
<tbody>
|
44 |
-
<?php
|
45 |
-
if ( !empty ( $resp ) ) {
|
46 |
-
$i = 1;
|
47 |
-
|
48 |
-
foreach ( $resp as $chatter ) {
|
49 |
-
|
50 |
-
// specify the number of items you want
|
51 |
-
// returned to the widget here
|
52 |
-
if ( $i > 8 ) {
|
53 |
-
break;
|
54 |
-
} else {
|
55 |
-
|
56 |
-
// get our timezone offset so we
|
57 |
-
// can return the proper time to the user
|
58 |
-
$timezone_offset = get_option('gmt_offset');
|
59 |
-
|
60 |
-
// decide if the row should be even or odd
|
61 |
-
// used for zebra striping the table
|
62 |
-
if ( $i % 2 == 0 ) {
|
63 |
-
echo '<tr class="chatter-table-row chatter-content-row alternate">';
|
64 |
-
} else {
|
65 |
-
echo '<tr class="chatter-table-row chatter-content-row">';
|
66 |
-
}
|
67 |
-
// set up the date and time variables
|
68 |
-
$update_time_explode = explode( ' ', $chatter['update_time'] );
|
69 |
-
$date = $update_time_explode[0];
|
70 |
-
$time = $update_time_explode[1];
|
71 |
-
$time_explode = explode( ":" , $time );
|
72 |
-
$time = ( $time_explode[0] + $timezone_offset ).":".$time_explode[1];
|
73 |
-
|
74 |
-
// get the type of action that was recorded
|
75 |
-
$type = explode( ':' , $chatter['type']);
|
76 |
-
|
77 |
-
// set up the image based on the chatter type
|
78 |
-
// Known Possibilities Include -
|
79 |
-
// lists:new-subscriber, lists:unsubscribes, lists:profile-updates, campaigns:facebook-likes,
|
80 |
-
// campaigns:facebook-comments, campaigns:forward-to-friend, lists:imports, or campaigns:inbox-inspections
|
81 |
-
if ( $type[1] == 'new-subscriber' ) {
|
82 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/subscriber-added.png' . '" alt="New User Subscribed" class="chimp-chatter-image" />';
|
83 |
-
} else if ( $type[1] == 'unsubscribes' ) {
|
84 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/subscriber-removed.png' . '" alt="User Unsubscribed" class="chimp-chatter-image" />';
|
85 |
-
} else if ( $type[1] == 'profile-updates' ) {
|
86 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/profile-updated.png' . '" alt="Profile Updated" class="chimp-chatter-image" />';
|
87 |
-
} else if ( $type[1] == 'facebook-likes' ) {
|
88 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/facebook-like.png' . '" alt="Facebook Like" class="chimp-chatter-image" />';
|
89 |
-
} else if ( $type[1] == 'facebook-comments' ) {
|
90 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/facebook-comment.png' . '" alt="Facebook Comment" class="chimp-chatter-image" />';
|
91 |
-
} else if ( $type[1] == 'forward-to-friend' ) {
|
92 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/forward-to-friend.png' . '" alt="Forward To Friend" class="chimp-chatter-image" />';
|
93 |
-
} else if ( $type[1] == 'imports' ) {
|
94 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/import.png' . '" alt="Imports" class="chimp-chatter-image" />';
|
95 |
-
} else if ( $type[1] == 'inbox-inspections' ) {
|
96 |
-
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/inbox-inspection.png' . '" alt="Inbox Inspection" class="chimp-chatter-image" />';
|
97 |
-
}
|
98 |
-
|
99 |
-
// get and store the returned message
|
100 |
-
// split the message at ' - ' , which will
|
101 |
-
// separate the title and messages into two strings
|
102 |
-
$message = explode( ' - ' , $chatter['message'] );
|
103 |
-
$message_title = $message[0];
|
104 |
-
$message_content = $message[1];
|
105 |
-
// visual representation of user action
|
106 |
-
echo '<td>'.$type_image . '</td>';
|
107 |
-
// date user subscribed
|
108 |
-
echo '<td><b>'.date("M d", strtotime($date)).'</b><br /><em>'.date( 'g:i a', strtotime($time) ).'</em></td>';
|
109 |
-
// message title of action taken
|
110 |
-
echo '<td class="chimp-chatter-message"><strong class="chimp-chatter-message-title">'.$message_title.'</strong>';
|
111 |
-
echo '</tr>';
|
112 |
-
|
113 |
-
}
|
114 |
-
$i++;
|
115 |
-
}
|
116 |
-
} else {
|
117 |
-
?>
|
118 |
-
<tr>
|
119 |
-
<td style="width:100%;text-align:center !important;">
|
120 |
-
<h2 class="no_data_found" style="font-size:1.25em;font-style:italic;"><?php _e( "No recent account activity. Check back again later." , "yikes-inc-easy-mailchimp-extender" ); ?></h2>
|
121 |
-
</td>
|
122 |
-
</tr>
|
123 |
-
<?php
|
124 |
-
}
|
125 |
-
?>
|
126 |
-
</tbody>
|
127 |
-
</table>
|
128 |
</div>
|
1 |
+
<?php
|
2 |
+
// template for displaying the MailChimp
|
3 |
+
// Chatter Widget on the Dashboard
|
4 |
+
|
5 |
+
// loop over the response, to display
|
6 |
+
// appripriate messages back to the user
|
7 |
+
// style as best we can, similar to MailChimp
|
8 |
+
?>
|
9 |
+
|
10 |
+
<!-- widget specific styles -->
|
11 |
+
<style>
|
12 |
+
#yks_mc_account_activity_widget .inside {
|
13 |
+
padding: 0;
|
14 |
+
margin: 0;
|
15 |
+
}
|
16 |
+
|
17 |
+
#yks-admin-chimp-chatter , .chatter-content-row {
|
18 |
+
width: 100%;
|
19 |
+
display: table;
|
20 |
+
padding: .5em 0;
|
21 |
+
}
|
22 |
+
.chimp-chatter-image {
|
23 |
+
margin-left: 10px !important;
|
24 |
+
}
|
25 |
+
|
26 |
+
.chatter-content-row td:nth-child(2), .chatter-content-row td:nth-child(1) {
|
27 |
+
width: 65px !important;
|
28 |
+
text-align: center;
|
29 |
+
}
|
30 |
+
|
31 |
+
#yks_mc_account_activity_widget > h3 > span:before {
|
32 |
+
content: url('<?php echo plugins_url(); ?>/yikes-inc-easy-mailchimp-extender/images/yikes_logo_widget_icon.png');
|
33 |
+
width:33px;
|
34 |
+
float:left;
|
35 |
+
height:10px;
|
36 |
+
margin: -3px 10px 0 0px;
|
37 |
+
}
|
38 |
+
</style>
|
39 |
+
|
40 |
+
|
41 |
+
<div class="yks_mailChimp_Chatter">
|
42 |
+
<table id="yks-admin-chimp-chatter">
|
43 |
+
<tbody>
|
44 |
+
<?php
|
45 |
+
if ( !empty ( $resp ) ) {
|
46 |
+
$i = 1;
|
47 |
+
|
48 |
+
foreach ( $resp as $chatter ) {
|
49 |
+
|
50 |
+
// specify the number of items you want
|
51 |
+
// returned to the widget here
|
52 |
+
if ( $i > 8 ) {
|
53 |
+
break;
|
54 |
+
} else {
|
55 |
+
|
56 |
+
// get our timezone offset so we
|
57 |
+
// can return the proper time to the user
|
58 |
+
$timezone_offset = get_option('gmt_offset');
|
59 |
+
|
60 |
+
// decide if the row should be even or odd
|
61 |
+
// used for zebra striping the table
|
62 |
+
if ( $i % 2 == 0 ) {
|
63 |
+
echo '<tr class="chatter-table-row chatter-content-row alternate">';
|
64 |
+
} else {
|
65 |
+
echo '<tr class="chatter-table-row chatter-content-row">';
|
66 |
+
}
|
67 |
+
// set up the date and time variables
|
68 |
+
$update_time_explode = explode( ' ', $chatter['update_time'] );
|
69 |
+
$date = $update_time_explode[0];
|
70 |
+
$time = $update_time_explode[1];
|
71 |
+
$time_explode = explode( ":" , $time );
|
72 |
+
$time = ( $time_explode[0] + $timezone_offset ).":".$time_explode[1];
|
73 |
+
|
74 |
+
// get the type of action that was recorded
|
75 |
+
$type = explode( ':' , $chatter['type']);
|
76 |
+
|
77 |
+
// set up the image based on the chatter type
|
78 |
+
// Known Possibilities Include -
|
79 |
+
// lists:new-subscriber, lists:unsubscribes, lists:profile-updates, campaigns:facebook-likes,
|
80 |
+
// campaigns:facebook-comments, campaigns:forward-to-friend, lists:imports, or campaigns:inbox-inspections
|
81 |
+
if ( $type[1] == 'new-subscriber' ) {
|
82 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/subscriber-added.png' . '" alt="New User Subscribed" class="chimp-chatter-image" />';
|
83 |
+
} else if ( $type[1] == 'unsubscribes' ) {
|
84 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/subscriber-removed.png' . '" alt="User Unsubscribed" class="chimp-chatter-image" />';
|
85 |
+
} else if ( $type[1] == 'profile-updates' ) {
|
86 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/profile-updated.png' . '" alt="Profile Updated" class="chimp-chatter-image" />';
|
87 |
+
} else if ( $type[1] == 'facebook-likes' ) {
|
88 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/facebook-like.png' . '" alt="Facebook Like" class="chimp-chatter-image" />';
|
89 |
+
} else if ( $type[1] == 'facebook-comments' ) {
|
90 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/facebook-comment.png' . '" alt="Facebook Comment" class="chimp-chatter-image" />';
|
91 |
+
} else if ( $type[1] == 'forward-to-friend' ) {
|
92 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/forward-to-friend.png' . '" alt="Forward To Friend" class="chimp-chatter-image" />';
|
93 |
+
} else if ( $type[1] == 'imports' ) {
|
94 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/import.png' . '" alt="Imports" class="chimp-chatter-image" />';
|
95 |
+
} else if ( $type[1] == 'inbox-inspections' ) {
|
96 |
+
$type_image = '<img src="' . plugins_url().'/yikes-inc-easy-mailchimp-extender/images/ChimpChatter/inbox-inspection.png' . '" alt="Inbox Inspection" class="chimp-chatter-image" />';
|
97 |
+
}
|
98 |
+
|
99 |
+
// get and store the returned message
|
100 |
+
// split the message at ' - ' , which will
|
101 |
+
// separate the title and messages into two strings
|
102 |
+
$message = explode( ' - ' , $chatter['message'] );
|
103 |
+
$message_title = $message[0];
|
104 |
+
$message_content = $message[1];
|
105 |
+
// visual representation of user action
|
106 |
+
echo '<td>'.$type_image . '</td>';
|
107 |
+
// date user subscribed
|
108 |
+
echo '<td><b>'.date("M d", strtotime($date)).'</b><br /><em>'.date( 'g:i a', strtotime($time) ).'</em></td>';
|
109 |
+
// message title of action taken
|
110 |
+
echo '<td class="chimp-chatter-message"><strong class="chimp-chatter-message-title">'.$message_title.'</strong>';
|
111 |
+
echo '</tr>';
|
112 |
+
|
113 |
+
}
|
114 |
+
$i++;
|
115 |
+
}
|
116 |
+
} else {
|
117 |
+
?>
|
118 |
+
<tr>
|
119 |
+
<td style="width:100%;text-align:center !important;">
|
120 |
+
<h2 class="no_data_found" style="font-size:1.25em;font-style:italic;"><?php _e( "No recent account activity. Check back again later." , "yikes-inc-easy-mailchimp-extender" ); ?></h2>
|
121 |
+
</td>
|
122 |
+
</tr>
|
123 |
+
<?php
|
124 |
+
}
|
125 |
+
?>
|
126 |
+
</tbody>
|
127 |
+
</table>
|
128 |
</div>
|
templates/shortcode_form.php
CHANGED
@@ -1,3 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<script type="text/javascript">
|
2 |
$ymce = jQuery.noConflict();
|
3 |
jQuery(document).ready(function($ymce){
|
@@ -24,40 +35,44 @@ $ymce = jQuery.noConflict();
|
|
24 |
}
|
25 |
return (err > 0 ? false : true);
|
26 |
}
|
27 |
-
$ymce(
|
28 |
-
|
29 |
-
// it shouldn't be here :)
|
30 |
-
// maybe include a checkbox and give the user
|
31 |
-
// an option if they'd like to display it or not?
|
32 |
-
<?php
|
33 |
-
/* not sure this is needed anymore
|
34 |
-
if( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'sharedaddy' ) ) {
|
35 |
-
remove_filter( 'the_content', 'sharing_display', 19 );
|
36 |
-
}
|
37 |
-
*/
|
38 |
-
?>
|
39 |
var singleOptinMessage = '<?php echo str_replace( '\'' , '"' , preg_replace('/\r?\n/', '\\n', apply_filters('yks_mc_content' , $this->optionVal['single-optin-message']))); ?>';
|
40 |
var doubleOptinMessage = '<?php echo str_replace( '\'' , '"' , preg_replace('/\r?\n/', '\\n', apply_filters('yks_mc_content' , $this->optionVal['double-optin-message']))); ?>';
|
41 |
var optinValue = '<?php echo $this->optionVal['optin']; ?>';
|
|
|
42 |
e.preventDefault();
|
43 |
// Make sure the api key exists
|
44 |
if(blankFieldCheck("<?php echo $list['id']; ?>"))
|
45 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
$ymce('#ykfmc-submit_<?php echo $list['id']; ?>').attr('disabled', 'disabled');
|
47 |
$ymce('#yks-status-<?php echo $list['id']; ?>').slideUp('fast');
|
48 |
$ymce.ajax({
|
49 |
type: 'POST',
|
50 |
url: '<?php echo YKSEME_URL_WP_AJAX; ?>',
|
51 |
data: {
|
52 |
-
action: '
|
53 |
form_action: 'frontend_submit_form',
|
54 |
-
form_data:
|
55 |
},
|
56 |
dataType: 'text',
|
57 |
success: function(MAILCHIMP)
|
58 |
{
|
59 |
if( MAILCHIMP.trim() == 1 )
|
60 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
// custom message based on opt-in settings value
|
62 |
// single opt-in
|
63 |
if ( optinValue == 'false' ) {
|
@@ -65,9 +80,32 @@ $ymce = jQuery.noConflict();
|
|
65 |
} else { // double opt-in
|
66 |
$ymce('#yks-status-<?php echo $list['id']; ?>').html('<div class="yks-success"><p>'+doubleOptinMessage+'</p></div>');
|
67 |
}
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
} else {
|
72 |
// bundle the MailChimp returned error
|
73 |
// with our yks mc error messages
|
@@ -75,6 +113,12 @@ $ymce = jQuery.noConflict();
|
|
75 |
jQuery(this).remove();
|
76 |
});
|
77 |
$ymce('#ykfmc-submit_<?php echo $list['id']; ?>').removeAttr('disabled');
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
$ymce('#yks-mailchimp-form_<?php echo $list['id']; ?>').prepend('<span id="yks_form_error_message">'+MAILCHIMP+'</span>').delay(1000).queue(function(next){
|
79 |
jQuery('#yks_form_error_message').fadeIn();
|
80 |
var offset_top = jQuery('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').offset().top;
|
@@ -87,19 +131,169 @@ $ymce = jQuery.noConflict();
|
|
87 |
}
|
88 |
return false;
|
89 |
});
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
$ymce('#ui-datepicker-div').addClass('yks-mailchimpFormDatepickerContainer');
|
|
|
97 |
});
|
98 |
</script>
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
|
102 |
-
<div class="yks-mailchimpFormContainer">
|
103 |
<div class="yks-status" id="yks-status-<?php echo $list['id']; ?>"></div>
|
104 |
|
105 |
<?php
|
@@ -112,22 +306,16 @@ $ymce = jQuery.noConflict();
|
|
112 |
$form_id = explode('-', $list['id']);
|
113 |
do_action( 'yks_mc_before_form_'.$form_id[1] );
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
<?php echo $this->getFrontendFormDisplay($list, $submit_text); ?>
|
126 |
-
</form>
|
127 |
-
</div>
|
128 |
-
|
129 |
-
<?php
|
130 |
-
|
131 |
// custom action to print text after ALL forms
|
132 |
do_action("yks_mc_after_all_forms");
|
133 |
|
1 |
+
<?php if ( !is_admin() ) {
|
2 |
+
|
3 |
+
// custom action hooks to enqueue
|
4 |
+
// styles and scripts, only on
|
5 |
+
// pages where are forms are being display
|
6 |
+
// ( performance ehancement :} )
|
7 |
+
do_action( 'yks_mc_enqueue_styles' );
|
8 |
+
do_action( 'yks_mc_enqueue_scripts' );
|
9 |
+
|
10 |
+
?>
|
11 |
+
|
12 |
<script type="text/javascript">
|
13 |
$ymce = jQuery.noConflict();
|
14 |
jQuery(document).ready(function($ymce){
|
35 |
}
|
36 |
return (err > 0 ? false : true);
|
37 |
}
|
38 |
+
$ymce('#yks-mailchimp-form_<?php echo $list['id']; ?>').submit(function(e){
|
39 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
var singleOptinMessage = '<?php echo str_replace( '\'' , '"' , preg_replace('/\r?\n/', '\\n', apply_filters('yks_mc_content' , $this->optionVal['single-optin-message']))); ?>';
|
41 |
var doubleOptinMessage = '<?php echo str_replace( '\'' , '"' , preg_replace('/\r?\n/', '\\n', apply_filters('yks_mc_content' , $this->optionVal['double-optin-message']))); ?>';
|
42 |
var optinValue = '<?php echo $this->optionVal['optin']; ?>';
|
43 |
+
|
44 |
e.preventDefault();
|
45 |
// Make sure the api key exists
|
46 |
if(blankFieldCheck("<?php echo $list['id']; ?>"))
|
47 |
{
|
48 |
+
var form_data = $ymce(this).serialize();
|
49 |
+
// disabel all input fields while the data send...
|
50 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( 'input' ).each(function() {
|
51 |
+
$ymce(this).attr('disabled','disabled').css('opacity','.8');
|
52 |
+
});
|
53 |
+
|
54 |
$ymce('#ykfmc-submit_<?php echo $list['id']; ?>').attr('disabled', 'disabled');
|
55 |
$ymce('#yks-status-<?php echo $list['id']; ?>').slideUp('fast');
|
56 |
$ymce.ajax({
|
57 |
type: 'POST',
|
58 |
url: '<?php echo YKSEME_URL_WP_AJAX; ?>',
|
59 |
data: {
|
60 |
+
action: 'yks_mailchimp_form_submit',
|
61 |
form_action: 'frontend_submit_form',
|
62 |
+
form_data: form_data,
|
63 |
},
|
64 |
dataType: 'text',
|
65 |
success: function(MAILCHIMP)
|
66 |
{
|
67 |
if( MAILCHIMP.trim() == 1 )
|
68 |
{
|
69 |
+
|
70 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').children().each(function() {
|
71 |
+
$ymce(this).not('#wrapper').removeAttr( 'disabled' ).css( 'opacity' , '1' );
|
72 |
+
|
73 |
+
});
|
74 |
+
|
75 |
+
|
76 |
// custom message based on opt-in settings value
|
77 |
// single opt-in
|
78 |
if ( optinValue == 'false' ) {
|
80 |
} else { // double opt-in
|
81 |
$ymce('#yks-status-<?php echo $list['id']; ?>').html('<div class="yks-success"><p>'+doubleOptinMessage+'</p></div>');
|
82 |
}
|
83 |
+
|
84 |
+
/** Header Call Out Submission **/
|
85 |
+
if ( $ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').hasClass( 'header-callout-form' ) ) {
|
86 |
+
|
87 |
+
var container_height = $ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).css( 'height' );
|
88 |
+
var container_width = $ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).css( 'width' );
|
89 |
+
var top_margin_confirmation = ( container_height.replace( 'px' , '' , container_height ) - 25 ) / 2;
|
90 |
+
|
91 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).css( 'height' , container_height ).css( 'width' , container_width );
|
92 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).children().each(function() {
|
93 |
+
$ymce(this).fadeOut('fast');
|
94 |
+
}).promise().done( function() {
|
95 |
+
var confirmation_message = $ymce('#yks-status-<?php echo $list['id']; ?>');
|
96 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).html( confirmation_message );
|
97 |
+
$ymce( confirmation_message ).removeClass('yks-status').fadeIn('fast').attr( 'style' , 'text-align:center;vertical-align:middle;margin-top:19%;');
|
98 |
+
});
|
99 |
+
|
100 |
+
|
101 |
+
} else {
|
102 |
+
|
103 |
+
/* old sliding confirmations */
|
104 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').slideUp('fast', function(){
|
105 |
+
$ymce('#yks-status-<?php echo $list['id']; ?>').slideDown('fast');
|
106 |
+
});
|
107 |
+
|
108 |
+
}
|
109 |
} else {
|
110 |
// bundle the MailChimp returned error
|
111 |
// with our yks mc error messages
|
113 |
jQuery(this).remove();
|
114 |
});
|
115 |
$ymce('#ykfmc-submit_<?php echo $list['id']; ?>').removeAttr('disabled');
|
116 |
+
|
117 |
+
// remove disable from all input fields while the data send...
|
118 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( 'input' ).each(function() {
|
119 |
+
$ymce(this).removeAttr( 'disabled' ).css('opacity','1');
|
120 |
+
});
|
121 |
+
|
122 |
$ymce('#yks-mailchimp-form_<?php echo $list['id']; ?>').prepend('<span id="yks_form_error_message">'+MAILCHIMP+'</span>').delay(1000).queue(function(next){
|
123 |
jQuery('#yks_form_error_message').fadeIn();
|
124 |
var offset_top = jQuery('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').offset().top;
|
131 |
}
|
132 |
return false;
|
133 |
});
|
134 |
+
|
135 |
+
/* user updates information for a given form */
|
136 |
+
$ymce('body').on( 'click' , '.update-user-info' , function(e) {
|
137 |
+
|
138 |
+
var singleOptinMessage = '<?php echo str_replace( '\'' , '"' , preg_replace('/\r?\n/', '\\n', apply_filters('yks_mc_content' , $this->optionVal['single-optin-message']))); ?>';
|
139 |
+
var doubleOptinMessage = '<?php echo str_replace( '\'' , '"' , preg_replace('/\r?\n/', '\\n', apply_filters('yks_mc_content' , $this->optionVal['double-optin-message']))); ?>';
|
140 |
+
var optinValue = '<?php echo $this->optionVal['optin']; ?>';
|
141 |
+
|
142 |
+
e.preventDefault();
|
143 |
+
// Make sure the api key exists
|
144 |
+
if( blankFieldCheck("<?php echo $list['id']; ?>") )
|
145 |
+
{
|
146 |
+
var form_data = $ymce(this).parents('#yks-mailchimp-form_<?php echo $list['id']; ?>').serialize();
|
147 |
+
// disable all input fields while the data send...
|
148 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( 'input' ).each(function() {
|
149 |
+
$ymce(this).attr('disabled','disabled').css('opacity','.8');
|
150 |
+
});
|
151 |
+
|
152 |
+
$ymce('#ykfmc-submit_<?php echo $list['id']; ?>').attr('disabled', 'disabled');
|
153 |
+
$ymce('#yks-status-<?php echo $list['id']; ?>').slideUp('fast');
|
154 |
+
$ymce.ajax({
|
155 |
+
type: 'POST',
|
156 |
+
url: '<?php echo YKSEME_URL_WP_AJAX; ?>',
|
157 |
+
data: {
|
158 |
+
action: 'yks_mailchimp_form_submit',
|
159 |
+
form_action: 'frontend_resubmit_form_data',
|
160 |
+
form_data: form_data
|
161 |
+
},
|
162 |
+
dataType: 'text',
|
163 |
+
success: function(MAILCHIMP)
|
164 |
+
{
|
165 |
+
if( MAILCHIMP.trim() == 1 )
|
166 |
+
{
|
167 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').children().each(function() {
|
168 |
+
$ymce(this).not('#wrapper').removeAttr( 'disabled' ).css( 'opacity' , '1' );
|
169 |
+
});
|
170 |
+
|
171 |
+
|
172 |
+
// custom message based on opt-in settings value
|
173 |
+
// single opt-in
|
174 |
+
if ( optinValue == 'false' ) {
|
175 |
+
$ymce('#yks-status-<?php echo $list['id']; ?>').html("<div class='yks-success'><p><?php echo apply_filters( 'yikes_mc_subscriber_update_message' , 'Thanks, your information has been successfuly updated.' , 10 ); ?></p></div>");
|
176 |
+
} else { // double opt-in
|
177 |
+
$ymce('#yks-status-<?php echo $list['id']; ?>').html("<div class='yks-success'><p><?php echo apply_filters( 'yikes_mc_subscriber_update_message' , 'Thanks, your information has been successfuly updated.' , 10 ); ?></p></div>");
|
178 |
+
}
|
179 |
+
|
180 |
+
/** Header Call Out Submission **/
|
181 |
+
if ( $ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').hasClass( 'header-callout-form' ) ) {
|
182 |
+
|
183 |
+
var container_height = $ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).css( 'height' );
|
184 |
+
var container_width = $ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).css( 'width' );
|
185 |
+
var top_margin_confirmation = ( container_height.replace( 'px' , '' , container_height ) - 25 ) / 2;
|
186 |
+
|
187 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).css( 'height' , container_height ).css( 'width' , container_width );
|
188 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).children().each(function() {
|
189 |
+
$ymce(this).fadeOut('fast');
|
190 |
+
}).promise().done( function() {
|
191 |
+
var confirmation_message = $ymce('#yks-status-<?php echo $list['id']; ?>');
|
192 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( '#wrapper' ).html( confirmation_message );
|
193 |
+
$ymce( confirmation_message ).removeClass('yks-status').fadeIn('fast').attr( 'style' , 'text-align:center;vertical-align:middle;margin-top:19%;');
|
194 |
+
});
|
195 |
+
|
196 |
+
|
197 |
+
} else {
|
198 |
+
|
199 |
+
/* old sliding confirmations */
|
200 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').slideUp('fast', function(){
|
201 |
+
$ymce('#yks-status-<?php echo $list['id']; ?>').slideDown('fast');
|
202 |
+
});
|
203 |
+
|
204 |
+
}
|
205 |
+
} else {
|
206 |
+
// bundle the MailChimp returned error
|
207 |
+
// with our yks mc error messages
|
208 |
+
$ymce('#yks_form_error_message').fadeOut('fast', function() {
|
209 |
+
jQuery(this).remove();
|
210 |
+
});
|
211 |
+
$ymce('#ykfmc-submit_<?php echo $list['id']; ?>').removeAttr('disabled');
|
212 |
+
|
213 |
+
// remove disable from all input fields while the data send...
|
214 |
+
$ymce('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').find( 'input' ).each(function() {
|
215 |
+
$ymce(this).removeAttr( 'disabled' ).css('opacity','1');
|
216 |
+
});
|
217 |
+
|
218 |
+
$ymce('#yks-mailchimp-form_<?php echo $list['id']; ?>').prepend('<span id="yks_form_error_message">'+MAILCHIMP+'</span>').delay(1000).queue(function(next){
|
219 |
+
jQuery('#yks_form_error_message').fadeIn();
|
220 |
+
var offset_top = jQuery('#yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>').offset().top;
|
221 |
+
jQuery("html, body").animate({ scrollTop: offset_top - 50 }, 500 );
|
222 |
+
next();
|
223 |
+
});
|
224 |
+
}
|
225 |
+
}
|
226 |
+
});
|
227 |
+
}
|
228 |
+
return false;
|
229 |
});
|
230 |
+
|
231 |
+
<?php // enqueue jQuery datepicker only when the user has specified to do so
|
232 |
+
if( isset( $this->optionVal['yks-mailchimp-jquery-datepicker'] ) && $this->optionVal['yks-mailchimp-jquery-datepicker'] == '1' ) { ?>
|
233 |
+
$ymce('.yks-field-type-date').datepicker({
|
234 |
+
changeMonth: true,
|
235 |
+
changeYear: true,
|
236 |
+
yearRange: ((new Date).getFullYear()-100)+':'+((new Date).getFullYear()),
|
237 |
+
dateFormat: 'yy-mm-dd'
|
238 |
+
});
|
239 |
$ymce('#ui-datepicker-div').addClass('yks-mailchimpFormDatepickerContainer');
|
240 |
+
<?php } ?>
|
241 |
});
|
242 |
</script>
|
243 |
|
244 |
+
<?php } else { // prevent the form from submitting inside the preview window ?>
|
245 |
+
<script>
|
246 |
+
jQuery(document).ready(function() {
|
247 |
+
jQuery('form[name="yks-mailchimp-form"]').submit(function() {
|
248 |
+
console.log('false');
|
249 |
+
return false;
|
250 |
+
});
|
251 |
+
});
|
252 |
+
</script>
|
253 |
+
<?php }
|
254 |
+
// set up and store our custom style values
|
255 |
+
if ( isset( $list['custom_styles'] ) && $list['custom_styles']['active'] == '1' ) {
|
256 |
+
$form_id = $list['id'];
|
257 |
+
?>
|
258 |
+
<style>
|
259 |
+
#ykfmc-submit_<?php echo $form_id; ?> {
|
260 |
+
background: <?php echo $list['custom_styles']['yks_mc_submit_button_color']; ?>;
|
261 |
+
color: <?php echo $list['custom_styles']['yks_mc_submit_button_text_color']; ?>;
|
262 |
+
}
|
263 |
+
.yks-mailchimpFormContainer-<?php echo $form_id; ?> {
|
264 |
+
background: <?php echo $list['custom_styles']['yks_mc_form_background_color']; ?>;
|
265 |
+
padding: <?php echo $list['custom_styles']['yks_mc_form_padding'].$list['custom_styles']['yks_mc_form_padding_measurement']; ?>;
|
266 |
+
color: <?php echo $list['custom_styles']['yks_mc_form_text_color']; ?>;
|
267 |
+
width: <?php echo $list['custom_styles']['yks_mc_form_width']; ?>;
|
268 |
+
<?php
|
269 |
+
if ( $list['custom_styles']['yks_mc_form_alignment'] == 'left' ) {
|
270 |
+
?>
|
271 |
+
display: block;
|
272 |
+
float: left;
|
273 |
+
<?php
|
274 |
+
} elseif ( $list['custom_styles']['yks_mc_form_alignment'] == 'center' ) {
|
275 |
+
?>
|
276 |
+
display: block;
|
277 |
+
margin: 0 auto;
|
278 |
+
float: none;
|
279 |
+
<?php
|
280 |
+
} elseif ( $list['custom_styles']['yks_mc_form_alignment'] == 'right' ) {
|
281 |
+
?>
|
282 |
+
display: block;
|
283 |
+
float: right;
|
284 |
+
<?php
|
285 |
+
}
|
286 |
+
?>
|
287 |
+
}
|
288 |
+
.yks-mailchimpFormDivRowLabel, .yks_mc_interest_group_label {
|
289 |
+
color: <?php echo $list['custom_styles']['yks_mc_form_text_color']; ?>;
|
290 |
+
}
|
291 |
+
</style>
|
292 |
+
<?php
|
293 |
+
}
|
294 |
+
?>
|
295 |
+
<div class="yks-mailchimpFormContainer yks-mailchimpFormContainer-<?php echo $list['id']; ?>">
|
296 |
|
|
|
|
|
297 |
<div class="yks-status" id="yks-status-<?php echo $list['id']; ?>"></div>
|
298 |
|
299 |
<?php
|
306 |
$form_id = explode('-', $list['id']);
|
307 |
do_action( 'yks_mc_before_form_'.$form_id[1] );
|
308 |
|
309 |
+
|
310 |
+
// load our custom MailChimp template here!
|
311 |
+
if ( isset( $list['custom_template'] ) && $list['custom_template']['active'] == 1 ) {
|
312 |
+
// Custom List form
|
313 |
+
include $list['custom_template']['template_file'];
|
314 |
+
} else {
|
315 |
+
// include the form template
|
316 |
+
include YKSEME_PATH.'templates/form_template.php';
|
317 |
+
}
|
318 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
// custom action to print text after ALL forms
|
320 |
do_action("yks_mc_after_all_forms");
|
321 |
|
templates/yikes-mailchimp-bundled-templates/Clean_Blue/clean_blue_form.css
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Template: yks_mc_form_template_1 ( Bundled Template #1 )
|
3 |
+
Description : This is the .css file associated with the above template. This file gets loaded when using the above
|
4 |
+
template to display a custom opt-in form for YIKES Inc. Easy MailChimp Extender.
|
5 |
+
Author : YIKES Inc.
|
6 |
+
Author Contact : http://www.yikesinc.com
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
.clean-blue input {
|
11 |
+
outline: none;
|
12 |
+
width: 100% !important;;
|
13 |
+
}
|
14 |
+
|
15 |
+
.clean-blue #wrapper {
|
16 |
+
width: 100%;
|
17 |
+
height: 100%;
|
18 |
+
margin: 0 auto;
|
19 |
+
}
|
20 |
+
|
21 |
+
.clean-blue .widget_yikes_mc_widget input, .clean-blue .widget_yikes_mc_widget .yks-mailchimpFormDivRowField {
|
22 |
+
padding: 0;
|
23 |
+
}
|
24 |
+
|
25 |
+
.clean-blue > #box {
|
26 |
+
background-color: #fff;
|
27 |
+
margin: 0 auto;
|
28 |
+
-webkit-border-radius: 4px;
|
29 |
+
-o-border-radius: 4px;
|
30 |
+
-moz-border-radius: 4px;
|
31 |
+
border-radius: 3px;
|
32 |
+
padding: 25px 20px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.clean-blue #top_header {
|
36 |
+
width: 100%;
|
37 |
+
margin: 0;
|
38 |
+
}
|
39 |
+
|
40 |
+
.clean-blue #top_header > h3 {
|
41 |
+
text-align: center;
|
42 |
+
font-family: 'Lato', sans-serif;
|
43 |
+
font-size: 32px;
|
44 |
+
font-weight: 800;
|
45 |
+
color: #378DE5;
|
46 |
+
-webkit-text-stroke: 0.5px;
|
47 |
+
margin: 0;
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
.clean-blue #top_header > h5 {
|
52 |
+
text-align: center;
|
53 |
+
font-family: 'Roboto', sans-serif;
|
54 |
+
font-size: 15px;
|
55 |
+
font-weight: 300;
|
56 |
+
color: #378DE5;
|
57 |
+
line-height: 1.6;
|
58 |
+
margin: 0;
|
59 |
+
padding: 15px 0;
|
60 |
+
color: #555;
|
61 |
+
-webkit-text-stroke: 0.2px;
|
62 |
+
}
|
63 |
+
|
64 |
+
.clean-blue input[type=text], .clean-blue input[type=password], .clean-blue input[type=submit] {
|
65 |
+
width: 300px;
|
66 |
+
height: 55px;
|
67 |
+
position: relative;
|
68 |
+
margin: 0 auto;
|
69 |
+
display: block;
|
70 |
+
margin-bottom: -10px;
|
71 |
+
padding: 15px;
|
72 |
+
box-sizing: border-box;
|
73 |
+
-webkit-text-stroke: 0.1px;
|
74 |
+
margin-bottom: .5em;
|
75 |
+
}
|
76 |
+
|
77 |
+
.clean-blue input[type=text], .clean-blue input[type=password] {
|
78 |
+
font-family: 'Lato', sans-serif;
|
79 |
+
font-weight: 300;
|
80 |
+
font-size:16px;
|
81 |
+
border: thin solid #ccc;
|
82 |
+
border-radius: 5px;
|
83 |
+
color: #378DE5;
|
84 |
+
}
|
85 |
+
|
86 |
+
.clean-blue input[type=text]:focus, .clean-blue input[type=password]:focus {
|
87 |
+
border: thin solid #378DE5;
|
88 |
+
-webkit-transition: all .4s ease;
|
89 |
+
-moz-transition: all .4s ease;
|
90 |
+
-o-transition: all .4s ease;
|
91 |
+
transition: all .4s ease;
|
92 |
+
}
|
93 |
+
|
94 |
+
.clean-blue input[type=text]:focus, .clean-blue input[type=password]:focus {
|
95 |
+
border-left: thin solid #378DE5;
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
.clean-blue .ykfmc-submit {
|
100 |
+
color: #378DE5 !important;
|
101 |
+
background: #fff !important;
|
102 |
+
border: 1px solid #378DE5 !important;
|
103 |
+
box-shadow: none !important;
|
104 |
+
border-radius: 5px !important;
|
105 |
+
font-family: 'Roboto', sans-serif !important;
|
106 |
+
font-weight: 300 !important;
|
107 |
+
font-size: 16px !important;
|
108 |
+
transition: all .3s ease !important;
|
109 |
+
margin-top: 0px !important;
|
110 |
+
cursor: pointer !important;
|
111 |
+
}
|
112 |
+
|
113 |
+
.clean-blue .ykfmc-submit:hover {
|
114 |
+
background: #378DE5 !important;
|
115 |
+
color: #fff !important;
|
116 |
+
}
|
117 |
+
|
118 |
+
.clean-blue #bottom {
|
119 |
+
width: 300px;
|
120 |
+
margin: 0 auto;
|
121 |
+
margin-top: 15px;
|
122 |
+
}
|
123 |
+
|
124 |
+
.clean-blue a {
|
125 |
+
text-decoration: none;
|
126 |
+
color: #282828;
|
127 |
+
font-size: 13px;
|
128 |
+
font-family: 'Roboto', sans-serif;
|
129 |
+
font-weight: 300;
|
130 |
+
transition: color .3s ease;
|
131 |
+
outline: none;
|
132 |
+
}
|
133 |
+
|
134 |
+
.clean-blue a:hover {
|
135 |
+
color: #1eb056;
|
136 |
+
}
|
137 |
+
|
138 |
+
.clean-blue .right_a {
|
139 |
+
float: right;
|
140 |
+
}
|
141 |
+
|
142 |
+
.clean-blue .disclaimer {
|
143 |
+
text-align: center;
|
144 |
+
font-style: italic;
|
145 |
+
color: rgba(51, 51, 51, 0.56);
|
146 |
+
}
|
147 |
+
|
148 |
+
|
149 |
+
|
150 |
+
/***
|
151 |
+
Radio/Checkbox Button Styles
|
152 |
+
- Uses sprite sheet for look and feel
|
153 |
+
***/
|
154 |
+
.clean-blue input[type="checkbox"] {
|
155 |
+
display:none;
|
156 |
+
}
|
157 |
+
.clean-blue input[type="checkbox"] + span {
|
158 |
+
display:inline-block;
|
159 |
+
width:18px;
|
160 |
+
height:18px;
|
161 |
+
margin:-1px 4px 0 0;
|
162 |
+
vertical-align:middle;
|
163 |
+
background:url("../images/check_radio_sheet_blue.png") left top no-repeat;
|
164 |
+
cursor:pointer;
|
165 |
+
}
|
166 |
+
.clean-blue input[type="checkbox"]:checked + span {
|
167 |
+
background:url("../images/check_radio_sheet_blue.png") -19px top no-repeat;
|
168 |
+
}
|
169 |
+
|
170 |
+
.clean-blue input[type="radio"] {
|
171 |
+
display:none;
|
172 |
+
}
|
173 |
+
.clean-blue input[type="radio"] + span {
|
174 |
+
display:inline-block;
|
175 |
+
width:18px;
|
176 |
+
height:18px;
|
177 |
+
margin:-1px 4px 0 0;
|
178 |
+
vertical-align:middle;
|
179 |
+
background:url("../images/check_radio_sheet_blue.png") -39px top no-repeat;
|
180 |
+
cursor:pointer;
|
181 |
+
}
|
182 |
+
.clean-blue input[type="radio"]:checked + span {
|
183 |
+
background:url("../images/check_radio_sheet_blue.png") -58px top no-repeat;
|
184 |
+
}
|
185 |
+
|
186 |
+
/***
|
187 |
+
Select Dropdown Styles
|
188 |
+
***/
|
189 |
+
.clean-blue select, .clean-blue select:active {
|
190 |
+
cursor: pointer;
|
191 |
+
background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='50px' height='50px'><polyline points='46.139,15.518 25.166,36.49 4.193,15.519'/></svg>");
|
192 |
+
background-color: transparent !important;
|
193 |
+
background-repeat:no-repeat;
|
194 |
+
background-position: right 10px top 15px;
|
195 |
+
background-size: 16px 16px;
|
196 |
+
color: #3498DB;
|
197 |
+
padding:12px;
|
198 |
+
font-family:arial,tahoma;
|
199 |
+
font-size:16px;
|
200 |
+
font-weight:bold;
|
201 |
+
color: #378DE5;
|
202 |
+
text-align:center;
|
203 |
+
text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
|
204 |
+
border-radius:3px;
|
205 |
+
-webkit-border-radius:3px;
|
206 |
+
-webkit-appearance: none;
|
207 |
+
-webkit-transition:0.3s ease all;
|
208 |
+
-moz-transition:0.3s ease all;
|
209 |
+
-ms-transition:0.3s ease all;
|
210 |
+
-o-transition:0.3s ease all;
|
211 |
+
transition:0.3s ease all;
|
212 |
+
border: thin solid #378DE5;
|
213 |
+
}
|
214 |
+
|
215 |
+
.clean-blue select:hover {
|
216 |
+
cursor: pointer;
|
217 |
+
background-color:#3498DB;
|
218 |
+
color: #fff;
|
219 |
+
}
|
templates/yikes-mailchimp-bundled-templates/Clean_Blue/clean_blue_template.jpg
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Clean_Blue/clean_blue_template.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* YIKES Inc. MailChimp Template: Clean Blue
|
4 |
+
* YIKES Inc. MailChimp Template Author: YIKES Inc.
|
5 |
+
* YIKES Inc. MailChimp Template Description: YIKES Inc Bundled Template. Clean blue layout.
|
6 |
+
*/
|
7 |
+
|
8 |
+
// enqueue the associated styles for this template
|
9 |
+
wp_enqueue_style( 'clean_blue_optin_styles' , YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/Clean_Blue/clean_blue_form.css' );
|
10 |
+
|
11 |
+
?>
|
12 |
+
|
13 |
+
<!-- Form Template -->
|
14 |
+
<div class="yks-mailchimpFormContainerInner clean-blue" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
15 |
+
<div id="wrapper">
|
16 |
+
<div id="box">
|
17 |
+
|
18 |
+
<div id="top_header">
|
19 |
+
<h3>Sign Up Now!</h3>
|
20 |
+
<h5>Sign up for our super awesome mailing list.</h5>
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" class="yiks-mailchimp-custom-form" rel="<?php echo $list['id']; ?>">
|
24 |
+
<input type="hidden" name="yks-mailchimp-list-ct" id="yks-mailchimp-list-ct_<?php echo $list['id']; ?>" value="<?php echo $listCt; ?>" />
|
25 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
26 |
+
<?php
|
27 |
+
/* Generate The Form Fields **/
|
28 |
+
echo $this->getFrontendFormDisplay_placeholder_labels($list, $submit_text);
|
29 |
+
?>
|
30 |
+
|
31 |
+
<p class="disclaimer">We promise never to share or sell any of your personal information.</p>
|
32 |
+
|
33 |
+
</form>
|
34 |
+
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
</div>
|
templates/yikes-mailchimp-bundled-templates/Clean_Blue/images/check_radio_sheet_blue.png
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/clean_green_with_icons.css
ADDED
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Template: yks_mc_form_template_1 ( Bundled Template #1 )
|
3 |
+
Description : This is the .css file associated with the above template. This file gets loaded when using the above
|
4 |
+
template to display a custom opt-in form for YIKES Inc. Easy MailChimp Extender.
|
5 |
+
Author : YIKES Inc.
|
6 |
+
Author Contact : http://www.yikesinc.com
|
7 |
+
*/
|
8 |
+
|
9 |
+
.optin-form-icons-example input {
|
10 |
+
outline: none;
|
11 |
+
margin-bottom: .5em !important;
|
12 |
+
color: #00B200 !important;
|
13 |
+
width: 100% !important;
|
14 |
+
}
|
15 |
+
|
16 |
+
.optin-form-icons-example #wrapper {
|
17 |
+
width: 100%;
|
18 |
+
height: 100%;
|
19 |
+
margin: 0 auto;
|
20 |
+
}
|
21 |
+
|
22 |
+
.optin-form-icons-example .yks-mailchimpFormDivRowField {
|
23 |
+
padding: 0 !important;
|
24 |
+
}
|
25 |
+
|
26 |
+
.optin-form-icons-example > #box {
|
27 |
+
background-color: #fff;
|
28 |
+
margin: 0 auto;
|
29 |
+
-webkit-border-radius: 4px;
|
30 |
+
-o-border-radius: 4px;
|
31 |
+
-moz-border-radius: 4px;
|
32 |
+
border-radius: 3px;
|
33 |
+
padding: 25px 20px;
|
34 |
+
}
|
35 |
+
|
36 |
+
.optin-form-icons-example #top_header {
|
37 |
+
width: 100%;
|
38 |
+
margin: 0;
|
39 |
+
}
|
40 |
+
|
41 |
+
.optin-form-icons-example #top_header > h3 {
|
42 |
+
text-align: center;
|
43 |
+
font-family: 'Lato', sans-serif;
|
44 |
+
font-size: 25px;
|
45 |
+
font-weight: 800;
|
46 |
+
color: #00B200;
|
47 |
+
-webkit-text-stroke: 0.5px;
|
48 |
+
margin: 0;
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
.optin-form-icons-example #top_header > h5 {
|
53 |
+
text-align: center;
|
54 |
+
font-family: 'Roboto', sans-serif;
|
55 |
+
font-size: 15px;
|
56 |
+
font-weight: 300;
|
57 |
+
line-height: 1.6;
|
58 |
+
margin: 0;
|
59 |
+
padding: 15px 0;
|
60 |
+
color: #555;
|
61 |
+
-webkit-text-stroke: 0.2px;
|
62 |
+
}
|
63 |
+
|
64 |
+
.optin-form-icons-example input[type=text], .optin-form-icons-example input[type=password], .optin-form-icons-example input[type=submit] {
|
65 |
+
width: 300px;
|
66 |
+
height: 55px;
|
67 |
+
position: relative;
|
68 |
+
margin: 0 auto;
|
69 |
+
display: block;
|
70 |
+
margin-bottom: -10px;
|
71 |
+
padding: 15px;
|
72 |
+
box-sizing: border-box;
|
73 |
+
-webkit-text-stroke: 0.1px;
|
74 |
+
}
|
75 |
+
|
76 |
+
.optin-form-icons-example input[type=text], .optin-form-icons-example input[type=password] {
|
77 |
+
font-family: 'Lato', sans-serif;
|
78 |
+
font-weight: 300;
|
79 |
+
font-size:16px;
|
80 |
+
border: thin solid #ccc;
|
81 |
+
border-radius: 5px;
|
82 |
+
}
|
83 |
+
|
84 |
+
.optin-form-icons-example input[type=text]:focus, .optin-form-icons-example input[type=password]:focus {
|
85 |
+
border: thin solid #00B200;
|
86 |
+
-webkit-transition: all .4s ease;
|
87 |
+
-moz-transition: all .4s ease;
|
88 |
+
-o-transition: all .4s ease;
|
89 |
+
transition: all .4s ease;
|
90 |
+
}
|
91 |
+
|
92 |
+
.optin-form-icons-example input[type=text]:focus, .optin-form-icons-example input[type=password]:focus {
|
93 |
+
border-left: thin solid #00B200;
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
.optin-form-icons-example .ykfmc-submit {
|
98 |
+
color: #333 !important;
|
99 |
+
background: transparent !important;
|
100 |
+
border: 1px solid #00B200 !important;
|
101 |
+
box-shadow: none !important;
|
102 |
+
border-radius: 5px !important;
|
103 |
+
font-family: 'Roboto', sans-serif !important;
|
104 |
+
font-weight: 300 !important;
|
105 |
+
font-size: 16px !important;
|
106 |
+
transition: all .3s ease !important;
|
107 |
+
margin-top: 0px !important;
|
108 |
+
cursor: pointer !important;
|
109 |
+
}
|
110 |
+
|
111 |
+
.optin-form-icons-example .ykfmc-submit:hover {
|
112 |
+
background-color: #00B200 !important;
|
113 |
+
color: #fff !important;
|
114 |
+
}
|
115 |
+
|
116 |
+
.optin-form-icons-example #bottom {
|
117 |
+
width: 300px;
|
118 |
+
margin: 0 auto;
|
119 |
+
margin-top: 15px;
|
120 |
+
}
|
121 |
+
|
122 |
+
.optin-form-icons-example a {
|
123 |
+
text-decoration: none;
|
124 |
+
color: #282828;
|
125 |
+
font-size: 13px;
|
126 |
+
font-family: 'Roboto', sans-serif;
|
127 |
+
font-weight: 300;
|
128 |
+
transition: color .3s ease;
|
129 |
+
outline: none;
|
130 |
+
}
|
131 |
+
|
132 |
+
.optin-form-icons-example a:hover {
|
133 |
+
color: #1eb056;
|
134 |
+
}
|
135 |
+
|
136 |
+
.optin-form-icons-example .right_a {
|
137 |
+
float: right;
|
138 |
+
}
|
139 |
+
|
140 |
+
.optin-form-icons-example .disclaimer {
|
141 |
+
text-align: center;
|
142 |
+
font-style: italic;
|
143 |
+
color: rgba(51, 51, 51, 0.56);
|
144 |
+
}
|
145 |
+
|
146 |
+
/* Center Label Names
|
147 |
+
-- Useful for the Address Field where each input field is used for a different field ,
|
148 |
+
and we can't assign placeholders for each
|
149 |
+
*/
|
150 |
+
.optin-form-icons-example .yks-mailchimp-form-tooltip {
|
151 |
+
text-align: center;
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
|
156 |
+
/* Icons
|
157 |
+
* based on input class names
|
158 |
+
* using *= (class name contains...)
|
159 |
+
|
160 |
+
** NOTE **
|
161 |
+
The class selectors below are using the merge variable set up within MailChimp
|
162 |
+
You can view the associated merge field value inside of the Manage List Forms page
|
163 |
+
Once you have the merge field name, you can then assign icons very easily
|
164 |
+
|
165 |
+
- rinse and repeat for each field you'd like to assign an icon too
|
166 |
+
*/
|
167 |
+
|
168 |
+
/**
|
169 |
+
Email Field
|
170 |
+
- Merge field will always return EMAIL
|
171 |
+
**/
|
172 |
+
.optin-form-icons-example input[class*=EMAIL] {
|
173 |
+
background-image: url("./images/mail.png");
|
174 |
+
background-repeat: no-repeat;
|
175 |
+
background-position: left center;
|
176 |
+
background-position-x: 15px;
|
177 |
+
background-size: 20px;
|
178 |
+
padding-top: 18px !important;
|
179 |
+
padding-left: 45px !important;
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
First Name/Last Name Field
|
184 |
+
- I set up my first name field to have the FNAME merge field name
|
185 |
+
- I set up my last name field to have the LNAME merge field name
|
186 |
+
**/
|
187 |
+
.optin-form-icons-example input[class*=FNAME], .optin-form-icons-example input[class*=LNAME], .optin-form-icons-example input[class*=NAME] {
|
188 |
+
background-image: url("./images/pen.png");
|
189 |
+
background-repeat: no-repeat;
|
190 |
+
background-position: left center;
|
191 |
+
background-position-x: 15px;
|
192 |
+
background-size: 20px;
|
193 |
+
padding-top: 18px !important;
|
194 |
+
padding-left: 45px !important;
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
Date Field
|
199 |
+
- I set up my date field to have the DDATE merge field name ( DATE is reserved by MailChimp )
|
200 |
+
**/
|
201 |
+
.optin-form-icons-example input[class*=DDATE] {
|
202 |
+
background-image: url("./images/calendar.png");
|
203 |
+
background-repeat: no-repeat;
|
204 |
+
background-position: left center;
|
205 |
+
background-position-x: 15px;
|
206 |
+
background-size: 20px;
|
207 |
+
padding-top: 18px !important;
|
208 |
+
padding-left: 45px !important;
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
Address Field
|
213 |
+
- I set up my address field to have the ADDR merge field name
|
214 |
+
**/
|
215 |
+
.optin-form-icons-example input[class*=ADDR] {
|
216 |
+
background-image: url("./images/home.png");
|
217 |
+
background-repeat: no-repeat;
|
218 |
+
background-position: left center;
|
219 |
+
background-position-x: 15px;
|
220 |
+
background-size: 20px;
|
221 |
+
padding-top: 18px !important;
|
222 |
+
padding-left: 45px !important;
|
223 |
+
}
|
224 |
+
|
225 |
+
|
226 |
+
|
227 |
+
/***
|
228 |
+
Radio/Checkbox Button Styles
|
229 |
+
- Uses sprite sheet for look and feel
|
230 |
+
***/
|
231 |
+
.optin-form-icons-example input[type="checkbox"] {
|
232 |
+
display:none;
|
233 |
+
}
|
234 |
+
.optin-form-icons-example input[type="checkbox"] + span {
|
235 |
+
display:inline-block;
|
236 |
+
width:18px;
|
237 |
+
height:18px;
|
238 |
+
margin:-1px 4px 0 0;
|
239 |
+
vertical-align:middle;
|
240 |
+
background:url("./images/check_radio_sheet_green.png") left top no-repeat;
|
241 |
+
cursor:pointer;
|
242 |
+
}
|
243 |
+
.optin-form-icons-example input[type="checkbox"]:checked + span {
|
244 |
+
background:url("./images/check_radio_sheet_green.png") -19px top no-repeat;
|
245 |
+
}
|
246 |
+
|
247 |
+
.optin-form-icons-example input[type="radio"] {
|
248 |
+
display:none;
|
249 |
+
}
|
250 |
+
.optin-form-icons-example input[type="radio"] + span {
|
251 |
+
display:inline-block;
|
252 |
+
width:18px;
|
253 |
+
height:18px;
|
254 |
+
margin:-1px 4px 0 0;
|
255 |
+
vertical-align:middle;
|
256 |
+
background:url("./images/check_radio_sheet_green.png") -39px top no-repeat;
|
257 |
+
cursor:pointer;
|
258 |
+
}
|
259 |
+
.optin-form-icons-example input[type="radio"]:checked + span {
|
260 |
+
background:url("./images/check_radio_sheet_green.png") -58px top no-repeat;
|
261 |
+
}
|
262 |
+
|
263 |
+
|
264 |
+
/***
|
265 |
+
Select Dropdown Styles
|
266 |
+
***/
|
267 |
+
.optin-form-icons-example select, .optin-form-icons-example select:active {
|
268 |
+
cursor: pointer;
|
269 |
+
background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='50px' height='50px'><polyline points='46.139,15.518 25.166,36.49 4.193,15.519'/></svg>");
|
270 |
+
background-color: transparent;
|
271 |
+
background-repeat:no-repeat;
|
272 |
+
background-position: right 10px top 15px;
|
273 |
+
background-size: 16px 16px;
|
274 |
+
color: #00B200;
|
275 |
+
padding:12px;
|
276 |
+
font-family:arial,tahoma;
|
277 |
+
font-size:16px;
|
278 |
+
font-weight:bold;
|
279 |
+
color: #00B200;
|
280 |
+
text-align:center;
|
281 |
+
text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
|
282 |
+
border-radius:3px;
|
283 |
+
-webkit-border-radius:3px;
|
284 |
+
-webkit-appearance: none;
|
285 |
+
-webkit-transition:0.3s ease all;
|
286 |
+
-moz-transition:0.3s ease all;
|
287 |
+
-ms-transition:0.3s ease all;
|
288 |
+
-o-transition:0.3s ease all;
|
289 |
+
transition:0.3s ease all;
|
290 |
+
border: thin solid #00B200;
|
291 |
+
}
|
292 |
+
|
293 |
+
.optin-form-icons-example select:hover {
|
294 |
+
cursor: pointer;
|
295 |
+
background-color:#00B200;
|
296 |
+
color: #fff;
|
297 |
+
}
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/clean_green_with_icons_template.jpg
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/clean_green_with_icons_template.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* YIKES Inc. MailChimp Template: Clean Green (with icons)
|
4 |
+
* YIKES Inc. MailChimp Template Author: YIKES Inc.
|
5 |
+
* YIKES Inc. MailChimp Template Description: YIKES Inc Bundled Template - Optin Form With Icons Example.
|
6 |
+
*/
|
7 |
+
|
8 |
+
// enqueue the associated styles for this template
|
9 |
+
wp_enqueue_style( 'optin_with_icons_example_css' , YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/clean_green_with_icons.css' );
|
10 |
+
|
11 |
+
?>
|
12 |
+
|
13 |
+
<!-- Form Template -->
|
14 |
+
<div class="yks-mailchimpFormContainerInner optin-form-icons-example" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
15 |
+
<div id="wrapper">
|
16 |
+
<div id="box">
|
17 |
+
|
18 |
+
<div id="top_header">
|
19 |
+
<h3><?php _e( "Join Our Mailing List!" , "yikes-inc-easy-mailchimp-extender" ); ?></h3>
|
20 |
+
<h5><?php _e( "Sign up for our mailing list below!" , "yikes-inc-easy-mailchimp-extender" ); ?></h5>
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" class="yiks-mailchimp-custom-form" rel="<?php echo $list['id']; ?>">
|
24 |
+
<input type="hidden" name="yks-mailchimp-list-ct" id="yks-mailchimp-list-ct_<?php echo $list['id']; ?>" value="<?php echo $listCt; ?>" />
|
25 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
26 |
+
<?php
|
27 |
+
/* Generate The Form Fields **/
|
28 |
+
echo $this->getFrontendFormDisplay_placeholder_labels($list, $submit_text);
|
29 |
+
?>
|
30 |
+
|
31 |
+
</form>
|
32 |
+
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
</div>
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/calendar.png
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/check_radio_sheet_green.png
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/home.png
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/mail.png
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Clean_Green_(with_icons)/images/pen.png
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/header_optin_template_city_skyline.css
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Template: Header Optin Variant 2 - City Skyline ( Bundled Template #4 )
|
3 |
+
Description : This is the .css file associated with the above template. This file gets loaded when using the above
|
4 |
+
template to display a custom opt-in form for YIKES Inc. Easy MailChimp Extender.
|
5 |
+
Author : YIKES Inc.
|
6 |
+
Author Contact : http://www.yikesinc.com
|
7 |
+
*/
|
8 |
+
|
9 |
+
/* Container **/
|
10 |
+
.large-optin-template {
|
11 |
+
background: url("./images/city_skyline.jpg");
|
12 |
+
background-size: cover;
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
.large-optin-template {
|
17 |
+
display: inline-block;
|
18 |
+
width: 100%;
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
/** Font Declerations **/
|
23 |
+
.large-optin-template h4 {
|
24 |
+
font-size: 20px;
|
25 |
+
margin: 0;
|
26 |
+
color: rgba(248, 248, 248, 0.90);
|
27 |
+
text-align: center;
|
28 |
+
}
|
29 |
+
|
30 |
+
.large-optin-template h3 {
|
31 |
+
text-align:center;
|
32 |
+
margin: 0;
|
33 |
+
font-size: 30px;
|
34 |
+
color: #FECB00;
|
35 |
+
}
|
36 |
+
|
37 |
+
.large-optin-template p {
|
38 |
+
font-size: 17px;
|
39 |
+
margin: auto;
|
40 |
+
color: #8DB8C0;
|
41 |
+
}
|
42 |
+
|
43 |
+
.large-optin-template p.disclaimer {
|
44 |
+
font-size: 14px;
|
45 |
+
}
|
46 |
+
|
47 |
+
/** Submit Button **/
|
48 |
+
.ykfmc-submit {
|
49 |
+
border:none !important;
|
50 |
+
display:block;
|
51 |
+
margin:0 auto;
|
52 |
+
}
|
53 |
+
|
54 |
+
/** Error + Confirmation Messages **/
|
55 |
+
#yks_form_error_message {
|
56 |
+
color: #fefefe;
|
57 |
+
margin-bottom: 0;
|
58 |
+
}
|
59 |
+
|
60 |
+
.large-optin-template #wrapper {
|
61 |
+
display: table;
|
62 |
+
max-width: 30%;
|
63 |
+
min-width: 225px;
|
64 |
+
margin-left: 15%;
|
65 |
+
background: rgba(60, 58, 58, 0.66);
|
66 |
+
border-radius: 5px;
|
67 |
+
margin-top: 5.5em;
|
68 |
+
margin-bottom: 5.5em;
|
69 |
+
padding: 1em;
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
/* Right Container */
|
74 |
+
.large-optin-template #box {
|
75 |
+
float: center;
|
76 |
+
max-width: 100%;
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
/** When the wrapper is within the content, let's center #wrapper element **/
|
82 |
+
.entry-content .large-optin-template #wrapper {
|
83 |
+
max-width: 75%;
|
84 |
+
display:block;
|
85 |
+
margin: 0 auto;
|
86 |
+
margin-top: 2em;
|
87 |
+
margin-bottom: 2.5em;
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
/** Break Point **/
|
93 |
+
|
94 |
+
/* When the screen is 800px or smaller, we'll center the #wrapper element **/
|
95 |
+
@media only screen and (max-width: 800px) {
|
96 |
+
|
97 |
+
.large-optin-template #wrapper {
|
98 |
+
max-width: 75%;
|
99 |
+
display:block;
|
100 |
+
margin: 0 auto;
|
101 |
+
margin-top: 2em;
|
102 |
+
margin-bottom: 2.5em;
|
103 |
+
}
|
104 |
+
|
105 |
+
}
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/header_optin_template_city_skyline.jpg
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/header_optin_template_city_skyline.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* YIKES Inc. MailChimp Template: Header Optin - City Skyline
|
4 |
+
* YIKES Inc. MailChimp Template Author: YIKES Inc.
|
5 |
+
* YIKES Inc. MailChimp Template Description: YIKES Inc Bundled Template. Large optin template with a nice singapore city skyline. Great for use in site headers or for large call out areas.
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
// enqueue the associated styles for this template
|
10 |
+
wp_enqueue_style( 'big_optin_form_styles' , YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/header_optin_template_city_skyline.css' );
|
11 |
+
|
12 |
+
?>
|
13 |
+
|
14 |
+
<!--
|
15 |
+
|
16 |
+
*** Note ***
|
17 |
+
Currently, there are two styles of data submission. The standard sliding reveal, used in all forms.
|
18 |
+
The new reveal is for ALL forms that are used in full width headers.
|
19 |
+
To use the new fadeout/fadin confirmation message your parent div MUST contain the class header-callout-form
|
20 |
+
|
21 |
+
Without the header-callout-form class, the sliding confirmation message will be used
|
22 |
+
|
23 |
+
When using the new confirmation reveal, you MUST also include the <div id="wrapper"></div> element which is
|
24 |
+
used to populate the confirmation on submission
|
25 |
+
-->
|
26 |
+
|
27 |
+
|
28 |
+
<!-- Form Template -->
|
29 |
+
<div class="yks-mailchimpFormContainerInner large-optin-template header-callout-form" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
30 |
+
|
31 |
+
<div id="wrapper">
|
32 |
+
|
33 |
+
<div id="box">
|
34 |
+
|
35 |
+
<div id="top_header">
|
36 |
+
<h3><?php _e( "Sign Up Now!" , "yikes-inc-easy-mailchimp-extender" ); ?></h3>
|
37 |
+
<h4><?php _e( "Receive updates directly to your inbox, daily!" , "yikes-inc-easy-mailchimp-extender" ); ?></h4>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" class="yiks-mailchimp-custom-form" rel="<?php echo $list['id']; ?>">
|
41 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
42 |
+
<?php
|
43 |
+
/* Generate The Form Fields **/
|
44 |
+
echo $this->getFrontendFormDisplay_placeholder_labels($list, $submit_text);
|
45 |
+
?>
|
46 |
+
|
47 |
+
<p class="disclaimer"><em><?php _e( "We promise never to share or sell any of your personal information with anyone." , "yikes-inc-easy-mailchimp-extender" ); ?></em></p>
|
48 |
+
|
49 |
+
</form>
|
50 |
+
|
51 |
+
</div>
|
52 |
+
|
53 |
+
|
54 |
+
</div>
|
55 |
+
|
56 |
+
</div>
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_City_Skyline/images/city_skyline.jpg
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/header_optin_form_sub_header_bar.css
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Template: Header Optin Variant 2 - Sub Header Bar ( Bundled Template #4 )
|
3 |
+
Description : This is the .css file associated with the above template. This file gets loaded when using the above
|
4 |
+
template to display a custom opt-in form for YIKES Inc. Easy MailChimp Extender.
|
5 |
+
Author : YIKES Inc.
|
6 |
+
Author Contact : http://www.yikesinc.com
|
7 |
+
*/
|
8 |
+
|
9 |
+
/* Container **/
|
10 |
+
.large-optin-template {
|
11 |
+
background: url("./images/simple_dashed.png");
|
12 |
+
background-repeat: repeat;
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
.large-optin-template {
|
17 |
+
display: inline-block;
|
18 |
+
width: 100%;
|
19 |
+
}
|
20 |
+
|
21 |
+
.callout-text {
|
22 |
+
float: left;
|
23 |
+
line-height:2;
|
24 |
+
margin-right: 1em;
|
25 |
+
}
|
26 |
+
|
27 |
+
/** Font Declerations **/
|
28 |
+
.large-optin-template h4 {
|
29 |
+
font-size: 20px;
|
30 |
+
margin: 0;
|
31 |
+
color: rgba(248, 248, 248, 0.90);
|
32 |
+
text-align: center;
|
33 |
+
line-height: 2;
|
34 |
+
}
|
35 |
+
|
36 |
+
.large-optin-template h3 {
|
37 |
+
text-align:center;
|
38 |
+
margin: 0;
|
39 |
+
font-size: 30px;
|
40 |
+
color: #FECB00;
|
41 |
+
}
|
42 |
+
|
43 |
+
.large-optin-template p {
|
44 |
+
font-size: 17px;
|
45 |
+
margin: auto;
|
46 |
+
color: #8DB8C0;
|
47 |
+
}
|
48 |
+
|
49 |
+
/** Submit Button **/
|
50 |
+
.ykfmc-submit, .yks-mailchimpFormDivSubmit {
|
51 |
+
border:none !important;
|
52 |
+
float: left !important;
|
53 |
+
width: auto !important;
|
54 |
+
margin-top: 0 !important;
|
55 |
+
margin-left: 5px !important;
|
56 |
+
}
|
57 |
+
|
58 |
+
.yks-require {
|
59 |
+
float: left;
|
60 |
+
width: 300px !important;
|
61 |
+
}
|
62 |
+
|
63 |
+
/** Error + Confirmation Messages **/
|
64 |
+
#yks_form_error_message {
|
65 |
+
color: #fefefe;
|
66 |
+
margin-bottom: 0;
|
67 |
+
}
|
68 |
+
|
69 |
+
.large-optin-template #wrapper {
|
70 |
+
width:645px;
|
71 |
+
display: block;
|
72 |
+
margin: 0 auto;
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
/* Right Container */
|
77 |
+
.large-optin-template #box {
|
78 |
+
float: center;
|
79 |
+
max-width: 100%;
|
80 |
+
height:45px;
|
81 |
+
margin: 1em 0;
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
/** When the wrapper is within the content, let's center #wrapper element **/
|
87 |
+
.entry-content .large-optin-template #wrapper {
|
88 |
+
max-width: 100%;
|
89 |
+
display:block;
|
90 |
+
margin: 0 auto;
|
91 |
+
margin-top: 2em;
|
92 |
+
margin-bottom: 2.5em;
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
/** Break Point **/
|
98 |
+
|
99 |
+
/* When the screen is 800px or smaller, we'll center the #wrapper element **/
|
100 |
+
@media only screen and (max-width: 800px) {
|
101 |
+
|
102 |
+
.large-optin-template #wrapper {
|
103 |
+
max-width: 100%;
|
104 |
+
display:block;
|
105 |
+
margin: 0 auto;
|
106 |
+
margin-top: 2em;
|
107 |
+
margin-bottom: 2.5em;
|
108 |
+
}
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
@media only screen and (max-width: 635px) {
|
113 |
+
|
114 |
+
.large-optin-template #wrapper {
|
115 |
+
max-width: 65%;
|
116 |
+
display:block;
|
117 |
+
margin: 0 auto;
|
118 |
+
margin-top: 2em;
|
119 |
+
margin-bottom: 2.5em;
|
120 |
+
}
|
121 |
+
|
122 |
+
.yks-mailchimpFormDivRowField input {
|
123 |
+
width: 100% !important;
|
124 |
+
}
|
125 |
+
|
126 |
+
.ykfmc-submit, .yks-mailchimpFormDivSubmit {
|
127 |
+
margin-left: 30% !important;
|
128 |
+
margin-top: .25em !important;
|
129 |
+
margin-bottom: 1em !important;
|
130 |
+
}
|
131 |
+
|
132 |
+
.callout-text h4, .callout-text {
|
133 |
+
width: 100%;
|
134 |
+
text-align:center;
|
135 |
+
}
|
136 |
+
|
137 |
+
}
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/header_optin_form_sub_header_bar.jpg
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/header_optin_form_sub_header_bar.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* YIKES Inc. MailChimp Template: Header Optin - Sub Header Bar
|
4 |
+
* YIKES Inc. MailChimp Template Author: YIKES Inc.
|
5 |
+
* YIKES Inc. MailChimp Template Description: YIKES Inc Bundled Template. Wide optin call out, best placed just below the header.
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
// enqueue the associated styles for this template
|
10 |
+
wp_enqueue_style( 'big_optin_form_styles' , YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/header_optin_form_sub_header_bar.css' );
|
11 |
+
|
12 |
+
?>
|
13 |
+
|
14 |
+
<!--
|
15 |
+
|
16 |
+
*** Note ***
|
17 |
+
Currently, there are two styles of data submission. The standard sliding reveal, used in all forms.
|
18 |
+
The new reveal is for ALL forms that are used in full width headers.
|
19 |
+
To use the new fadeout/fadin confirmation message your parent div MUST contain the class header-callout-form
|
20 |
+
|
21 |
+
Without the header-callout-form class, the sliding confirmation message will be used
|
22 |
+
|
23 |
+
When using the new confirmation reveal, you MUST also include the <div id="wrapper"></div> element which is
|
24 |
+
used to populate the confirmation on submission
|
25 |
+
-->
|
26 |
+
|
27 |
+
|
28 |
+
<!-- Form Template -->
|
29 |
+
<div class="yks-mailchimpFormContainerInner large-optin-template header-callout-form" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
30 |
+
|
31 |
+
<div id="wrapper">
|
32 |
+
|
33 |
+
<div id="box">
|
34 |
+
|
35 |
+
<span class="callout-text"><h4>Newsletter Signup</h4></span>
|
36 |
+
|
37 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" class="yiks-mailchimp-custom-form" rel="<?php echo $list['id']; ?>">
|
38 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
39 |
+
<?php
|
40 |
+
/* Generate The Form Fields **/
|
41 |
+
echo $this->getFrontendFormDisplay_placeholder_labels($list, $submit_text);
|
42 |
+
?>
|
43 |
+
|
44 |
+
</form>
|
45 |
+
|
46 |
+
</div>
|
47 |
+
|
48 |
+
|
49 |
+
</div>
|
50 |
+
|
51 |
+
</div>
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Sub_Header_Bar/images/simple_dashed.png
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/header_optin_template_vacation.css
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Template: yks_mc_form_template_1 ( Bundled Template #1 )
|
3 |
+
Description : This is the .css file associated with the above template. This file gets loaded when using the above
|
4 |
+
template to display a custom opt-in form for YIKES Inc. Easy MailChimp Extender.
|
5 |
+
Author : YIKES Inc.
|
6 |
+
Author Contact : http://www.yikesinc.com
|
7 |
+
*/
|
8 |
+
|
9 |
+
/* Container **/
|
10 |
+
.large-optin-template {
|
11 |
+
background: url("./images/island_background.jpg");
|
12 |
+
background-size: cover;
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
.large-optin-template {
|
17 |
+
display: inline-block;
|
18 |
+
width: 100%;
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
/** Font Declerations **/
|
23 |
+
.large-optin-template h2 {
|
24 |
+
font-size: 2em;
|
25 |
+
margin: .5em 0;
|
26 |
+
}
|
27 |
+
|
28 |
+
.large-optin-template h3 {
|
29 |
+
font-size: 1.5em;
|
30 |
+
margin: .5em 0;
|
31 |
+
}
|
32 |
+
|
33 |
+
.large-optin-template p {
|
34 |
+
font-size: 17px;
|
35 |
+
margin: auto;
|
36 |
+
}
|
37 |
+
|
38 |
+
.large-optin-template p.disclaimer {
|
39 |
+
font-size: 14px;
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
.large-optin-template #wrapper {
|
45 |
+
display: table;
|
46 |
+
max-width: 70%;
|
47 |
+
margin: 0 auto;
|
48 |
+
background: rgba(255, 255, 255, 0.8);
|
49 |
+
border-radius: 5px;
|
50 |
+
margin-top: 2.5em;
|
51 |
+
margin-bottom: 2.5em;
|
52 |
+
padding: 1em;
|
53 |
+
}
|
54 |
+
|
55 |
+
/* Left Container */
|
56 |
+
.large-optin-template #large-callout-information {
|
57 |
+
float: left;
|
58 |
+
max-width: 48.5%;
|
59 |
+
}
|
60 |
+
|
61 |
+
/* Left Container List */
|
62 |
+
.large-optin-template #large-callout-information ul {
|
63 |
+
list-style: none;
|
64 |
+
margin-left: 1em;
|
65 |
+
margin-top: 2em;
|
66 |
+
padding-left: 0;
|
67 |
+
}
|
68 |
+
|
69 |
+
.large-optin-template #large-callout-information ul li {
|
70 |
+
margin-top: 1em;
|
71 |
+
}
|
72 |
+
|
73 |
+
.large-optin-template #large-callout-information ul li:before {
|
74 |
+
font-family: "dashicons";
|
75 |
+
content: "\f147";
|
76 |
+
float:left;
|
77 |
+
margin-right: .5em;
|
78 |
+
padding-top: .15em;
|
79 |
+
color: green;
|
80 |
+
}
|
81 |
+
|
82 |
+
/* Right Container */
|
83 |
+
.large-optin-template #box {
|
84 |
+
float: right;
|
85 |
+
max-width: 48.5%;
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
@media only screen and (max-width: 525px) {
|
90 |
+
|
91 |
+
/* Left Container */
|
92 |
+
.large-optin-template #large-callout-information {
|
93 |
+
float: none;
|
94 |
+
max-width: 100%;
|
95 |
+
}
|
96 |
+
|
97 |
+
/* Right Container */
|
98 |
+
.large-optin-template #box {
|
99 |
+
float: none;
|
100 |
+
max-width: 100%;
|
101 |
+
}
|
102 |
+
|
103 |
+
}
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/header_optin_template_vacation.jpg
ADDED
Binary file
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/header_optin_template_vacation.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* YIKES Inc. MailChimp Template: Header Optin - Vacation
|
4 |
+
* YIKES Inc. MailChimp Template Author: YIKES Inc.
|
5 |
+
* YIKES Inc. MailChimp Template Description: YIKES Inc Bundled Template. Large optin template. Great for use in site headers or for large call out areas.
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
// enqueue the associated styles for this template
|
10 |
+
wp_enqueue_style( 'big_optin_form_styles' , YKSEME_URL . 'templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/header_optin_form.css' );
|
11 |
+
|
12 |
+
?>
|
13 |
+
|
14 |
+
<!--
|
15 |
+
|
16 |
+
*** Note ***
|
17 |
+
Currently, there are two styles of data submission. The standard sliding reveal, used in all forms.
|
18 |
+
The new reveal is for ALL forms that are used in full width headers.
|
19 |
+
To use the new fadeout/fadin confirmation message your parent div MUST contain the class header-callout-form
|
20 |
+
|
21 |
+
Without the header-callout-form class, the sliding confirmation message will be used
|
22 |
+
|
23 |
+
When using the new confirmation reveal, you MUST also include the <div id="wrapper"></div> element which is
|
24 |
+
used to populate the confirmation on submission
|
25 |
+
-->
|
26 |
+
|
27 |
+
|
28 |
+
<!-- Form Template -->
|
29 |
+
<div class="yks-mailchimpFormContainerInner large-optin-template header-callout-form" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
30 |
+
|
31 |
+
<div id="wrapper">
|
32 |
+
|
33 |
+
<div id="large-callout-information">
|
34 |
+
<h2><?php _e( "I'll Teach You FREE, How You Can..." , "yikes-inc-easy-mailchimp-extender" ); ?></h2>
|
35 |
+
<ul>
|
36 |
+
<li><p><?php _e( "Achieve your fitness level in no time!" , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
|
37 |
+
<li><p><?php _e( "Grow in a healthy manner" , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
|
38 |
+
<li><p><?php _e( "Enjoy whatever foods you want, and still lose weight!" , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
|
39 |
+
<li><p><?php _e( "Create a workout routine that works for you" , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
|
40 |
+
<li><p><?php _e( "See results faster than ever before" , "yikes-inc-easy-mailchimp-extender" ); ?></p></li>
|
41 |
+
</ul>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
|
45 |
+
<div id="box">
|
46 |
+
|
47 |
+
<div id="top_header">
|
48 |
+
<h3><?php _e( "Sign Up Now!" , "yikes-inc-easy-mailchimp-extender" ); ?></h3>
|
49 |
+
<h4><?php _e( "Sign up for our super awesome mailing list." , "yikes-inc-easy-mailchimp-extender" ); ?></h4>
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" class="yiks-mailchimp-custom-form" rel="<?php echo $list['id']; ?>">
|
53 |
+
<input type="hidden" name="yks-mailchimp-list-ct" id="yks-mailchimp-list-ct_<?php echo $list['id']; ?>" value="<?php echo $listCt; ?>" />
|
54 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
55 |
+
<?php
|
56 |
+
/* Generate The Form Fields **/
|
57 |
+
echo $this->getFrontendFormDisplay_placeholder_labels($list, $submit_text);
|
58 |
+
?>
|
59 |
+
|
60 |
+
<p class="disclaimer"><em><?php _e( "We promise never to share or sell any of your personal information with anyone." , "yikes-inc-easy-mailchimp-extender" ); ?></em></p>
|
61 |
+
|
62 |
+
</form>
|
63 |
+
|
64 |
+
</div>
|
65 |
+
|
66 |
+
|
67 |
+
</div>
|
68 |
+
|
69 |
+
</div>
|
templates/yikes-mailchimp-bundled-templates/Header_Optin_-_Vacation/images/island_background.jpg
ADDED
Binary file
|
templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Header/custom_header_template_boilerplate.css
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Template: Custom Template Boilerplate
|
3 |
+
Description : This is the .css file associated with the above template. This file gets loaded when using the above
|
4 |
+
template to display a custom opt-in form for YIKES Inc. Easy MailChimp Extender.
|
5 |
+
Author : YIKES Inc.
|
6 |
+
Author Contact : http://www.yikesinc.com
|
7 |
+
*/
|
8 |
+
|
9 |
+
/*************************************************************************************************************************/
|
10 |
+
|
11 |
+
|
12 |
+
/* Container **/
|
13 |
+
.large-optin-template {
|
14 |
+
background: rgba(140, 221, 239, 0.62) url("./images/square_bg.png");
|
15 |
+
background-repeat: repeat;
|
16 |
+
}
|
17 |
+
|
18 |
+
|
19 |
+
.large-optin-template {
|
20 |
+
display: inline-block;
|
21 |
+
width: 100%;
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
/** Font Declerations **/
|
26 |
+
.large-optin-template h4 {
|
27 |
+
font-size: 20px;
|
28 |
+
margin: 0;
|
29 |
+
color: rgba(248, 248, 248, 0.90);
|
30 |
+
text-align: center;
|
31 |
+
}
|
32 |
+
|
33 |
+
.large-optin-template h3 {
|
34 |
+
text-align:center;
|
35 |
+
margin: 0;
|
36 |
+
font-size: 30px;
|
37 |
+
color:#fff;
|
38 |
+
display: block;
|
39 |
+
font-family: 'Helvetica Neue',Helvetica, sans-serif;
|
40 |
+
font-weight:bold;
|
41 |
+
text-shadow: 0px 0px 2px #686868,
|
42 |
+
0px 1px 1px #ddd,
|
43 |
+
0px 2px 1px #d6d6d6,
|
44 |
+
0px 3px 1px #ccc,
|
45 |
+
0px 4px 1px #c5c5c5,
|
46 |
+
0px 5px 1px #c1c1c1,
|
47 |
+
0px 6px 1px #bbb,
|
48 |
+
0px 7px 1px #777,
|
49 |
+
0px 8px 3px rgba(100, 100, 100, 0.4),
|
50 |
+
0px 9px 5px rgba(100, 100, 100, 0.1),
|
51 |
+
0px 10px 7px rgba(100, 100, 100, 0.15),
|
52 |
+
0px 11px 9px rgba(100, 100, 100, 0.2),
|
53 |
+
0px 12px 11px rgba(100, 100, 100, 0.25),
|
54 |
+
0px 13px 15px rgba(100, 100, 100, 0.3);
|
55 |
+
margin-top: -.25em;
|
56 |
+
margin-bottom: .25em;
|
57 |
+
}
|
58 |
+
|
59 |
+
.large-optin-template p {
|
60 |
+
font-size: 17px;
|
61 |
+
margin: auto;
|
62 |
+
color: #8DB8C0;
|
63 |
+
}
|
64 |
+
|
65 |
+
.large-optin-template p.disclaimer {
|
66 |
+
font-size: 14px;
|
67 |
+
}
|
68 |
+
|
69 |
+
/** Submit Button **/
|
70 |
+
.ykfmc-submit {
|
71 |
+
border:none !important;
|
72 |
+
display:block;
|
73 |
+
margin:0 auto;
|
74 |
+
}
|
75 |
+
|
76 |
+
/** Error + Confirmation Messages **/
|
77 |
+
#yks_form_error_message {
|
78 |
+
color: #fefefe;
|
79 |
+
margin-bottom: 0;
|
80 |
+
}
|
81 |
+
|
82 |
+
.large-optin-template #wrapper {
|
83 |
+
display: table;
|
84 |
+
max-width: 30%;
|
85 |
+
min-width: 225px;
|
86 |
+
margin-left: 15%;
|
87 |
+
background: rgba(60, 58, 58, 0.66);
|
88 |
+
border-radius: 5px;
|
89 |
+
margin-top: 5.5em;
|
90 |
+
margin-bottom: 5.5em;
|
91 |
+
padding: 1em;
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
/* Right Container */
|
96 |
+
.large-optin-template #box {
|
97 |
+
float: center;
|
98 |
+
max-width: 100%;
|
99 |
+
}
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
+
/** When the wrapper is within the content, let's center #wrapper element **/
|
104 |
+
.entry-content .large-optin-template #wrapper {
|
105 |
+
max-width: 75%;
|
106 |
+
display:block;
|
107 |
+
margin: 0 auto;
|
108 |
+
margin-top: 2em;
|
109 |
+
margin-bottom: 2.5em;
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
|
114 |
+
/** Break Point **/
|
115 |
+
|
116 |
+
/* When the screen is 800px or smaller, we'll center the #wrapper element **/
|
117 |
+
@media only screen and (max-width: 800px) {
|
118 |
+
|
119 |
+
.large-optin-template #wrapper {
|
120 |
+
max-width: 75%;
|
121 |
+
display:block;
|
122 |
+
margin: 0 auto;
|
123 |
+
margin-top: 2em;
|
124 |
+
margin-bottom: 2.5em;
|
125 |
+
}
|
126 |
+
|
127 |
+
}
|
templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Header/custom_header_template_boilerplate.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* YIKES Inc. MailChimp Template: Custom Header Template Boilerplate
|
4 |
+
* MailChimp Template Author: YIKES Inc.
|
5 |
+
* MailChimp Template Description: This is a starting template for users who would like to create their own custom optin templates,
|
6 |
+
specifically used within the header of your site. This template is great for full width pages, and header
|
7 |
+
callouts where the form extends full width within, or just below, the header.
|
8 |
+
|
9 |
+
Developer Notes :
|
10 |
+
DO NOT remove the $this->getFrontendFormDisplay($list, $submit_text) call. This is what generates all of your input forms based on MailChimp data.
|
11 |
+
Also, refrain from removing or altering any of the existing ID attributes as they are referenced by the JavaScript
|
12 |
+
Finally, DO NOT remove the class '
|
13 |
+
|
14 |
+
*/
|
15 |
+
|
16 |
+
// enqueue the associated styles for this template
|
17 |
+
// found in the same directory, inside of the styles folder
|
18 |
+
wp_enqueue_style( 'custom_template_boilerplate_css' , get_stylesheet_directory_uri() . '/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Header/custom_header_template_boilerplate.css' );
|
19 |
+
|
20 |
+
?>
|
21 |
+
<!--
|
22 |
+
|
23 |
+
*** Note ***
|
24 |
+
Currently, there are two styles of data submission. The standard sliding reveal, used in all forms.
|
25 |
+
The new reveal is for ALL forms that are used in full width headers.
|
26 |
+
To use the new fadeout/fadin confirmation message your parent div MUST contain the class header-callout-form
|
27 |
+
|
28 |
+
Without the header-callout-form class, the sliding confirmation message will be used
|
29 |
+
|
30 |
+
When using the new confirmation reveal, you MUST also include the <div id="wrapper"></div> element which is
|
31 |
+
used to populate the confirmation on submission
|
32 |
+
-->
|
33 |
+
|
34 |
+
|
35 |
+
<!-- Form Template -->
|
36 |
+
<div class="yks-mailchimpFormContainerInner large-optin-template header-callout-form" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
37 |
+
|
38 |
+
<div id="wrapper">
|
39 |
+
|
40 |
+
<div id="box">
|
41 |
+
|
42 |
+
<div id="top_header">
|
43 |
+
<h3><?php _e( "Sign Up Now!" , "yikes-inc-easy-mailchimp-extender" ); ?></h3>
|
44 |
+
<h4><?php _e( "Receive updates directly to your inbox, daily!" , "yikes-inc-easy-mailchimp-extender" ); ?></h4>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" class="yiks-mailchimp-custom-form" rel="<?php echo $list['id']; ?>">
|
48 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
49 |
+
<?php
|
50 |
+
/* Generate The Form Fields **/
|
51 |
+
echo $this->getFrontendFormDisplay_placeholder_labels($list, $submit_text);
|
52 |
+
?>
|
53 |
+
|
54 |
+
<p class="disclaimer"><em><?php _e( "We promise never to share or sell any of your personal information with anyone." , "yikes-inc-easy-mailchimp-extender" ); ?></em></p>
|
55 |
+
|
56 |
+
</form>
|
57 |
+
|
58 |
+
</div>
|
59 |
+
|
60 |
+
|
61 |
+
</div>
|
62 |
+
|
63 |
+
</div>
|
templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Header/images/square_bg.png
ADDED
Binary file
|
templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Standard/custom_template_boilerplate.css
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Template: Custom Template Boilerplate
|
3 |
+
Description : This is the .css file associated with the above template. This file gets loaded when using the above
|
4 |
+
template to display a custom opt-in form for YIKES Inc. Easy MailChimp Extender.
|
5 |
+
Author : YIKES Inc.
|
6 |
+
Author Contact : http://www.yikesinc.com
|
7 |
+
*/
|
8 |
+
|
9 |
+
/*************************************************************************************************************************/
|
10 |
+
|
11 |
+
|
12 |
+
/** All Form Inputs (including the submit button) **/
|
13 |
+
.custom_template_boilerplate input {
|
14 |
+
outline: none;
|
15 |
+
width: 100%;
|
16 |
+
}
|
17 |
+
|
18 |
+
/** Form Wrapper **/
|
19 |
+
.custom_template_boilerplate #wrapper {
|
20 |
+
width: 100%;
|
21 |
+
height: 100%;
|
22 |
+
margin: 0 auto;
|
23 |
+
}
|
24 |
+
|
25 |
+
/** Setting the field rows to padding 0 **/
|
26 |
+
.custom_template_boilerplate .widget_yikes_mc_widget input, .custom_template_boilerplate .widget_yikes_mc_widget .yks-mailchimpFormDivRowField {
|
27 |
+
padding: 0;
|
28 |
+
}
|
29 |
+
|
30 |
+
/** Box element within the #wrapper **/
|
31 |
+
.custom_template_boilerplate #box {
|
32 |
+
background-color: #fff;
|
33 |
+
margin: 0 auto;
|
34 |
+
-webkit-border-radius: 4px;
|
35 |
+
-o-border-radius: 4px;
|
36 |
+
-moz-border-radius: 4px;
|
37 |
+
border-radius: 3px;
|
38 |
+
}
|
39 |
+
|
40 |
+
/** Form Header - Sign Up Now! **/
|
41 |
+
.custom_template_boilerplate #top_header > h3 {
|
42 |
+
text-align: center;
|
43 |
+
font-family: sans-serif;
|
44 |
+
font-size: 32px;
|
45 |
+
font-weight: 800;
|
46 |
+
color: #e50000;
|
47 |
+
-webkit-text-stroke: 0.5px;
|
48 |
+
margin: 0;
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
/** Form Sub Header - Sign up for our mailing list.... **/
|
53 |
+
.custom_template_boilerplate #top_header > h5 {
|
54 |
+
text-align: center;
|
55 |
+
font-family: 'Roboto', sans-serif;
|
56 |
+
font-size: 15px;
|
57 |
+
font-weight: 300;
|
58 |
+
color: #e50000;
|
59 |
+
line-height: 1.6;
|
60 |
+
margin: 0;
|
61 |
+
padding: 15px 0;
|
62 |
+
color: #555;
|
63 |
+
-webkit-text-stroke: 0.2px;
|
64 |
+
}
|
65 |
+
|
66 |
+
/** Disclaimer Notice **/
|
67 |
+
.custom_template_boilerplate .disclaimer {
|
68 |
+
text-align: center;
|
69 |
+
font-style: italic;
|
70 |
+
color: rgba(51, 51, 51, 0.56);
|
71 |
+
}
|
templates/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Standard/custom_template_boilerplate.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* YIKES Inc. MailChimp Template: Custom Template Boilerplate
|
4 |
+
* MailChimp Template Author: YIKES Inc.
|
5 |
+
* MailChimp Template Description: This is a starting template for users who would like to create their own custom optin templates.
|
6 |
+
This boilerplate is good for widgets and forms placed within content. If you are looking to create
|
7 |
+
an optin form in the header, I would recommend using the custom_header_template_boilerplate.php
|
8 |
+
The file has been set up to easily customize for use in a header area. The confirmation message display
|
9 |
+
differs a bit as well.
|
10 |
+
|
11 |
+
|
12 |
+
Developer Notes :
|
13 |
+
DO NOT remove the $this->getFrontendFormDisplay($list, $submit_text) call. This is what generates all of your input forms based on MailChimp data.
|
14 |
+
Also, refrain from removing or altering any of the existing ID attributes as they are referenced by the JavaScript
|
15 |
+
|
16 |
+
*/
|
17 |
+
|
18 |
+
// enqueue the associated styles for this template
|
19 |
+
// found in the same directory, inside of the styles folder
|
20 |
+
wp_enqueue_style( 'custom_template_boilerplate_css' , get_stylesheet_directory_uri() . '/yikes-mailchimp-user-templates/Custom_Boilerplate_-_Standard/custom_template_boilerplate.css' );
|
21 |
+
|
22 |
+
?>
|
23 |
+
|
24 |
+
<!-- Form Template -->
|
25 |
+
<div class="yks-mailchimpFormContainerInner custom_template_boilerplate" id="yks-mailchimpFormContainerInner_<?php echo $list['id']; ?>">
|
26 |
+
|
27 |
+
<div id="wrapper">
|
28 |
+
<div id="box">
|
29 |
+
|
30 |
+
<div id="top_header">
|
31 |
+
<h3><?php _e( 'Sign Up Now!' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
|
32 |
+
<h5><?php _e( 'Sign up for our mailing list to receive weekly updates.' , 'yikes-inc-easy-mailchimp-extender' ); ?></h5>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<form method="post" name="yks-mailchimp-form" id="yks-mailchimp-form_<?php echo $list['id']; ?>" class="yiks-mailchimp-custom-form" rel="<?php echo $list['id']; ?>">
|
36 |
+
<input type="hidden" name="yks-mailchimp-list-ct" id="yks-mailchimp-list-ct_<?php echo $list['id']; ?>" value="<?php echo $listCt; ?>" />
|
37 |
+
<input type="hidden" name="yks-mailchimp-list-id" id="yks-mailchimp-list-id_<?php echo $list['id']; ?>" value="<?php echo $list['list-id']; ?>" />
|
38 |
+
<?php
|
39 |
+
/* Generate The Form Fields **/
|
40 |
+
echo $this->getFrontendFormDisplay($list, $submit_text);
|
41 |
+
?>
|
42 |
+
</form>
|
43 |
+
|
44 |
+
<p class="disclaimer"><?php _e( 'We promise never to share or sell any of your personal information.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
|
45 |
+
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
</div>
|
templates/yikes-mailchimp-widget.php
CHANGED
@@ -131,12 +131,12 @@ class yikes_MC_widget extends WP_Widget {
|
|
131 |
?>
|
132 |
<p>
|
133 |
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:','yikes-inc-easy-mailchimp-extender'); ?>
|
134 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
|
135 |
</label>
|
136 |
</p>
|
137 |
<p>
|
138 |
<label for="<?php echo $this->get_field_id( 'form_description' ); ?>"><?php _e( 'Form Text:','yikes-inc-easy-mailchimp-extender'); ?>
|
139 |
-
<textarea id="<?php echo $this->get_field_id( 'form_description' ); ?>" placeholder="Enter a short message to attract subscribers!" class="yikes_widget_form_description" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="text" value="<?php echo esc_attr( $form_description ); ?>"><?php echo esc_attr( $form_description ); ?></textarea>
|
140 |
</label>
|
141 |
</p>
|
142 |
<p>
|
@@ -162,7 +162,7 @@ class yikes_MC_widget extends WP_Widget {
|
|
162 |
// Updating widget replacing old instances with new
|
163 |
public function update( $new_instance, $old_instance ) {
|
164 |
$instance = array();
|
165 |
-
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( trim($new_instance['title']) ) : '
|
166 |
$instance['selected_form'] = strip_tags( $new_instance['selected_form'] );
|
167 |
$instance['submit_button_text'] = ( ! empty( $new_instance['submit_button_text'] ) ) ? strip_tags( trim($new_instance['submit_button_text']) ) : 'Sign Me Up';
|
168 |
$instance['form_description'] = ( ! empty( $new_instance['form_description'] ) ) ? strip_tags( trim($new_instance['form_description']) ) : '';
|
131 |
?>
|
132 |
<p>
|
133 |
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:','yikes-inc-easy-mailchimp-extender'); ?>
|
134 |
+
<input placeholder="<?php _e('Enter a title for your signup form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
|
135 |
</label>
|
136 |
</p>
|
137 |
<p>
|
138 |
<label for="<?php echo $this->get_field_id( 'form_description' ); ?>"><?php _e( 'Form Text:','yikes-inc-easy-mailchimp-extender'); ?>
|
139 |
+
<textarea id="<?php echo $this->get_field_id( 'form_description' ); ?>" placeholder="<?php _e( 'Enter a short message to attract subscribers!' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes_widget_form_description" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="text" value="<?php echo esc_attr( $form_description ); ?>"><?php echo esc_attr( $form_description ); ?></textarea>
|
140 |
</label>
|
141 |
</p>
|
142 |
<p>
|
162 |
// Updating widget replacing old instances with new
|
163 |
public function update( $new_instance, $old_instance ) {
|
164 |
$instance = array();
|
165 |
+
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( trim($new_instance['title']) ) : '';
|
166 |
$instance['selected_form'] = strip_tags( $new_instance['selected_form'] );
|
167 |
$instance['submit_button_text'] = ( ! empty( $new_instance['submit_button_text'] ) ) ? strip_tags( trim($new_instance['submit_button_text']) ) : 'Sign Me Up';
|
168 |
$instance['form_description'] = ( ! empty( $new_instance['form_description'] ) ) ? strip_tags( trim($new_instance['form_description']) ) : '';
|
yikes-inc-easy-mailchimp-extender.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Easy MailChimp Forms
|
5 |
Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
|
6 |
Description: Mailchimp integration in the form of a shortcode, php snippet or widget. Now track account status, campaign stats, view subscribers and so much more!
|
7 |
-
Version: 5.
|
8 |
Author: YIKES Inc
|
9 |
Author URI: http://yikesinc.com
|
10 |
License: GPL2
|
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
30 |
|
31 |
/** Configuration **/
|
32 |
if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', false);
|
33 |
-
if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '5.
|
34 |
if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
|
35 |
if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'YIKES Inc');
|
36 |
if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');
|
4 |
Plugin Name: Easy MailChimp Forms
|
5 |
Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
|
6 |
Description: Mailchimp integration in the form of a shortcode, php snippet or widget. Now track account status, campaign stats, view subscribers and so much more!
|
7 |
+
Version: 5.1
|
8 |
Author: YIKES Inc
|
9 |
Author URI: http://yikesinc.com
|
10 |
License: GPL2
|
30 |
|
31 |
/** Configuration **/
|
32 |
if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', false);
|
33 |
+
if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '5.1');
|
34 |
if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
|
35 |
if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'YIKES Inc');
|
36 |
if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');
|