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Cw5LjI2OSwzLjU5NCwzMC4wNDYsMTUuMDcsNjIuMzM3YzEwLjM2MywyNy45MiwyMi4wODYsNDMuNzEzLDM1LjE2LDQ3LjM4NmMxMy4wNzYsMy42NjQsMzUuMTk3LTIuNDIsNjYuMzc3LTE4LjI1N2MyMS4xMzktMTAuODQ1LDM4LjcxNS0xNC4yMTYsNTIuNzE1LTEwLjEwN2MxNC4wMDYsNC4wOTMsMjMuODI4LDE1LjI3NywyOS40NzksMzMuNTI5QzcxNy42MzIsMjk3LjQwNiw3MTQuMDMzLDMwOC41MzksNzAyLjc4NSwzMTguMjc1eiIvPjwvc3ZnPg==',
'id' => AN_ID,
) );
/**
*************************************************************
* Create option panel tabs
*/
$generalTab = $an_panel->createTab( array(
'name' => __( 'Adblock Notify Options', 'an-translate' ),
) );
$modalTab = $an_panel->createTab( array(
'name' => __( 'Modal Visual Options', 'an-translate' ),
) );
$redirectTab = $an_panel->createTab( array(
'name' => __( 'Redirection Options', 'an-translate' ),
) );
$alternativeTab = $an_panel->createTab( array(
'name' => __( 'Alternative Message', 'an-translate' ),
) );
/**
*************************************************************
* Create tab's options
*/
// Adblock Notify Options
do_action( 'an_pro_add_tab_options_top', $generalTab, $modalTab, $redirectTab, $alternativeTab );
$generalTab->createOption( array(
'name' => '
' . __( 'Welcome to Adblock Notify Plugin', 'an-translate' ) . '
',
'desc' => '
' . __( 'You can notify users with an activated Adblocker software by one of THREE ways !', 'an-translate' ) . '
- ' . __( 'A pretty cool and lightweight Modal Box with a custom content:', 'an-translate' ) . ' ' . __( 'the COMPLIANT solution', 'an-translate' ) . '
- ' . __( 'A simple redirection to the page of your choice:', 'an-translate' ) . ' ' . __( 'the AGRESSIVE solution', 'an-translate' ) . '
- ' . __( 'A custom alternative message where your hidden ads would normally appear:', 'an-translate' ) . ' ' . __( 'the TRANSPARENT solution', 'an-translate' ) . '
' . __( 'Only one of the two first options can be activated at the same time. The third one is standalone and can be setting up independently.', 'an-translate' ) . '
' . __( 'You can easily switch between them without losing your options.', 'an-translate' ) . '
' . __( 'Adblock Notify', 'an-translate' ) . ' ' . __( 'nativally uses cookies for a better user experience and a less intrusive browsing of your site. It means visitors will see the Modal Box only once or be redirected to your custom page once.', 'an-translate' ) . '
' . __( 'You can deactivate them, however if your visitor has an activated adblocker software they will see a modal box or get a redirection on every visited page.', 'an-translate' ) . '
',
'type' => 'note',
) );
$generalTab->createOption( array(
'name' => __( 'Modal Box or Redirection ?', 'an-translate' ),
'id' => 'an_option_choice',
'options' => array(
'1' => __( 'None', 'an-translate' ),
'2' => __( 'Modal Box', 'an-translate' ),
'3' => __( 'Page redirection', 'an-translate' ),
),
'type' => 'radio',
'desc' => __( 'Would you like to use the Modal Box or redirect users to a custom page when adblock is detected? - Default: None', 'an-translate' ),
'default' => '1',
) );
$generalTab->createOption( array(
'name' => __( 'Enable statistics Widget', 'an-translate' ),
'id' => 'an_option_stats',
'type' => 'select',
'desc' => __( 'If you have many page views, this option may cause server overload. You can disable it to make the plugin more lightweight - Default: Yes', 'an-translate' ) . '
' . __( 'Adblock Notify Stats widget is available on your admin dashboard (if not visible, go to the top menu and visit "Screen Options").', 'an-translate' ) . '',
'options' => array(
'1' => __( 'Yes', 'an-translate' ),
'2' => __( 'No', 'an-translate' ),
),
'default' => '1',
) );
$generalTab->createOption( array(
'name' => __( 'Improve detection (optional)', 'an-translate' ),
'type' => 'heading',
) );
$generalTab->createOption( array(
'name' => __( 'Adverts selectors', 'an-translate' ) . ' ( ' . __( 'Comma separated', 'an-translate' ) . ' )',
'id' => 'an_option_ads_selectors',
'type' => 'text',
'desc' => __( 'The Element CLASS or ID of your ads. - Default: Empty', 'an-translate' ) . '
' . __( 'The selector you provide must still be present within your DOM after the ad has been blocked. We only detect the height of the element so it can not be fixed. ', 'an-translate' ) . '
Eg: #google-ads, .promo .adsense, .sponsored
( ' . __( 'Read', 'an-translate' ) . ' ' . __( 'Selectors | jQuery API Documentation', 'an-translate' ) . ' ' . __( 'for more details', 'an-translate' ) . ' )',
) );
$generalTab->createOption( array(
'name' => __( 'Cookies Options', 'an-translate' ),
'type' => 'heading',
) );
$generalTab->createOption( array(
'name' => __( 'Cookies activation', 'an-translate' ),
'id' => 'an_option_cookie',
'type' => 'select',
'desc' => __( 'Prevent Modal Box from opening or Page redirection on every visited page - Default: Yes', 'an-translate' ) . '
' . __( 'Your own cookie is automatically reset on options save to see settings changes.', 'an-translate' ) . '',
'options' => array(
'1' => __( 'Yes', 'an-translate' ),
'2' => __( 'No', 'an-translate' ),
),
'default' => '1',
) );
$generalTab->createOption( array(
'name' => __( 'Cookies Lifetime', 'an-translate' ) . ' ( ' . __( 'Days', 'an-translate' ) . ' )',
'id' => 'an_option_cookie_life',
'type' => 'number',
'desc' => __( 'Set the lifetime of the cookie session - Default: 30 days', 'an-translate' ),
'default' => '30',
'min' => '1',
'max' => '360',
'step' => '1',
) );
$generalTab->createOption( array(
'name' => __( 'Random selectors and files', 'an-translate' ),
'type' => 'heading',
) );
$generalTab->createOption( array(
'name' => __( 'Use random selectors and files', 'an-translate' ),
'id' => 'an_option_selectors',
'type' => 'checkbox',
'desc' => __( 'Random selectors and files name to prevent adblock to block the plugin. Temp files with new selectors will be generated and stored in a temp folder in your /uploads directory - Default: Checked', 'an-translate' ),
'default' => true,
) );
$generalTab->createOption( array(
'name' => __( 'Flush files', 'an-translate' ),
'id' => 'an_option_flush',
'type' => 'checkbox',
'desc' => __( 'Will recreate the selectors and temps files on options saved.', 'an-translate' ),
'default' => false,
) );
// Modal Visual Options
$modalTab->createOption( array(
'name' => __( 'Modal Box Options', 'an-translate' ),
'type' => 'heading',
) );
$modalTab->createOption( array(
'name' => __( 'Modal Title', 'an-translate' ),
'id' => 'an_modal_title',
'type' => 'text',
'desc' => __( 'The title of the modal box', 'an-translate' ),
'default' => __( 'Adblocker detected! Please consider reading this notice.', 'an-translate' ),
) );
$modalTab->createOption( array(
'name' => __( 'Modal Text', 'an-translate' ),
'id' => 'an_modal_text',
'type' => 'editor',
'rows' => '13',
'desc' => __( 'The text of the modal box : images & shortcodes are supported.', 'an-translate' ),
'default' => '
' . __( 'We\'ve detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.', 'an-translate' ) . '
' . __( 'We don\'t have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!', 'an-translate' ) . '
' . __( 'We need money to operate the site, and almost all of it comes from our online advertising.', 'an-translate' ) . '
' . __( 'Please add', 'an-translate' ) . ' ' . preg_replace( '#^https?://#', '', rtrim( get_bloginfo( 'url' ), '/' ) ) . ' ' . __( 'to your ad blocking whitelist or disable your adblocking software.', 'an-translate' ) . '
',
) );
$modalTab->createOption( array(
'name' => __( 'Modal Box Settings', 'an-translate' ),
'type' => 'heading',
) );
$modalTab->createOption( array(
'name' => __( 'Modal Box effect', 'an-translate' ),
'id' => 'an_option_modal_effect',
'type' => 'select',
'desc' => __( 'The Modal Box animation effect - Default: Fade and Pop', 'an-translate' ),
'options' => array(
'1' => __( 'Fade and Pop', 'an-translate' ),
'2' => __( 'Fade', 'an-translate' ),
'3' => __( 'None', 'an-translate' ),
),
'default' => '1',
) );
$modalTab->createOption( array(
'name' => __( 'Animation Speed', 'an-translate' ) . ' ( ' . __( 'Milliseconds', 'an-translate' ) . ' )',
'id' => 'an_option_modal_speed',
'type' => 'number',
'desc' => '' . __( 'The Modal Box animation speed. Will not be applied if modal effect is set to None - Default: 350ms', 'an-translate' ) . '',
'default' => '350',
'min' => '0',
'max' => '5000',
'step' => '10',
) );
$modalTab->createOption( array(
'name' => __( 'Hide modal box close button', 'an-translate' ),
'id' => 'an_option_modal_cross',
'type' => 'select',
'desc' => __( 'Hide the x close button of the modal box? - Default: No', 'an-translate' ),
'options' => array(
'1' => __( 'Yes', 'an-translate' ),
'2' => __( 'No', 'an-translate' ),
),
'default' => '2',
) );
$modalTab->createOption( array(
'name' => __( 'Close the modal box on background click', 'an-translate' ),
'id' => 'an_option_modal_close',
'type' => 'select',
'desc' => __( 'If you click background will Modal close? - Default: Yes', 'an-translate' ),
'options' => array(
'1' => __( 'Yes', 'an-translate' ),
'2' => __( 'No', 'an-translate' ),
),
'default' => '1',
) );
$modalTab->createOption( array(
'name' => __( 'Modal Box Style', 'an-translate' ),
'type' => 'heading',
) );
$modalTab->createOption( array(
'name' => __( 'Overlay Color', 'an-translate' ) . ' ( ' . __( 'Background', 'an-translate' ) . ' )',
'id' => 'an_option_modal_bgcolor',
'type' => 'color',
'default' => '#000000',
'desc' => __( 'Default:', 'an-translate' ) . ' #000000',
) );
$modalTab->createOption( array(
'name' => __( 'Overlay Opacity', 'an-translate' ) . ' (%)',
'id' => 'an_option_modal_bgopacity',
'type' => 'number',
'desc' => '' . __( 'Modal Box overlay (background) opacity - Default: 80%', 'an-translate' ) . '',
'default' => '80',
'min' => '0',
'max' => '100',
'step' => '5',
) );
$modalTab->createOption( array(
'name' => __( 'Modal Box Background Color', 'an-translate' ),
'id' => 'an_option_modal_bxcolor',
'type' => 'color',
'default' => '#dddddd',
'desc' => __( 'Default:', 'an-translate' ) . ' #dddddd',
) );
$modalTab->createOption( array(
'name' => __( 'Modal Box Title Color', 'an-translate' ),
'id' => 'an_option_modal_bxtitle',
'type' => 'color',
'desc' => __( 'Default is your theme <h1> color', 'an-translate' ),
'default' => '',
) );
$modalTab->createOption( array(
'name' => __( 'Modal Box Text Color', 'an-translate' ),
'id' => 'an_option_modal_bxtext',
'type' => 'color',
'desc' => __( 'Default is your theme body text color', 'an-translate' ),
'default' => '',
) );
$modalTab->createOption( array(
'name' => __( 'Custom CSS', 'an-translate' ) . '
( ' . __( 'Advanced users', 'an-translate' ) . ' )',
'id' => 'an_option_modal_custom_css',
'type' => 'code',
'desc' => __(
'Put your custom CSS rules here. Modal Box ID is', 'an-translate' ) . ' #an-Modal
' . __( 'This selector will be changed during settings update by a random new one to prevent adblock to hide this element. All the CSS and JS files are parsed to be updated with this new selectors. That is why you have to add your custom style in the above field and not in you theme stylesheet.', 'an-translate' ) . '',
'lang' => 'css',
) );
// Redirection Options
$redirectTab->createOption( array(
'name' => __( 'Target Page', 'an-translate' ),
'id' => 'an_page_redirect',
'type' => 'select-pages',
'desc' => __( 'Select a page to redirect to. List your current published pages', 'an-translate' ),
) );
$redirectTab->createOption( array(
'name' => __( 'No JS Redirection', 'an-translate' ) . ' ' . __( 'Warning', 'an-translate' ) . '',
'type' => 'heading',
) );
$redirectTab->createOption( array(
'name' => __( 'Redirect if no JS detected?', 'an-translate' ),
'id' => 'an_page_nojs_activation',
'type' => 'checkbox',
'desc' => __( 'Yes', 'an-translate' ) . ' ( ' . __( 'This option used your Cookies Options', 'an-translate' ) . ' ) - ' . __( 'Default: Unchecked', 'an-translate' ) . '
' . __( 'Will redirect visitor to a custom page if Javascript is disable. It is NOT SEO friendly, use it only on private site.', 'an-translate' ) . '',
'default' => false,
) );
$redirectTab->createOption( array(
'name' => __( 'Target Page', 'an-translate' ),
'id' => 'an_page_nojs_redirect',
'type' => 'select-pages',
'desc' => __( 'Select a page to redirect to. List your current published pages', 'an-translate' ),
) );
// Alternative Message Options
$alternativeTab->createOption( array(
'name' => '' . __( 'Alternative Message', 'an-translate' ) . '
',
'desc' => '
' . __( 'You can insert a custom message where your hidden ads would normally appear.', 'an-translate' ) . '
' . __( 'The plugin will append a new "clean" DIV element just before the advert container to display your custom message.', 'an-translate' ) . '
' . __( 'Note:', 'an-translate' ) . ' ' . __( 'Some minimal HTML knowledge is required to set up this functionality.', 'an-translate' ) . '
',
'type' => 'note',
) );
$alternativeTab->createOption( array(
'name' => __( 'Activate this option?', 'an-translate' ),
'id' => 'an_alternative_activation',
'type' => 'checkbox',
'desc' => __( 'Yes - Default: Unchecked', 'an-translate' ) . '
' . __( 'If unchecked, below options will not be used', 'an-translate' ) . '',
'default' => false,
) );
$alternativeTab->createOption( array(
'name' => __( 'Required Settings', 'an-translate' ),
'type' => 'heading',
) );
$alternativeTab->createOption( array(
'name' => __( 'Advert containers', 'an-translate' ) . ' ( ' . __( 'Comma separated', 'an-translate' ) . ' )',
'id' => 'an_alternative_elements',
'type' => 'text',
'desc' => __( 'The Element CLASS or ID of your ads containers. - Default: Empty', 'an-translate' ) . '
Eg: #my-ad, .hentry .adsense, .sponsored
( ' . __( 'Read', 'an-translate' ) . ' ' . __( 'Selectors | jQuery API Documentation', 'an-translate' ) . ' ' . __( 'for more details', 'an-translate' ) . ' )',
) );
$alternativeTab->createOption( array(
'name' => __( 'Alternative Text', 'an-translate' ),
'id' => 'an_alternative_text',
'type' => 'editor',
'rows' => '8',
'desc' => __( 'The alternative text to display when ads are hidden. Images & shortcodes are supported, but use them with caution.', 'an-translate' ),
'default' => '
' . __( 'AdBlock detected!', 'an-translate' ) . '
' . __( 'Please add', 'an-translate' ) . ' www.themeisle.com ' . __( 'to your adblocking whitelist or disable your adblocking software.', 'an-translate' ) . '
',
) );
$alternativeTab->createOption( array(
'name' => __( 'Optional Settings', 'an-translate' ),
'type' => 'heading',
) );
$alternativeTab->createOption( array(
'name' => __( 'Clone ad container?', 'an-translate' ),
'id' => 'an_alternative_clone',
'type' => 'select',
'desc' => __( 'Will copy your original ad container CSS properties - Default: No', 'an-translate' ) . '
' . __( 'This feature is not 100% reliable but could help for a quick set up.', 'an-translate' ) . '',
'options' => array(
'1' => __( 'Custom Mode', 'an-translate' ),
'2' => __( 'Soft Mode (Recommended)', 'an-translate' ),
'3' => __( 'Hard Mode', 'an-translate' ),
'4' => __( 'No', 'an-translate' ),
),
'default' => '2',
) );
$alternativeTab->createOption( array(
'type' => 'note',
'desc' => '
' . __( 'What does "Clone ad container" mean?', 'an-translate' ) . '
' . __( 'It means you can ask Adblock Notify Plugin to copy the CSS properties of the element that contains your ad to a new element which will not be hidden by an adblocker software. With this process, your design should not break.', 'an-translate' ) . '
' . __( 'The new element will be the same type (DIV,SPAN,etc.) as its source, and will have the .an-alternative class.', 'an-translate' ) . '
' . __( 'Available options are:', 'an-translate' ) . '
- ' . __( 'Custom Mode', 'an-translate' ) . '' . __( ': Will try to catch all the CSS rules defined in your theme files, and let you choose which ones to keep (see Custom Mode CSS properties).', 'an-translate' ) . '
- ' . __( 'Soft Mode (Recommended)', 'an-translate' ) . '' . __( ': Will try to catch all the CSS rules defined in your theme files, and add them to the new created element. If the browser does not support this feature, it will try Hard Mode fetching.', 'an-translate' ) . '
- ' . __( 'Hard Mode', 'an-translate' ) . '' . __( ': Will try to fetch all the elements CSS rules based on browser CSS compilation (not reading directly in your CSS files). This option may add a lot of inline CSS rules to your newly created element.', 'an-translate' ) . '
' . __( 'This feature is performed through Javascript (+jQuery) and is 95% functional on all modern browser even on IE8+. For the 5% left, the plugin will drop potential JS errors and insert .an-alternative div.', 'an-translate' ) . '
' . __( 'Tested and works great on Chrome, Firefox, Safari, Opera, IE8+', 'an-translate' ) . '
' . __( 'What\'s appended if I don\'t turn on this option?', 'an-translate' ) . '
' . __( 'The plugin will append a new "clean" DIV element with .an-alternative class just before the advert container. You can add your own custom rules with the Custom CSS field below.', 'an-translate' ) . '
',
) );
$alternativeTab->createOption( array(
'name' => __( 'Custom Mode CSS properties', 'an-translate' ) . ' ( ' . __( 'Comma separated', 'an-translate' ) . ' )',
'id' => 'an_alternative_properties',
'type' => 'text',
'desc' => __( 'The element CSS properties you want to clone - Default: Empty', 'an-translate' ) . '
' . __( 'Eg: color, width, height, background-color, border', 'an-translate' ) . '
( ' . __( 'Read', 'an-translate' ) . ' ' . __( 'CSS Reference | w3schools.com', 'an-translate' ) . ' ' . __( 'for more details', 'an-translate' ) . ' )
',
) );
$alternativeTab->createOption( array(
'name' => __( 'Custom CSS', 'an-translate' ) . '
( ' . __( 'Advance users', 'an-translate' ) . ' )',
'id' => 'an_alternative_custom_css',
'type' => 'code',
'desc' => __( 'Put your custom CSS rules here. The new Element class is .an-alternative', 'an-translate' ) . '
' . __( 'NOTE:', 'an-translate' ) . ' ' . __( 'If you\'ve activated the ads containers cloning, you can still add custom CSS on your text.', 'an-translate' ) . '
' . __( 'If you really have to overload .an-alternative with your own CSS properties, you may probably need to use !important after each of them, but this is not advised.', 'an-translate' ) . '
' . __( 'This selector will be changed during settings update by a random new one to prevent adblock to hide this element. All the CSS and JS files are parsed to be updated with this new selectors. That is why you have to add your custom style in the above field and not in you theme stylesheet.', 'an-translate' ) . '
',
'lang' => 'css',
) );
do_action( 'an_pro_add_tab_options', $generalTab, $modalTab, $redirectTab, $alternativeTab );
/**
*************************************************************
* Launch options framework instance
*/
$generalTab->createOption( array(
'type' => 'save',
'save' => __( 'Save Changes', 'an-translate' ),
'reset' => __( 'Reset to Defaults', 'an-translate' ),
) );
$modalTab->createOption( array(
'type' => 'save',
'save' => __( 'Save Changes', 'an-translate' ),
'reset' => __( 'Reset to Defaults', 'an-translate' ),
) );
$redirectTab->createOption( array(
'type' => 'save',
'save' => __( 'Save Changes', 'an-translate' ),
'reset' => __( 'Reset to Defaults', 'an-translate' ),
) );
$alternativeTab->createOption( array(
'type' => 'save',
'save' => __( 'Save Changes', 'an-translate' ),
'reset' => __( 'Reset to Defaults', 'an-translate' ),
) );
}
/**
* Pro options in READ mode
*/
add_filter( 'an_get_all_templates','an_add_free_template' );
/**
* Alter the templates in the options panel
*
* @param array $array Templates to load.
*
* @return mixed Templates available
*/
function an_add_free_template( $array ) {
$array['an-default'] = AN_URL . AN_TEMPLATES_DIRECTORY . 'screenshots/' . 'an-default.png';
$array['an-ok'] = AN_URL . AN_TEMPLATES_DIRECTORY . 'screenshots/' . 'an-ok.png';
$array['an-image'] = AN_URL . AN_TEMPLATES_DIRECTORY . 'screenshots/' . 'an-image.png';
return $array;
}
/**
* ************************************************************
* Add additional features in the tabs but as the first items
***************************************************************/
function an_pro_add_tab_options_top( $generalTab, $modalTab, $redirectTab, $alternativeTab ) {
$templates = apply_filters( 'an_get_all_templates', array() );
$an_option = unserialize( an_get_option( 'adblocker_notify_options' ) );
$selected_template = isset( $an_option['an_option_modal_template'] ) ? $an_option['an_option_modal_template'] : 'an-default';
if ( isset( $_GET['an_option_modal_template'] ) ) {
$selected_template = $_GET['an_option_modal_template'];
}
$modalTab->createOption( array(
'name' => __( 'Modal Box Template', 'an-translate' ),
'type' => 'heading',
) );
$modalTab->createOption( array(
'name' => __( 'Choose Template', 'an-translate' ),
'id' => 'an_option_modal_template',
'options' => $templates,
'type' => 'radio-image',
'default' => $selected_template,
) );
apply_filters( 'an_show_template_options', $modalTab, $selected_template );
}
/**
* ************************************************************
* Add additional features in the tabs but as the last items
***************************************************************/
function an_pro_add_tab_options( $generalTab, $modalTab, $redirectTab, $alternativeTab ) {
$modalTab->createOption( array(
'name' => __( 'Advanced Options', 'an-translate' ),
'type' => 'heading',
) );
$modalTab->createOption( array(
'name' => __( 'Show modal after pages viewed', 'an-translate' ),
'id' => 'an_option_modal_after_pages',
'type' => 'number',
'desc' => __( 'After how many unique pages should the modal be shown? - Default: 0 (every page)', 'an-translate' ),
'default' => '0',
'min' => '0',
'max' => '100',
'step' => '1',
) );
$modalTab->createOption( array(
'name' => __( 'Modal width', 'an-translate' ),
'id' => 'an_option_modal_width',
'type' => 'number',
'desc' => __( 'Maxium width of the modal window in pixels', 'an-translate' ),
'default' => '720',
'min' => '200',
'max' => '1000',
'step' => '1',
) );
}
add_action( 'an_pro_add_tab_options_top', 'an_pro_add_tab_options_top' , 10, 4 );
add_action( 'an_pro_add_tab_options', 'an_pro_add_tab_options' , 10, 4 );