Esempio n. 1
0
 /**
  * Field Render Function.
  *
  * Takes the vars and outputs the HTML for the field in the settings
  *
  * @since SNP_NHP_Options 1.0
  */
 function render()
 {
     $class = isset($this->field['class']) ? 'class="' . $this->field['class'] . '" ' : '';
     echo '<input class="snp-button-preview" type="button" id="' . $this->field['id'] . '_button" value="Preview" />';
     echo '<br /><br />';
     echo '<b>Clear Your Cookies to test the popup on your live website.</b><br />';
     echo '<input type="button" id="' . $this->field['id'] . '_button_cookie" class="button" value="Clear my cookie" />';
     echo '<script type="text/javascript">';
     echo 'jQuery(document).ready(function(){';
     echo '	jQuery("#' . $this->field['id'] . '_button").click(function(){';
     echo '		jQuery("#post").attr("target","_blank");';
     echo '		jQuery("#post").attr("action","admin-ajax.php");';
     echo '		jQuery("#hiddenaction").val("snp_preview_popup");';
     echo '		jQuery("#originalaction").val("snp_preview_popup");';
     echo "\t\tjQuery('<input>').attr('type','hidden').attr('name','action').attr('id','snp_preview_popup_i').val('snp_preview_popup').appendTo('#post');";
     echo '		jQuery("#post").submit();';
     echo '		jQuery("#hiddenaction").val("editpost");';
     echo '		jQuery("#originalaction").val("editpost");';
     echo '		jQuery("#snp_preview_popup_i").remove();';
     echo '		jQuery("#post").attr("target","");';
     echo '		jQuery("#post").attr("action","post.php");';
     echo '	});';
     echo '	jQuery("#' . $this->field['id'] . '_button_cookie").click(function(){';
     echo '		jQuery.cookie("snp_' . snp_get_option('class_popup', 'snppopup') . '-welcome",null, { path: "/"});';
     echo '		jQuery.cookie("snp_' . snp_get_option('class_popup', 'snppopup') . '-exit",null, { path: "/"});';
     echo '		alert("Done!");';
     echo '	});';
     echo '});';
     echo '</script>';
 }
Esempio n. 2
0
 public function search_callback($match)
 {
     if (!trim($match[2])) {
         return $match[0];
     }
     $quot = '"';
     if (strpos($match[1], '"') !== FALSE) {
         $quot = '"';
     } elseif (strpos($match[1], '\'') !== FALSE) {
         $quot = '\'';
     }
     $match['attr'] = shortcode_parse_atts($match[1]);
     // has href?
     if (!$match['attr']['href']) {
         return $match[0];
     }
     // is local?
     if (self::is_local_url($match['attr']['href'])) {
         return $match[0];
     }
     // is excluded?
     if (empty($match['attr']['class'])) {
         $match['attr']['class'] = '';
     }
     if (strpos($match['attr']['class'], snp_get_option('class_no_popup', 'nosnppopup')) !== FALSE) {
         return $match[0];
     }
     // is graphic?
     if (self::is_image_url($match['attr']['href'])) {
         return $match[0];
     }
     $attrs = '';
     if (!$match['attr']['class']) {
         $match['attr']['class'] = '';
     }
     foreach ($match['attr'] as $k => $v) {
         if ($k == 'class') {
             $v .= ' ' . snp_get_option('class_popup', 'snppopup');
         }
         $attrs .= $k . '=' . $quot . trim($v) . $quot . '';
     }
     return '<a ' . $attrs . '>' . $match[2] . '</a>';
 }
Esempio n. 3
0
function snp_plugin_api_call($def, $action, $args)
{
    global $snp_plugin_slug, $snp_api_url, $wp_version;
    if (!isset($args->slug) || $args->slug != $snp_plugin_slug || !function_exists('snp_get_option') || snp_get_option('autoupdates') != 1) {
        return false;
    }
    // Get the current version
    $plugin_info = get_site_transient('update_plugins');
    $current_version = $plugin_info->checked[$snp_plugin_slug . '/' . $snp_plugin_slug . '.php'];
    $args->version = $current_version;
    $request_string = array('body' => array('action' => $action, 'request' => serialize($args), 'site' => get_bloginfo('url'), 'purchasecode' => snp_get_option('purchasecode')), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url'));
    $request = wp_remote_post($snp_api_url, $request_string);
    if (is_wp_error($request)) {
        $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message());
    } else {
        $res = unserialize($request['body']);
        if ($res === false) {
            $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']);
        }
    }
    return $res;
}
Esempio n. 4
0
    if ($POPUP_META['snp_show_li_button'] == 'yes') {
        echo '<div class="snp-share snp-share-li"><script type="IN/Share" data-showzero="true" data-url="' . $POPUP_META['snp_li_url'] . '" data-onsuccess="snp_onshare_li" data-counter="right"></script></div>';
    }
    if ($POPUP_META['snp_show_pi_button'] == 'yes') {
        echo '<div class="snp-share snp-share-pi"><a href="http://pinterest.com/pin/create/button/?url=' . urlencode($POPUP_META['snp_pi_url'] ? $POPUP_META['snp_pi_url'] : $CURRENT_URL) . '&media=' . urlencode($POPUP_META['snp_pi_image_url']) . '&description=' . urlencode($POPUP_META['snp_pi_description']) . '" class="pin-it-button" target="_blank" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></div>';
    }
}
//echo '<br style="clear: both;" />';
?>
				</div>
			</div>
        </div>
    </div>
	<?php 
