Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/themify-.../template...
File: template-alert.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Template Alert
[2] Fix | Delete
*
[3] Fix | Delete
* This template can be overridden by copying it to your child_theme_folder/themify-builder/template-alert.php.
[4] Fix | Delete
*
[5] Fix | Delete
* Access original fields: $args['mod_settings']
[6] Fix | Delete
* @author Themify
[7] Fix | Delete
*/
[8] Fix | Delete
defined( 'ABSPATH' ) || exit;
[9] Fix | Delete
[10] Fix | Delete
[11] Fix | Delete
$mod_name=$args['mod_name'];
[12] Fix | Delete
$element_id = $args['module_ID'];
[13] Fix | Delete
$fields_args=$args['mod_settings']+ array(
[14] Fix | Delete
'mod_title_alert' => '',
[15] Fix | Delete
'appearance_alert' => '',
[16] Fix | Delete
'layout_alert' => 'button-right',
[17] Fix | Delete
'color_alert' => 'tb_default_color',
[18] Fix | Delete
'heading_alert' => '',
[19] Fix | Delete
'title_tag' => 'h3',
[20] Fix | Delete
'text_alert' => '',
[21] Fix | Delete
'alert_button_action' => 'close',
[22] Fix | Delete
'alert_message_text' => '',
[23] Fix | Delete
'action_btn_link_alert' => '#',
[24] Fix | Delete
'open_link_new_tab_alert' => '',
[25] Fix | Delete
'lightbox_width' => '',
[26] Fix | Delete
'lightbox_height' => '',
[27] Fix | Delete
'lightbox_width_unit' => 'px',
[28] Fix | Delete
'lightbox_height_unit' => 'px',
[29] Fix | Delete
'action_btn_text_alert' => false,
[30] Fix | Delete
'action_btn_color_alert' => 'tb_default_color',
[31] Fix | Delete
'action_btn_appearance_alert' => '',
[32] Fix | Delete
'alert_no_date_limit' => '',
[33] Fix | Delete
'alert_start_at' => '',
[34] Fix | Delete
'alert_end_at' => '',
[35] Fix | Delete
'alert_show_to' => '',
[36] Fix | Delete
'alert_limit_count' => '',
[37] Fix | Delete
'alert_auto_close' => '',
[38] Fix | Delete
'alert_auto_close_delay' => '',
[39] Fix | Delete
'css_alert' => '',
[40] Fix | Delete
'animation_effect' => ''
[41] Fix | Delete
);
[42] Fix | Delete
if (!empty($fields_args['appearance_alert'])) {
[43] Fix | Delete
$fields_args['appearance_alert'] = self::get_checkbox_data($fields_args['appearance_alert']);
[44] Fix | Delete
Themify_Builder_Model::load_appearance_css($fields_args['appearance_alert']);
[45] Fix | Delete
}
[46] Fix | Delete
if (!empty($fields_args['action_btn_appearance_alert'])) {
[47] Fix | Delete
$fields_args['action_btn_appearance_alert'] = self::get_checkbox_data($fields_args['action_btn_appearance_alert']);
[48] Fix | Delete
Themify_Builder_Model::load_appearance_css($fields_args['action_btn_appearance_alert']);
[49] Fix | Delete
}
[50] Fix | Delete
Themify_Builder_Model::load_color_css($fields_args['color_alert']);
[51] Fix | Delete
Themify_Builder_Model::load_color_css($fields_args['action_btn_color_alert']);
[52] Fix | Delete
$container_class =apply_filters('themify_builder_module_classes', array(
[53] Fix | Delete
'module ui',
[54] Fix | Delete
'module-' . $mod_name,
[55] Fix | Delete
$element_id,
[56] Fix | Delete
$fields_args['layout_alert'],
[57] Fix | Delete
$fields_args['color_alert'],
[58] Fix | Delete
$fields_args['css_alert'],
[59] Fix | Delete
$fields_args['appearance_alert']
[60] Fix | Delete
), $mod_name, $element_id, $fields_args);
[61] Fix | Delete
[62] Fix | Delete
if(!empty($fields_args['global_styles']) && Themify_Builder::$frontedit_active===false){
[63] Fix | Delete
$container_class[] = $fields_args['global_styles'];
[64] Fix | Delete
}
[65] Fix | Delete
$container_props = apply_filters('themify_builder_module_container_props', self::parse_animation_effect($fields_args,array(
[66] Fix | Delete
'class' => implode(' ', $container_class),
[67] Fix | Delete
'data-auto-close' => !empty($fields_args['alert_auto_close']) && !empty($fields_args['alert_auto_close_delay']) ? $fields_args['alert_auto_close_delay'] : '',
[68] Fix | Delete
'data-module-id' => $element_id,
[69] Fix | Delete
'data-alert-limit' => $fields_args['alert_limit_count'],
[70] Fix | Delete
)), $fields_args, $mod_name, $element_id);
[71] Fix | Delete
[72] Fix | Delete
// Button action
[73] Fix | Delete
$ui_class=array('ui', 'builder_button', $fields_args['action_btn_appearance_alert'],$fields_args['action_btn_color_alert']);
[74] Fix | Delete
if('url' !== $fields_args['alert_button_action'] ){
[75] Fix | Delete
$ui_class[]='alert-close';
[76] Fix | Delete
}
[77] Fix | Delete
$url = $fields_args['alert_button_action'] === 'url' ? esc_url($fields_args['action_btn_link_alert']) : '#';
[78] Fix | Delete
$button_attr = '';
[79] Fix | Delete
if ( $fields_args['alert_button_action'] === 'url' ) {
[80] Fix | Delete
if ( 'yes' === $fields_args['open_link_new_tab_alert'] ) {
[81] Fix | Delete
$button_attr .= ' rel="noopener" target="_blank"';
[82] Fix | Delete
} else if ( 'lightbox' === $fields_args['open_link_new_tab_alert'] ) {
[83] Fix | Delete
$ui_class[]= 'themify_lightbox';
[84] Fix | Delete
if ( $fields_args['lightbox_width'] !== '' || $fields_args['lightbox_height'] !== '' ) {
[85] Fix | Delete
$lightbox_settings = array();
[86] Fix | Delete
$lightbox_settings[] = $fields_args['lightbox_width'] !== '' ? $fields_args['lightbox_width'] . $fields_args['lightbox_width_unit'] : '';
[87] Fix | Delete
$lightbox_settings[] = $fields_args['lightbox_height'] !== '' ? $fields_args['lightbox_height'] . $fields_args['lightbox_height_unit'] : '';
[88] Fix | Delete
$button_attr .= sprintf(' data-zoom-config="%s"', implode('|', $lightbox_settings));
[89] Fix | Delete
$lightbox_settings=null;
[90] Fix | Delete
}
[91] Fix | Delete
}
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
if ($fields_args['alert_button_action'] === 'message' && !empty($fields_args['alert_message_text'])) {
[95] Fix | Delete
$button_attr = ' data-alert-message="' . esc_attr($fields_args['alert_message_text']) . '"';
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
// Alert visibility
[99] Fix | Delete
$is_alert_visible = true;
[100] Fix | Delete
if (Themify_Builder::$frontedit_active===false) {
[101] Fix | Delete
if (!empty($fields_args['alert_no_date_limit']) && (!empty($fields_args['alert_start_at']) || !empty($fields_args['alert_end_at']) )) {
[102] Fix | Delete
$now = time();
[103] Fix | Delete
if (!empty($fields_args['alert_start_at'])) {
[104] Fix | Delete
$is_alert_visible = ( strtotime($fields_args['alert_start_at']) - $now ) < 0;
[105] Fix | Delete
}
[106] Fix | Delete
if ($is_alert_visible===true && !empty($fields_args['alert_end_at'])) {
[107] Fix | Delete
$is_alert_visible = ( $now - strtotime($fields_args['alert_end_at']) ) < 0;
[108] Fix | Delete
}
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
if ($is_alert_visible===true && !empty($fields_args['alert_show_to'])) {
[112] Fix | Delete
if ($fields_args['alert_show_to'] === 'guest') {
[113] Fix | Delete
$is_alert_visible = !is_user_logged_in();
[114] Fix | Delete
}
[115] Fix | Delete
elseif ($fields_args['alert_show_to'] === 'user') {
[116] Fix | Delete
$is_alert_visible = is_user_logged_in();
[117] Fix | Delete
}
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
if ($is_alert_visible===true && !empty($fields_args['alert_limit_count']) && isset($_COOKIE[$element_id])) {
[121] Fix | Delete
$user_cookie = (int) $_COOKIE[ $element_id ];
[122] Fix | Delete
if ( $user_cookie && $user_cookie >= $fields_args['alert_limit_count'] ) {
[123] Fix | Delete
$is_alert_visible = false;
[124] Fix | Delete
}
[125] Fix | Delete
}
[126] Fix | Delete
$container_props['data-lazy']=1;
[127] Fix | Delete
}
[128] Fix | Delete
if ($is_alert_visible===true):
[129] Fix | Delete
$fields_args['title_tag'] = esc_attr( $fields_args['title_tag'] );
[130] Fix | Delete
self::sticky_element_props($container_props,$fields_args);
[131] Fix | Delete
?>
[132] Fix | Delete
<!-- module alert -->
[133] Fix | Delete
<div <?php echo themify_get_element_attributes($container_props); ?>>
[134] Fix | Delete
<?php $container_props=$container_class=$args=null;
[135] Fix | Delete
echo Themify_Builder_Component_Module::get_module_title($fields_args,'mod_title_alert');
[136] Fix | Delete
?>
[137] Fix | Delete
<div class="alert-inner">
[138] Fix | Delete
<div class="alert-content">
[139] Fix | Delete
<<?php echo $fields_args['title_tag'];?> class="alert-heading"><?php echo $fields_args['heading_alert'] ?></<?php echo $fields_args['title_tag'];?>>
[140] Fix | Delete
<div class="tb_text_wrap">
[141] Fix | Delete
<?php echo apply_filters('themify_builder_module_content', $fields_args['text_alert']);?>
[142] Fix | Delete
</div>
[143] Fix | Delete
</div>
[144] Fix | Delete
<!-- /alert-content -->
[145] Fix | Delete
<?php if ($fields_args['action_btn_text_alert']) : ?>
[146] Fix | Delete
<div class="alert-button">
[147] Fix | Delete
<a href="<?php echo $url; ?>" class="<?php echo implode(' ', $ui_class); ?>"<?php echo $button_attr; ?>>
[148] Fix | Delete
<span class="tb_alert_text"><?php echo $fields_args['action_btn_text_alert'] ?></span>
[149] Fix | Delete
</a>
[150] Fix | Delete
</div>
[151] Fix | Delete
<?php endif; ?>
[152] Fix | Delete
</div>
[153] Fix | Delete
<div class="alert-close tf_close"></div>
[154] Fix | Delete
<!-- /alert-content -->
[155] Fix | Delete
</div>
[156] Fix | Delete
<!-- /module alert -->
[157] Fix | Delete
<?php endif; ?>
[158] Fix | Delete
[159] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function