if (snp_get_option('PROMO_ON') && snp_get_option('PROMO_REF') && SNP_PROMO_LINK != '') {
    $PROMO_LINK = SNP_PROMO_LINK . snp_get_option('PROMO_REF');
    echo '<div class="snp-powered">';
    echo '<a href="' . $PROMO_LINK . '" target="_blank">Powered by <strong>Ninja Popups</strong></a>';
    echo '</div>';
}
?>
</div>
<?php 
$POPUP_META['snp_header_font'] = unserialize($POPUP_META['snp_header_font']);
$POPUP_META['snp_lefttext_font'] = unserialize($POPUP_META['snp_lefttext_font']);
$POPUP_META['snp_rightheader_font'] = unserialize($POPUP_META['snp_rightheader_font']);
$POPUP_META['snp_righttext_font'] = unserialize($POPUP_META['snp_righttext_font']);
$POPUP_META['snp_submit_button_color'] = unserialize($POPUP_META['snp_submit_button_color']);
echo '<style>';
if (!empty($POPUP_META['snp_width']) && intval($POPUP_META['snp_width'])) {
    echo '.snp-pop-' . $ID . ' .snp-theme2 {  width: ' . $POPUP_META['snp_width'] . 'px;}';
Esempio n. 5
0
<?php 
if (!empty($POPUP_META['snp_img'])) {
    ?>
                <div class="snp-half snp-left"><div class="snp-image"><img src="<?php 
    echo $POPUP_META['snp_img'];
    ?>
" alt="" /></div></div>
                <div class="snp-half snp-right">
<?php 
}
?>

<?php 
if (isset($POPUP_META['snp_cf'])) {
    $name_field = '<input type="text" name="' . (snp_get_option('ml_manager') == 'html' && snp_get_option('ml_html_name') ? snp_get_option('ml_html_name') : 'name') . '" id="snp-name" placeholder="' . $POPUP_META['snp_name_placeholder'] . '" class="snp-field snp-field-name" />';
    $email_field = '<input type="text" name="' . (snp_get_option('ml_manager') == 'html' && snp_get_option('ml_html_email') ? snp_get_option('ml_html_email') : 'email') . '" id="snp_email" placeholder="' . $POPUP_META['snp_email_placeholder'] . '"  class="snp-field snp-field-email" />';
    $tpl_field = '%FIELD%';
    snp_custom_fields(unserialize($POPUP_META['snp_cf']), array('email_field' => $email_field, 'name_field' => $name_field, 'tpl_field' => $tpl_field, 'snp_name_disable' => $POPUP_META['snp_name_disable']));
}
?>

                    <input type="submit" class="snp-subscribe-button snp-submit" data-loading="<?php 
echo $POPUP_META['snp_submit_button_loading'];
?>
" data-success="<?php 
echo $POPUP_META['snp_submit_button_success'];
?>
" value="<?php 
echo $POPUP_META['snp_submit_button'];
?>
">
function snp_run()
{
    global $post;
    if (is_404()) {
        return;
    }
    if (snp_get_option('enable') == 'disabled') {
        return;
    }
    // mobile device?
    //if (snp_get_option('enable_mobile') == 'disabled' && snp_detect_mobile($_SERVER['HTTP_USER_AGENT']))
    //{
    //return;
    //}
    if (isset($_REQUEST['nphide']) && $_REQUEST['nphide'] == 1 || isset($_COOKIE['nphide']) && $_COOKIE['nphide'] == 1) {
        setcookie('nphide', 1, 0, COOKIEPATH, COOKIE_DOMAIN, false);
        return;
    }
    $WELCOME_ID = 'global';
    $EXIT_ID = 'global';
    if (isset($post->ID) && (is_page() || is_single())) {
        $WELCOME_ID = get_post_meta($post->ID, 'snp_p_welcome_popup', true);
        $WELCOME_ID = $WELCOME_ID ? $WELCOME_ID : 'global';
        $EXIT_ID = get_post_meta($post->ID, 'snp_p_exit_popup', true);
        $EXIT_ID = $EXIT_ID ? $EXIT_ID : 'global';
        //echo 'post='.$WELCOME_ID.'<br />'; //DEL
        //echo 'post='.$EXIT_ID.'<br />'; //DEL
        if ($WELCOME_ID == 'global' || $EXIT_ID == 'global') {
            if ($post->post_type == 'post') {
                $POST_CATS = wp_get_post_categories($post->ID);
            }
            $enable_taxs = snp_get_option('enable_taxs');
            if (is_array($enable_taxs)) {
                foreach ((array) $enable_taxs as $k => $v) {
                    $POST_CATS = array_merge((array) $POST_CATS, wp_get_object_terms($post->ID, $k, array('fields' => 'ids')));
                }
            }
            if (is_array($POST_CATS)) {
                foreach ($POST_CATS as $term_id) {
                    $term_meta = get_option("snp_taxonomy_" . $term_id);
                    if (isset($term_meta['welcome']) && $WELCOME_ID == 'global') {
                        $WELCOME_ID = $term_meta['welcome'];
                    }
                    if (isset($term_meta['exit']) && $EXIT_ID == 'global') {
                        $EXIT_ID = $term_meta['exit'];
                    }
                }
            }
            // tax
        }
    } elseif (is_category() || is_tax() || is_tag() || is_archive()) {
        $category = get_queried_object();
        $term_meta = get_option("snp_taxonomy_" . $category->term_id);
        if (isset($term_meta['welcome'])) {
            $WELCOME_ID = $term_meta['welcome'];
        } else {
            $WELCOME_ID = 'global';
        }
        if (isset($term_meta['exit'])) {
            $EXIT_ID = $term_meta['exit'];
        } else {
            $EXIT_ID = 'global';
        }
    }
    if (defined('ICL_LANGUAGE_CODE')) {
        $snp_var_sufix = '_' . ICL_LANGUAGE_CODE;
    } else {
        $snp_var_sufix = '';
    }
    // WELCOME
    if (snp_get_option('welcome_disable_for_logged') == 1 && is_user_logged_in()) {
    } else {
        if ($WELCOME_ID !== 'disabled' && $WELCOME_ID !== 'global') {
            snp_run_popup($WELCOME_ID, 'welcome');
        } elseif ($WELCOME_ID === 'global') {
            $WELCOME_ID = snp_get_option('welcome_popup' . $snp_var_sufix);
            if ($WELCOME_ID === 'global' && defined('ICL_LANGUAGE_CODE')) {
                $WELCOME_ID = snp_get_option('welcome_popup');
            }
            if ($WELCOME_ID !== 'disabled') {
                $welcome_display_in = snp_get_option('welcome_display_in');
                if (is_front_page() && isset($welcome_display_in['home']) && $welcome_display_in['home'] == 1) {
                    snp_run_popup($WELCOME_ID, 'welcome');
                } elseif (is_page() && isset($welcome_display_in['pages']) && $welcome_display_in['pages'] == 1) {
                    snp_run_popup($WELCOME_ID, 'welcome');
                } elseif (is_single() && isset($welcome_display_in['posts']) && $welcome_display_in['posts'] == 1) {
                    snp_run_popup($WELCOME_ID, 'welcome');
                } elseif (isset($welcome_display_in['others']) && $welcome_display_in['others'] == 1 && !is_front_page() && !is_page() && !is_single()) {
                    snp_run_popup($WELCOME_ID, 'welcome');
                }
            }
        }
    }
    // EXIT
    if (snp_get_option('exit_disable_for_logged') == 1 && is_user_logged_in()) {
    } else {
        if ($EXIT_ID != 'disabled' && $EXIT_ID != 'global') {
            snp_run_popup($EXIT_ID, 'exit');
        } elseif ($EXIT_ID === 'global') {
            $EXIT_ID = snp_get_option('exit_popup' . $snp_var_sufix);
            if ($EXIT_ID === 'global' && defined('ICL_LANGUAGE_CODE')) {
                $EXIT_ID = snp_get_option('exit_popup');
            }
            if ($EXIT_ID != 'disabled') {
                $exit_display_in = snp_get_option('exit_display_in');
                if (is_front_page() && isset($exit_display_in['home']) && $exit_display_in['home'] == 1) {
                    snp_run_popup($EXIT_ID, 'exit');
                } elseif (is_page() && isset($exit_display_in['pages']) && $exit_display_in['pages'] == 1) {
                    snp_run_popup($EXIT_ID, 'exit');
                } elseif (is_single() && isset($exit_display_in['posts']) && $exit_display_in['posts'] == 1) {
                    snp_run_popup($EXIT_ID, 'exit');
                } elseif (isset($exit_display_in['others']) && $exit_display_in['others'] == 1 && !is_front_page() && !is_page() && !is_single()) {
                    snp_run_popup($EXIT_ID, 'exit');
                }
            }
        }
    }
    // ===============================
    add_filter('wp_nav_menu_objects', 'snp_wp_nav_menu_objects');
}
function snp_ml_get_egoi_lists($ml_egoi_apikey = '')
{
    $list = array();
    if (snp_get_option('ml_egoi_apikey') || $ml_egoi_apikey) {
        if (!$ml_egoi_apikey) {
            $ml_egoi_apikey = snp_get_option('ml_egoi_apikey');
        }
        $params = array('apikey' => $ml_egoi_apikey);
        try {
            $client = new SoapClient('http://api.e-goi.com/v2/soap.php?wsdl');
            $result = $client->getLists($params);
            if (is_array($result)) {
                foreach ($result as $l) {
                    $list[$l['listnum']] = array('name' => $l['title']);
                }
            }
        } catch (Exception $e) {
            //die($e->getMessage());
            // Error
        }
    }
    if (count($list) == 0) {
        $list[0] = array('name' => 'Nothing Found...');
    }
    return $list;
}
Esempio n. 8
0
function snp_setup_admin()
{
    $args = array();
    $args['dev_mode'] = false;
    $args['intro_text'] = __('<p></p>', 'nhp-opts');
    $args['share_icons']['facebook'] = array('link' => 'https://www.facebook.com/arscode', 'title' => 'Find us on Facebook', 'img' => SNP_NHP_OPTIONS_URL . 'img/glyphicons/glyphicons_320_facebook.png');
    $args['show_import_export'] = false;
    $args['opt_name'] = SNP_OPTIONS;
    $args['page_type'] = 'submenu';
    $args['page_parent'] = 'edit.php?post_type=snp_popups';
    $args['menu_title'] = __('Settings', 'nhp-opts');
    $args['page_title'] = __('Ninja Popups', 'nhp-opts');
    $args['page_slug'] = 'snp_opt';
    snp_init();
    //add_submenu_page( 'admin.php?page=snp_opt', 'Preview', 'Preview', 'manage_options', 'snp_preview', 'snp_page_preview' );
    add_filter("mce_external_plugins", "snp_register_tinymce_plugin");
    add_filter('mce_buttons', 'snp_add_tinymce_button');
    add_filter('manage_edit-snp_popups_columns', 'snp_add_columns');
    add_filter('manage_edit-snp_ab_columns', 'snp_ab_add_columns');
    add_action('manage_snp_popups_posts_custom_column', 'snp_manage_columns', 10, 2);
    add_action('manage_snp_ab_posts_custom_column', 'snp_manage_columns', 10, 2);
    if (!snp_get_option('disable_np_columns')) {
        add_filter('manage_edit-post_columns', 'snp_add_columns_posts');
        add_filter('manage_edit-page_columns', 'snp_add_columns_posts');
        add_filter('manage_edit-product_columns', 'snp_add_columns_posts');
        //add_filter('manage_edit-category_columns', 'snp_add_columns_posts');
        //add_filter('manage_edit-product_cat_columns', 'snp_add_columns_posts');
        add_action('manage_posts_custom_column', 'snp_manage_columns_posts_post', 10, 2);
        add_action('manage_page_posts_custom_column', 'snp_manage_columns_posts_post', 10, 2);
        add_action('manage_product_custom_column', 'snp_manage_columns_posts_post', 10, 2);
        //add_action('manage_category_custom_column', 'snp_manage_columns_posts_term', 10, 3);
        //add_action('manage_product_cat_custom_column', 'snp_manage_columns_posts_term', 10, 3);
        $enable_taxs = snp_get_option('enable_taxs');
        if (is_array($enable_taxs)) {
            foreach ((array) $enable_taxs as $k => $v) {
                add_filter('manage_edit-' . $k . '_columns', 'snp_add_columns_posts');
                add_action('manage_' . $k . '_custom_column', 'snp_manage_columns_posts_term', 10, 3);
            }
        }
    }
    add_action('wp_ajax_snp_preview_popup', 'snp_preview_popup');
    add_action('wp_ajax_snp_insert_shortcode', 'snp_ajax_insert_shortcode');
    add_action('wp_ajax_snp_ml_list', 'snp_ml_list');
    add_action('wp_ajax_snp_popup_fields', 'snp_popup_fields');
    add_action('wp_ajax_snp_popup_colors', 'snp_popup_colors');
    add_action('wp_ajax_snp_popup_types', 'snp_popup_types');
    add_action('wp_ajax_snp_disable_affiliate_message', 'snp_ajax_disable_affiliate_message');
    add_action('wp_ajax_snp_dismiss_update_message', 'snp_ajax_dismiss_update_message');
    add_action('wp_ajax_snp_purchasecode_check', 'snp_ajax_purchasecode_check');
    add_action('admin_head-post-new.php', 'snp_posttype_admin_css');
    add_action('admin_head-post.php', 'snp_posttype_admin_css');
    add_action('admin_head-edit.php', 'snp_posttype_admin_css');
    $Popups = snp_get_popups();
    $ABTesting = snp_get_ab();
    $customfields[] = array('id' => 'snp-cf-gsp', 'post_type' => array('snp_ab'), 'title' => __('Popups', 'nhp-opts'), 'fields' => array(array('id' => 'forms', 'type' => 'multi_checkbox', 'title' => __('Select', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'options' => $Popups)));
    $Popups = (array) $Popups + (array) $ABTesting;
    $Popups['disabled'] = 'Disabled';
    $sections = array();
    global $FB_Locales;
    $sections[] = array('icon' => SNP_NHP_OPTIONS_URL . 'img/ico_gen_settings.png', 'title' => __('General Settings', 'nhp-opts'), 'fields' => array(array('id' => 'enable', 'type' => 'select', 'title' => __('Enable Plugin', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'enabled', 'options' => array('enabled' => 'Enabled', 'disabled' => 'Disabled')), array('id' => 'enable_mobile', 'type' => 'select', 'title' => __('Enable Plugin on Mobile Devices', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'enabled', 'options' => array('enabled' => 'Enabled', 'disabled' => 'Disabled')), array('id' => 'enable_analytics_events', 'type' => 'select', 'title' => __('Enable Google Analytics Event Tracking', 'nhp-opts'), 'desc' => __('<b>Google Universal Analytics</b> should be installed on the site.', 'nhp-opts'), 'std' => 'no', 'options' => array('no' => 'No', 'yes' => 'Yes'))));
    $sections_welcome = array(array('id' => 'welcome_popup', 'type' => 'select', 'title' => __('Default Welcome Popup', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'disabled', 'options' => $Popups));
    $sections_exit = array(array('id' => 'exit_popup', 'type' => 'select', 'title' => __('Default Exit Popup', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'disabled', 'options' => $Popups));
    if (function_exists('icl_get_languages')) {
        $Popups['global'] = 'Use global settings';
        $langs = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
        foreach ($langs as $language) {
            $sections_welcome[] = array('id' => 'welcome_popup_' . $language['language_code'], 'type' => 'select', 'title' => __('Default Welcome Popup [' . $language['native_name'] . ']', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'global', 'options' => $Popups);
            $sections_exit[] = array('id' => 'exit_popup_' . $language['language_code'], 'type' => 'select', 'title' => __('Default Exit Popup [' . $language['native_name'] . ']', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'global', 'options' => $Popups);
        }
    }
    $sections[] = array('icon' => SNP_NHP_OPTIONS_URL . 'img/ico_welcome_settings.png', 'title' => __('Welcome', 'nhp-opts'), 'fields' => array_merge($sections_welcome, array(array('id' => 'welcome_display_in', 'type' => 'multi_checkbox', 'title' => __('Display in:', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => array('home' => 1, 'pages' => 1, 'posts' => 1, 'others' => 1), 'options' => array('home' => 'Home', 'pages' => 'Pages', 'posts' => 'Posts', 'others' => 'Categories, Archive and other')), array('id' => 'welcome_disable_for_logged', 'type' => 'checkbox', 'title' => __('Disable for logged users', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''))));
    $sections[] = array('icon' => SNP_NHP_OPTIONS_URL . 'img/ico_exit_settings.png', 'title' => __('Exit', 'nhp-opts'), 'fields' => array_merge($sections_exit, array(array('id' => 'exit_display_in', 'type' => 'multi_checkbox', 'title' => __('Display in:', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => array('home' => 1, 'pages' => 1, 'posts' => 1, 'others' => 1), 'options' => array('home' => 'Home', 'pages' => 'Pages', 'posts' => 'Posts', 'others' => 'Categories, Archive and other')), array('id' => 'use_in', 'type' => 'multi_checkbox', 'title' => __('Use popup external for links in:', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => array('the_content' => 1, 'the_excerpt' => 1, 'widget_text' => 1, 'comment_text' => 1), 'options' => array('the_content' => 'Content', 'the_excerpt' => 'Excerpts', 'widget_text' => 'Widgets Text', 'comment_text' => 'Comments', 'all' => 'All links (Menu, sidebars, footer, etc.)')), array('id' => 'exit_excluded_urls', 'type' => 'multi_text', 'title' => __('Excluded URLs', 'nhp-opts'), 'desc' => __('Add external URLs for which you want to disable/skip exit popup.', 'nhp-opts')), array('id' => 'exit_disable_for_logged', 'type' => 'checkbox', 'title' => __('Disable for logged users', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''))));
    $ml_managers = array('0' => array('name' => '--'), 'email' => array('name' => 'Send Optins to E-mail', 'fieldsgroup' => 'fg_email'), 'aweber' => array('name' => 'AWeber', 'fieldsgroup' => 'fg_aweber'), 'mailchimp' => array('name' => 'MailChimp', 'fieldsgroup' => 'fg_mailchimp'), 'getresponse' => array('name' => 'GetResponse', 'fieldsgroup' => 'fg_getresponse'), 'campaignmonitor' => array('name' => 'CampaignMonitor', 'fieldsgroup' => 'fg_campaignmonitor'), 'icontact' => array('name' => 'iContact', 'fieldsgroup' => 'fg_icontact'), 'constantcontact' => array('name' => 'Constant Contact', 'fieldsgroup' => 'fg_constantcontact'), 'madmimi' => array('name' => 'Mad Mimi', 'fieldsgroup' => 'fg_madmimi'), 'infusionsoft' => array('name' => 'Infusionsoft', 'fieldsgroup' => 'fg_inf'), 'directmail' => array('name' => 'Direct Mail for OS X', 'fieldsgroup' => 'fg_directmail'), 'sendy' => array('name' => 'Sendy', 'fieldsgroup' => 'fg_sendy'), 'egoi' => array('name' => 'e-goi', 'fieldsgroup' => 'fg_egoi'), 'csv' => array('name' => 'Store in CSV File', 'fieldsgroup' => 'fg_csv'), 'html' => array('name' => 'HTML Form', 'fieldsgroup' => 'fg_html'));
    if (class_exists('WYSIJA')) {
        $ml_managers['wysija'] = array('name' => 'Wysija', 'fieldsgroup' => 'fg_wysija');
    }
    if (defined('MYMAIL_VERSION') && version_compare(MYMAIL_VERSION, '1.3.1.2') >= 0) {
        $ml_managers['mymail'] = array('name' => 'MyMail', 'fieldsgroup' => 'fg_mymail');
    }
    if (defined('SENDPRESS_VERSION')) {
        $ml_managers['sendpress'] = array('name' => 'SendPress', 'fieldsgroup' => 'fg_sendpress');
    }
    $sections[] = array('icon' => SNP_NHP_OPTIONS_URL . 'img/ico_ml_settings.png', 'title' => __('Mailing List Manager', 'nhp-opts'), 'fields' => array(array('id' => 'ml_manager', 'type' => 'select_show_fieldsgroup', 'title' => __('Mailing List Manager', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'email', 'options' => $ml_managers), array('id' => 'ml_aw_auth', 'type' => 'aweber_auth', 'class' => 'fg_ml_manager fg_aweber large-text', 'title' => __('AWeber Connection', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_aw_lists', 'type' => 'aweber_lists', 'class' => 'fg_ml_manager fg_aweber', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_htmlform_exp', 'type' => 'htmlform_exp', 'class' => 'fg_ml_manager fg_html', 'title' => __('HTML Opt-in Code:', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('Enter your html opt-in code.', 'nhp-opts'), 'std' => ''), array('id' => 'ml_html_url', 'type' => 'text', 'class' => 'fg_ml_manager fg_html regular-text', 'title' => __('Form URL', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_html_blank', 'type' => 'checkbox', 'class' => 'fg_ml_manager fg_html', 'title' => __('Submit Form to New Window', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_html_name', 'type' => 'text', 'class' => 'fg_ml_manager fg_html regular-text', 'title' => __('Name Input Name', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => 'name'), array('id' => 'ml_html_email', 'type' => 'text', 'class' => 'fg_ml_manager fg_html regular-text', 'title' => __('E-mail Input Name', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => 'email'), array('id' => 'ml_html_hidden', 'type' => 'textarea', 'class' => 'fg_ml_manager fg_html regular-text', 'title' => __('Additional HTML Code:', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('Enter additional form HTML, like hidden inputs etc.', 'nhp-opts'), 'std' => ''), array('id' => 'ml_csv_file', 'type' => 'csv_file', 'class' => 'fg_ml_manager fg_csv regular-text', 'title' => __('CSV File Name', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_mc_apikey', 'type' => 'text', 'class' => 'fg_ml_manager fg_mailchimp regular-text', 'title' => __('MailChimp API Key', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('<a href="http://kb.mailchimp.com/article/where-can-i-find-my-api-key" target="_blank">Where can I find my API Key?</a>', 'nhp-opts'), 'std' => ''), array('id' => 'ml_mc_list', 'type' => 'mailchimp_lists', 'class' => 'fg_ml_manager fg_mailchimp regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_mc_double_optin', 'type' => 'select', 'class' => 'fg_ml_manager fg_mailchimp regular-text', 'title' => __('Double Opt-in?', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => 0, 'options' => array(0 => 'No', 1 => 'Yes')), array('id' => 'ml_mc_send_welcome', 'type' => 'select', 'class' => 'fg_ml_manager fg_mailchimp regular-text', 'title' => __('Send Welcome Message?', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => 1, 'options' => array(0 => 'No', 1 => 'Yes')), array('id' => 'ml_gr_apikey', 'type' => 'text', 'class' => 'fg_ml_manager fg_getresponse regular-text', 'title' => __('GetResponse API Key', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('<a href="http://www.getresponse.com/learning-center/glossary/api-key.html" target="_blank">Where can I find my API Key?</a>', 'nhp-opts'), 'std' => ''), array('id' => 'ml_gr_list', 'type' => 'getresponse_lists', 'class' => 'fg_ml_manager fg_getresponse regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_sendy_url', 'type' => 'text', 'class' => 'fg_ml_manager fg_sendy regular-text', 'title' => __('Sendy Url', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => '', 'std' => ''), array('id' => 'ml_sendy_list', 'type' => 'text', 'class' => 'fg_ml_manager fg_sendy regular-text', 'title' => __('Sendy List ID', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('This encrypted & hashed id can be found under View all lists section named ID', 'nhp-opts'), 'std' => ''), array('id' => 'ml_egoi_apikey', 'type' => 'text', 'class' => 'fg_ml_manager fg_egoi regular-text', 'title' => __('e-goi API Key', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => '', 'std' => ''), array('id' => 'ml_egoi_list', 'type' => 'egoi_lists', 'class' => 'fg_ml_manager fg_egoi regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_dm_form_id', 'type' => 'text', 'class' => 'fg_ml_manager fg_directmail regular-text', 'title' => __('Direct Mail Subscribe Form ID', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('<a href="http://directmailmac.com/support/article/327" target="_blank">Where do I find my form ID?</a>', 'nhp-opts'), 'std' => ''), array('id' => 'ml_cm_clientid', 'type' => 'text', 'class' => 'fg_ml_manager fg_campaignmonitor regular-text', 'title' => __('CampaignMonitor Client ID', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('<a href="http://www.campaignmonitor.com/api/getting-started/#clientid" target="_blank">Where can I find my Client ID?</a>', 'nhp-opts'), 'std' => ''), array('id' => 'ml_cm_apikey', 'type' => 'text', 'class' => 'fg_ml_manager fg_campaignmonitor regular-text', 'title' => __('CampaignMonitor API Key', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('<a href="http://www.campaignmonitor.com/api/getting-started/#apikey" target="_blank">Where can I find my API Key?</a>', 'nhp-opts'), 'std' => ''), array('id' => 'ml_cm_list', 'type' => 'campaignmonitor_lists', 'class' => 'fg_ml_manager fg_campaignmonitor regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_ic_username', 'type' => 'text', 'class' => 'fg_ml_manager fg_icontact regular-text', 'title' => __('iContact Username', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_ic_addid', 'type' => 'text', 'class' => 'fg_ml_manager fg_icontact regular-text', 'title' => __('iContact App ID', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('<a href="http://developer.icontact.com/documentation/register-your-app/" target="_blank">Where can I get my App ID?</a>', 'nhp-opts'), 'std' => ''), array('id' => 'ml_ic_apppass', 'type' => 'text', 'class' => 'fg_ml_manager fg_icontact regular-text', 'title' => __('iContact App Password', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_ic_list', 'type' => 'icontact_lists', 'class' => 'fg_ml_manager fg_icontact regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_cc_username', 'type' => 'text', 'class' => 'fg_ml_manager fg_constantcontact regular-text', 'title' => __('Constant Contact Username', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_cc_pass', 'type' => 'text', 'input_type' => 'password', 'class' => 'fg_ml_manager fg_constantcontact regular-text', 'title' => __('Constant Contact Password', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_cc_list', 'type' => 'constantcontact_lists', 'class' => 'fg_ml_manager fg_constantcontact regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_cc_send_welcome', 'type' => 'select', 'class' => 'fg_ml_manager fg_constantcontact regular-text', 'title' => __('Send Welcome Message?', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => 1, 'options' => array(0 => 'No', 1 => 'Yes')), array('id' => 'ml_email', 'type' => 'text', 'class' => 'fg_ml_manager fg_email regular-text', 'title' => __('E-mail Address', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_wy_list', 'type' => 'wysija_lists', 'class' => 'fg_ml_manager fg_wysija regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_mm_list', 'type' => 'mymail_lists', 'class' => 'fg_ml_manager fg_mymail regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_mm_double_optin', 'type' => 'select', 'class' => 'fg_ml_manager fg_mymail regular-text', 'title' => __('Double Opt-in?', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => 0, 'options' => array(0 => 'No', 1 => 'Yes')), array('id' => 'ml_sp_list', 'type' => 'sendpress_lists', 'class' => 'fg_ml_manager fg_sendpress regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_madm_username', 'type' => 'text', 'class' => 'fg_ml_manager fg_madmimi regular-text', 'title' => __('Mad Mimi Username', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_madm_apikey', 'type' => 'text', 'input_type' => 'text', 'class' => 'fg_ml_manager fg_madmimi regular-text', 'title' => __('Mad Mimi API Key', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_madm_list', 'type' => 'madmimi_lists', 'class' => 'fg_ml_manager fg_madmimi regular-text', 'title' => __('Default Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_inf_subdomain', 'type' => 'text', 'class' => 'fg_ml_manager fg_inf regular-text', 'title' => __('Infusionsoft subdomain', 'nhp-opts'), 'desc' => __('.infusionsoft.com', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_inf_apikey', 'type' => 'text', 'input_type' => 'text', 'class' => 'fg_ml_manager fg_inf regular-text', 'title' => __('Infusionsoft API Key', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'ml_inf_list', 'type' => 'infusionsoft_lists', 'class' => 'fg_ml_manager fg_inf regular-text', 'title' => __('Default Group', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '')));
    $sections[] = array('icon' => SNP_NHP_OPTIONS_URL . 'img/ico_updates.png', 'title' => __('Auto Updates', 'nhp-opts'), 'fields' => array(array('id' => 'autoupdates', 'type' => 'checkbox', 'title' => __('Enable Auto Updates', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'purchasecode', 'type' => 'purchasecode', 'title' => __('Purchase Code', 'nhp-opts'), 'desc' => __('<a href="https://help.market.envato.com/hc/en-us/articles/202822600-Where-can-I-find-my-Purchase-Code-" target="_blank">Where can I find my Purchase Code?</a>', 'nhp-opts'), 'std' => '')));
    $sections[] = array('icon' => SNP_NHP_OPTIONS_URL . 'img/ico_promote.png', 'title' => __('Promote', 'nhp-opts'), 'fields' => array(array('id' => 'promo_header', 'type' => 'info', 'title' => __('Earn with Envato Affiliate Program!', 'nhp-opts'), 'desc' => __('<a href="http://codecanyon.net/make_money/affiliate_program" target="_blank">Click here for more info</a>', 'nhp-opts')), array('id' => 'PROMO_ON', 'type' => 'checkbox', 'title' => __('Promote Ninja Popups with Your Affiliate link?', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'PROMO_REF', 'type' => 'text', 'title' => __('Your Envato Username', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => ''), array('id' => 'promo_img', 'type' => 'info2', 'desc' => __('<p style="text-align: center;"><img src="' . SNP_URL . '/admin/img/promote.png" /></p>', 'nhp-opts'), 'std' => '')));
    $sections[] = array('icon' => SNP_NHP_OPTIONS_URL . 'img/ico_adv_settings.png', 'title' => __('Advanced Settings', 'nhp-opts'), 'fields' => array(array('id' => 'enable_taxs', 'type' => 'tax_checkboxes', 'title' => __('Enable Ninja Popups Settings for Taxonomies', 'nhp-opts')), array('id' => 'class_popup', 'type' => 'text', 'title' => __('CSS class used in links', 'nhp-opts'), 'desc' => __('(default: snppopup)', 'nhp-opts'), 'std' => 'snppopup'), array('id' => 'class_no_popup', 'type' => 'text', 'title' => __('CSS class used in links for disable popup', 'nhp-opts'), 'desc' => __('(default: nosnppopup)', 'nhp-opts'), 'std' => 'nosnppopup'), array('id' => 'fb_locale', 'type' => 'select', 'title' => __('Facebook Locale', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'en_GB', 'options' => $FB_Locales), array('id' => 'disable_selftest', 'type' => 'checkbox', 'title' => __('Disable Self Test Warning', 'nhp-opts')), array('id' => 'disable_affiliate_message', 'type' => 'checkbox', 'title' => __('Disable Afilliate Program Notice', 'nhp-opts')), array('id' => 'disable_np_columns', 'type' => 'checkbox', 'title' => __('Don\'t show Ninja Popups column in Posts/Pages Lists', 'nhp-opts')), array('id' => 'run_hook', 'type' => 'select', 'title' => __('Plugin Run Hook', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'get_header', 'options' => array('get_header' => 'get_header', 'wp' => 'wp')), array('id' => 'conflict_header', 'type' => 'info', 'title' => 'JavaScripts', 'desc' => __('If Theme or another Plugin is loading any of these scripts, you can turn it off to avoid conflict.
					', 'nhp-opts')), array('id' => 'js_disable_fancybox', 'type' => 'checkbox', 'title' => __('Disable Fancybox 2 Loading', 'nhp-opts'), 'sub_desc' => 'jquery.fancybox.pack.js'), array('id' => 'js_disable_jq_cookie', 'type' => 'checkbox', 'title' => __('Disable jQuery Cookie', 'nhp-opts'), 'sub_desc' => 'jquery.ck.js<br />(<a href="https://github.com/carhartl/jquery-cookie" target="_blank">https://github.com/carhartl/jquery-cookie</a>)'), array('id' => 'js_disable_jq_placeholder', 'type' => 'checkbox', 'title' => __('Disable jQuery PlaceHolder', 'nhp-opts'), 'sub_desc' => 'jquery.placeholder.js'), array('id' => 'js_disable_fb', 'type' => 'checkbox', 'title' => __('Disable Facebook JS Loading', 'nhp-opts'), 'sub_desc' => 'https://connect.facebook.net/en_GB/all.js#xfbml=1'), array('id' => 'js_disable_gp', 'type' => 'checkbox', 'title' => __('Disable Google Plus JS Loading', 'nhp-opts'), 'sub_desc' => 'https://apis.google.com/js/plusone.js'), array('id' => 'js_disable_tw', 'type' => 'checkbox', 'title' => __('Disable Twitter JS Loading', 'nhp-opts'), 'sub_desc' => 'https://platform.twitter.com/widgets.js'), array('id' => 'js_disable_pi', 'type' => 'checkbox', 'title' => __('Disable Pinterest JS Loading', 'nhp-opts'), 'sub_desc' => 'https://assets.pinterest.com/js/pinit.js'), array('id' => 'js_disable_li', 'type' => 'checkbox', 'title' => __('Disable LinkedIn JS Loading', 'nhp-opts'), 'sub_desc' => 'https://platform.linkedin.com/in.js')));
    $Popups['global'] = 'Use global settings';
    $Popups['disabled'] = 'Disabled';
    $all_post_type = snp_get_post_types();
    $customfields[] = array('id' => 'snp-cf-gsp', 'post_type' => $all_post_type, 'title' => __('Ninja Popups', 'nhp-opts'), 'fields' => array(array('id' => 'p_welcome_popup', 'type' => 'select', 'title' => __('Welcome', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'global', 'options' => $Popups), array('id' => 'p_exit_popup', 'type' => 'select', 'title' => __('Exit', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'global', 'options' => $Popups)));
    // POPUP FILEDS
    $customfields[] = array('id' => 'snp-cf-lf', 'post_type' => array('snp_popups'), 'title' => __('Look & Feel', 'nhp-opts'), 'fields' => array(array('id' => 'theme', 'type' => 'select_theme', 'title' => __('Theme', 'nhp-opts'), 'desc' => __('Please save content data before change.', 'nhp-opts'), 'std' => 'theme1', 'options' => snp_get_themes_list())));
    $customfields[] = array('id' => 'snp-cf-cnt', 'post_type' => array('snp_popups'), 'title' => __('Content', 'nhp-opts'), 'fields' => array());
    $customfields[] = array('id' => 'snp-cf-preview', 'context' => 'side', 'post_type' => array('snp_popups'), 'title' => __('Preview', 'nhp-opts'), 'fields' => array(array('id' => 'popup_preview_popup', 'type' => 'preview_popup', 'title' => __('Preview', 'nhp-opts'), 'disable_title' => 1, 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-overlay', 'post_type' => array('snp_popups'), 'title' => __('Overlay', 'nhp-opts'), 'fields' => array(array('id' => 'popup_overlay', 'type' => 'select_show_fieldsgroup', 'title' => __('Overlay', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'default', 'options' => array('default' => array('name' => 'Default (60% opacity)', 'fieldsgroup' => 'fg_overlay_default'), 'disabled' => array('name' => 'Disabled', 'fieldsgroup' => 'fg_overlay_disabled'), 'image' => array('name' => 'Image', 'fieldsgroup' => 'fg_overlay_image'))), array('id' => 'overlay_image', 'type' => 'upload', 'class' => 'fg_overlay fg_overlay_image regular-text', 'title' => __('Overlay Image', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-gs', 'post_type' => array('snp_popups'), 'title' => __('Display Settings', 'nhp-opts'), 'fields' => array(array('id' => 'start_date', 'type' => 'date', 'title' => __('Start Date', 'nhp-opts'), 'sub_desc' => __('Leave empty to enable popup all the time.', 'nhp-opts')), array('id' => 'end_date', 'type' => 'date', 'title' => __('End Date', 'nhp-opts'), 'sub_desc' => __('Leave empty to enable popup all the time.', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-op', 'post_type' => array('snp_popups'), 'title' => __('Welcome Settings', 'nhp-opts'), 'fields' => array(array('id' => 'open', 'type' => 'select_show_fieldsgroup', 'title' => __('When Popup should appear?', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'default', 'options' => array('load' => array('name' => 'On page load', 'fieldsgroup' => 'open_load'), 'inactivity' => array('name' => 'After X seconds of inactivity', 'fieldsgroup' => 'open_inactivity'), 'scroll' => array('name' => 'When user scroll page', 'fieldsgroup' => 'open_scroll'))), array('id' => 'open_inactivity', 'type' => 'text', 'class' => 'fg_open open_inactivity', 'title' => __('Open after X seconds of inactivity', 'nhp-opts'), 'desc' => __('', 'nhp-opts')), array('id' => 'open_after', 'type' => 'text', 'class' => 'fg_open open_load', 'title' => __('Open Delay', 'nhp-opts'), 'desc' => __('(in seconds)', 'nhp-opts')), array('id' => 'open_scroll', 'type' => 'slider', 'class' => 'fg_open open_scroll mini', 'title' => __('Open when user scroll % of page', 'nhp-opts'), 'desc' => __('% (100% - end of page)', 'nhp-opts'), 'std' => '10', 'min' => '0', 'max' => '100', 'step' => '1')));
    $customfields[] = array('id' => 'snp-cf-ex', 'post_type' => array('snp_popups'), 'title' => __('Exit Settings', 'nhp-opts'), 'fields' => array(array('id' => 'show_on_exit', 'type' => 'select_hide_below', 'title' => __('Show Exit Popup', 'nhp-opts'), 'sub_desc' => __('Only for exit popups.', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 2, 'options' => array(2 => array('name' => 'When user try to leave page (need JS Alert)', 'allow' => 'true'), 3 => array('name' => 'When mouse leaves the browser viewport (Exit Intent)', 'allow' => 'false'), 1 => array('name' => 'When user click external link', 'allow' => 'false'))), array('id' => 'exit_js_alert_text', 'type' => 'textarea', 'title' => __('JavaScript Alert Box Text', 'nhp-opts'), 'sub_desc' => __('Only for exit popups.', 'nhp-opts'), 'desc' => __('<p style="text-align: center;"><img src="' . SNP_URL . '/admin/img/js_alert.png" /></p>', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-cb', 'post_type' => array('snp_popups'), 'title' => __('Close Button & Delay', 'nhp-opts'), 'fields' => array(array('id' => 'cb_close_after', 'type' => 'text', 'class' => 'mini', 'title' => __('Auto Close Popup', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('(in seconds)', 'nhp-opts')), array('id' => 'show_cb_button', 'type' => 'select', 'title' => __('Show Close Link and Button', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'yes', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'cb_text', 'type' => 'text', 'title' => __('Close Link Text', 'nhp-opts'), 'std' => __('Close this popup', 'nhp-opts'), 'desc' => __('', 'nhp-opts')), array('id' => 'cb_img', 'type' => 'radio_img', 'title' => __('Close Button', 'nhp-opts'), 'sub_desc' => '', 'desc' => '', 'options' => array('close_default' => array('title' => '', 'img' => SNP_URL . 'img/close_default.png'), 'close_1' => array('title' => '', 'img' => SNP_URL . 'img/close_1.png'), 'close_2' => array('title' => '', 'img' => SNP_URL . 'img/close_2.png'), 'close_3' => array('title' => '', 'img' => SNP_URL . 'img/close_3.png'), 'close_4' => array('title' => '', 'img' => SNP_URL . 'img/close_4.png'), 'close_5' => array('title' => '', 'img' => SNP_URL . 'img/close_5.png'), 'close_6' => array('title' => '', 'img' => SNP_URL . 'img/close_6.png')), 'std' => 'close_default')));
    $customfields[] = array('id' => 'snp-cf-cookies', 'post_type' => array('snp_popups'), 'title' => __('Cookies', 'nhp-opts'), 'fields' => array(array('id' => 'cookie_conversion', 'type' => 'text', 'class' => 'mini', 'title' => __('Cookie Time on Conversion (Opt-in/Share)', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '30', 'desc' => __('days (0 for cookie just for current session, -2 to disable cookie and open popup every time)<br />When user opt-in/share, how long should it be before the popup is shown again?', 'nhp-opts')), array('id' => 'cookie_close', 'type' => 'text', 'class' => 'mini', 'title' => __('Cookie Time on Close', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '0', 'desc' => __('days (0 for cookie just for current session, -2 to disable cookie and open popup every time)<br />When user click close button, how long should it be before the popup is shown again?', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-redirect', 'post_type' => array('snp_popups'), 'title' => __('Redirect', 'nhp-opts'), 'fields' => array(array('id' => 'optin_redirect', 'type' => 'select', 'title' => __('Redirect after opt-in/like', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'no', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'optin_redirect_url', 'type' => 'text', 'title' => __('Redirect URL', 'nhp-opts'), 'desc' => __('(start with http://)', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-fb', 'post_type' => array('snp_popups'), 'title' => __('Facebook', 'nhp-opts'), 'fields' => array(array('id' => 'show_like_button', 'type' => 'select', 'title' => __('Show Like Button', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'yes', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'fb_url', 'type' => 'text', 'title' => __('URL to Like', 'nhp-opts'), 'sub_desc' => __('Leave empty to use current URL.', 'nhp-opts'), 'desc' => __('(start with http://)', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-tw', 'post_type' => array('snp_popups'), 'title' => __('Twitter', 'nhp-opts'), 'fields' => array(array('id' => 'show_tweet_button', 'type' => 'select', 'title' => __('Show Tweet Button', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'yes', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'tweet_url', 'type' => 'text', 'title' => __('URL to Tweet', 'nhp-opts'), 'sub_desc' => __('Leave empty to use current URL.', 'nhp-opts'), 'desc' => __('(start with http://)', 'nhp-opts')), array('id' => 'tweet_text', 'type' => 'textarea', 'title' => __('Tweet Text', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('', 'nhp-opts')), array('id' => 'show_follow_button', 'type' => 'select', 'title' => __('Show Follow Button', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'no', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'twitter_username', 'type' => 'text', 'title' => __('Twitter Username', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-gp', 'post_type' => array('snp_popups'), 'title' => __('Google Plus', 'nhp-opts'), 'fields' => array(array('id' => 'show_gp_button', 'type' => 'select', 'title' => __('Show +1 Button', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'yes', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'gp_url', 'type' => 'text', 'title' => __('URL to +1', 'nhp-opts'), 'sub_desc' => __('Leave empty to use current URL.', 'nhp-opts'), 'desc' => __('(start with http://)', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-li', 'post_type' => array('snp_popups'), 'title' => __('LinkedIn', 'nhp-opts'), 'fields' => array(array('id' => 'show_li_button', 'type' => 'select', 'title' => __('Show InShare Button', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'yes', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'li_url', 'type' => 'text', 'title' => __('URL to share', 'nhp-opts'), 'sub_desc' => __('Leave empty to use current URL.', 'nhp-opts'), 'desc' => __('(start with http://)', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-pi', 'post_type' => array('snp_popups'), 'title' => __('Pinterest', 'nhp-opts'), 'fields' => array(array('id' => 'show_pi_button', 'type' => 'select', 'title' => __('Show Pin It Button', 'nhp-opts'), 'desc' => __('', 'nhp-opts'), 'std' => 'yes', 'options' => array('yes' => 'Yes', 'no' => 'No')), array('id' => 'pi_url', 'type' => 'text', 'title' => __('URL of the page to pin', 'nhp-opts'), 'sub_desc' => __('Leave empty to use current URL.', 'nhp-opts'), 'desc' => __('(start with http://)', 'nhp-opts')), array('id' => 'pi_image_url', 'type' => 'upload', 'title' => __('URL of the image to pin', 'nhp-opts'), 'desc' => __('(start with http://)', 'nhp-opts')), array('id' => 'pi_description', 'type' => 'textarea', 'title' => __('Description ', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-customcss', 'post_type' => array('snp_popups'), 'title' => __('Custom CSS', 'nhp-opts'), 'fields' => array(array('id' => 'custom_css', 'type' => 'textarea', 'title' => __('Custom CSS', 'nhp-opts'))));
    $customfields[] = array('id' => 'snp-cf-customjs', 'post_type' => array('snp_popups'), 'title' => __('Custom JS', 'nhp-opts'), 'fields' => array(array('id' => 'custom_js', 'type' => 'textarea', 'title' => __('Custom JS', 'nhp-opts'))));
    /* == */
    $ml_fields = array();
    if (snp_get_option('ml_manager') == 'email') {
        $ml_fields[] = array('id' => 'ml_email', 'type' => 'text', 'class' => 'fg_ml_manager fg_email regular-text', 'title' => __('E-mail Address', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'aweber') {
        $ml_fields[] = array('id' => 'ml_aw_lists', 'type' => 'aweber_lists', 'class' => 'fg_ml_manager fg_aweber', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'mailchimp') {
        $ml_fields[] = array('id' => 'ml_mc_list', 'type' => 'mailchimp_lists', 'class' => 'fg_ml_manager fg_mailchimp regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'getresponse') {
        $ml_fields[] = array('id' => 'ml_gr_list', 'type' => 'getresponse_lists', 'class' => 'fg_ml_manager fg_getresponse regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'campaignmonitor') {
        $ml_fields[] = array('id' => 'ml_cm_list', 'type' => 'campaignmonitor_lists', 'class' => 'fg_ml_manager fg_campaignmonitor regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'icontact') {
        $ml_fields[] = array('id' => 'ml_ic_list', 'type' => 'icontact_lists', 'class' => 'fg_ml_manager fg_icontact regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'constantcontact') {
        $ml_fields[] = array('id' => 'ml_cc_list', 'type' => 'constantcontact_lists', 'class' => 'fg_ml_manager fg_constantcontact regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'wysija') {
        $ml_fields[] = array('id' => 'ml_wy_list', 'type' => 'wysija_lists', 'class' => 'fg_ml_manager fg_wysija regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'mymail') {
        $ml_fields[] = array('id' => 'ml_mm_list', 'type' => 'mymail_lists', 'class' => 'fg_ml_manager fg_mymail regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'sendpress') {
        $ml_fields[] = array('id' => 'ml_sp_list', 'type' => 'sendpress_lists', 'class' => 'fg_ml_manager fg_sendpress regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'madmimi') {
        $ml_fields[] = array('id' => 'ml_madm_list', 'type' => 'madmimi_lists', 'class' => 'fg_ml_manager fg_madmimi regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'infusionsoft') {
        $ml_fields[] = array('id' => 'ml_inf_list', 'type' => 'infusionsoft_lists', 'class' => 'fg_ml_manager fg_inf regular-text', 'title' => __('Select Group', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'sendy') {
        $ml_fields[] = array('id' => 'ml_sendy_list', 'type' => 'text', 'class' => 'fg_ml_manager fg_sendy regular-text', 'title' => __('Sendy List ID', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'desc' => __('This encrypted & hashed id can be found under View all lists section named ID', 'nhp-opts'), 'std' => '', 'meta' => 1);
    } elseif (snp_get_option('ml_manager') == 'egoi') {
        $ml_fields[] = array('id' => 'ml_egoi_list', 'type' => 'egoi_lists', 'class' => 'fg_ml_manager fg_egoi regular-text', 'title' => __('Select Mailing List', 'nhp-opts'), 'sub_desc' => __('', 'nhp-opts'), 'std' => '', 'meta' => 1);
    }
    if (count($ml_fields) > 0) {
        $customfields[] = array('id' => 'snp-cf-ml', 'post_type' => array('snp_popups'), 'title' => __('Mailing List', 'nhp-opts'), 'fields' => $ml_fields);
    }
    /* == */
    global $SNP_NHP_Options;
    $tabs = array();
    $SNP_NHP_Options = new SNP_NHP_Options($sections, $args, $tabs, $customfields, array(), array());
}
Esempio n. 9
0
function snp_affiliate_message()
{
    if (snp_get_option('disable_affiliate_message') == 1) {
        return;
    }
    echo "<div id=\"snp_afm\" style=\"padding: 5px 20px 20px 20px; background-color: #c0f796; margin: 40px; border: 1px solid #7AD03A; \">";
    echo "<h2>Earn with Ninja Popups and Envato Affiliate Program!</h2><br/>";
    echo '<a class="button button-primary" href="edit.php?post_type=snp_popups&page=snp_opt&tab=4">Tell me more</a> ';
    echo '<a class="button" id="snp_afm_d" href="#">Dismiss this notice</a>';
    echo "</div>";
    echo "<script>jQuery(document).ready(function(\$){ \$('#snp_afm_d').click(function(){ jQuery.ajax({type: 'POST',  url: 'admin-ajax.php', data: {  action: 'snp_disable_affiliate_message'}}); \$('#snp_afm').hide(); return false;});});</script>";
}