'; $csms = ''; $cmessenger = ''; $ctelegram = ''; $czalo = ''; $cwhatsapp = ''; $cviber = ''; $cskype = ''; $cmail = ''; $cmaps = ''; foreach ($foxtool_options as $key => $value) { if (preg_match('/^chat-nut1(\d+)$/', $key, $matches)) { $i = $matches[1]; if (isset($foxtool_options['chat-nut1'.$i])) { $chat_option = $foxtool_options['chat-nut1'.$i]; $chat_text = isset($foxtool_options['chat-nut2'.$i]) ? $foxtool_options['chat-nut2'.$i] : __('Not entered', 'foxtool'); $chat_value = isset($foxtool_options['chat-nut3'.$i]) ? $foxtool_options['chat-nut3'.$i] : NULL; $chat_icon = isset($foxtool_options['chat-nut4'.$i]) ? $foxtool_options['chat-nut4'.$i] : NULL; $chat_new = isset($foxtool_options['chat-nut-new']) ? 'target="_blank"' : NULL; switch ($chat_option) { case 'Phone': echo ''. $cphone .''. $chat_text .''; break; case 'SMS': echo ''. $csms .''. $chat_text .''; break; case 'Messenger': echo ''. $cmessenger .''. $chat_text .''; break; case 'Telegram': echo ''. $ctelegram .''. $chat_text .''; break; case 'Zalo': echo ''. $czalo .''. $chat_text .''; break; case 'Whatsapp': echo ''. $cwhatsapp .''. $chat_text .''; break; case 'Viber': echo ''. $cviber .''. $chat_text .''; break; case 'Skype': echo ''. $cskype .''. $chat_text .''; break; case 'Mail': echo ''. $cmail .''. $chat_text .''; break; case 'Maps': echo ''. $cmaps .''. $chat_text .''; break; case 'Custom': echo ''. $chat_icon .''. $chat_text .''; break; } } } } } return; } function foxtool_add_chat(){ global $foxtool_options; // chat on if (isset($foxtool_options['chat-nut1'])){ // skin 1 chat $chat_mojs = isset($foxtool_options['chat-nut-js']) ? 'id="chat-mojs"' : null; $chatmo = isset($foxtool_options['chat-nav1']) ? 'chaton-mobile' : NULL; if (isset($foxtool_options['chat-nut-skin']) && $foxtool_options['chat-nut-skin'] == 'Total'){ ?>
>
= 300 ){ $bot = '.ft-chatbox-skin1{bottom:50%;}'; } else { $bot = NULL; } $ope = !empty($foxtool_options['chat-nut-op']) ? '.ft-chatbox-skin1 svg{opacity:'. $foxtool_options['chat-nut-op'] .';}' : NULL; $radi = !empty($foxtool_options['chat-nut-rus']) ? '.ft-chatbox-skin1 i, .ft-chatbox-skin1 svg, .ft-chatbox-skin1 a:hover span{border-radius:'. $foxtool_options['chat-nut-rus'] .'px;}' : NULL; $ico = !empty($foxtool_options['chat-ico-color']) ? '.ft-chatbox-skin1 .ft-cco i{box-shadow: 0 0 0 0px '. $foxtool_options['chat-ico-color'] .';}.ft-cco svg{background:'. $foxtool_options['chat-ico-color'] . ' !important;}' : NULL; if(!empty($foxtool_options['chat-nut-mar'])){ echo ''; } // skin 2 chat } else if (isset($foxtool_options['chat-nut-skin']) && $foxtool_options['chat-nut-skin'] == 'Effective'){ ?>
>
= 300 ){ $bot = '.ft-chatbox-skin2{bottom:50%;}'; } else { $bot = NULL; } $ope = !empty($foxtool_options['chat-nut-op']) ? '.ft-chatbox-skin2 svg{opacity:'. $foxtool_options['chat-nut-op'] .';}' : NULL; $ico = !empty($foxtool_options['chat-ico-color']) ? '.ft-cco svg{background:'. $foxtool_options['chat-ico-color'] . ' !important;}' : NULL; if(!empty($foxtool_options['chat-nut-mar'])){ echo ''; } // skin 3 chat } else if (isset($foxtool_options['chat-nut-skin']) && $foxtool_options['chat-nut-skin'] == 'Leaves'){ ?>
>
= 300 ){ $bot = '.ft-chatbox-skin3{bottom:50%;}'; } else { $bot = NULL; } $ope = !empty($foxtool_options['chat-nut-op']) ? '.ft-chatbox-skin3 svg{opacity:'. $foxtool_options['chat-nut-op'] .';}' : NULL; $radi = !empty($foxtool_options['chat-nut-rus']) ? '.ft-chatbox-skin3 i, .ft-chatbox-skin3 svg, .ft-chatbox-skin3 a:hover span{border-radius:0px '. $foxtool_options['chat-nut-rus'] .'px 0px '. $foxtool_options['chat-nut-rus'] .'px;}' : NULL; $ico = !empty($foxtool_options['chat-ico-color']) ? '.ft-chatbox-skin3 .ft-cco i{box-shadow: 0 0 0 0px '. $foxtool_options['chat-ico-color'] .';}.ft-cco svg{background:'. $foxtool_options['chat-ico-color'] . ' !important;}' : NULL; if(!empty($foxtool_options['chat-nut-mar'])){ echo ''; } // skin 4 chat } else if (isset($foxtool_options['chat-nut-skin']) && $foxtool_options['chat-nut-skin'] == 'Floating'){ ?>
>
= 300 ){ $bot = '.ft-chatbox-skin4{bottom:50%;}'; } else { $bot = NULL; } $ope = !empty($foxtool_options['chat-nut-op']) ? '.ft-chatbox-skin4 svg{opacity:'. $foxtool_options['chat-nut-op'] .';}' : NULL; $radi = !empty($foxtool_options['chat-nut-rus']) ? '.ft-chatbox-skin4 i, .ft-chatbox-skin4 svg, .ft-chatbox-skin4 a:hover span{border-radius:'. $foxtool_options['chat-nut-rus'] .'px;}' : NULL; $ico = !empty($foxtool_options['chat-ico-color']) ? '.ft-chatbox-skin4 .ft-cpho svg path, .ft-chatbox-skin4 .ft-csms svg path, .ft-chatbox-skin4 .ft-cmes svg path, .ft-chatbox-skin4 .ft-ctel svg path, .ft-chatbox-skin4 .ft-czal svg path, .ft-chatbox-skin4 .ft-cwha svg path, .ft-chatbox-skin4 .ft-cvib svg path, .ft-chatbox-skin4 .ft-csky svg path, .ft-chatbox-skin4 .ft-cmai svg path, .ft-chatbox-skin4 .ft-cmap svg path,.ft-chatbox-skin4 .ft-ccus svg path{fill:'. $foxtool_options['chat-ico-color'] . ' !important;} .ft-chatbox-skin4 svg{border:2px solid '. $foxtool_options['chat-ico-color'] . ' !important}' : NULL; if(!empty($foxtool_options['chat-nut-mar'])){ echo ''; } // skin 5 chat } else if (isset($foxtool_options['chat-nut-skin']) && $foxtool_options['chat-nut-skin'] == 'Tap'){ ?>
>
= 300 ){ $bot = '.ft-chatbox-skin5{bottom:50%;}'; } else { $bot = NULL; } $ope = !empty($foxtool_options['chat-nut-op']) ? '.ft-chatbox-skin5{opacity:'. $foxtool_options['chat-nut-op'] .';}' : NULL; $radi = !empty($foxtool_options['chat-nut-rus']) ? '.ft-chatbox-skin5{border-radius:'. $foxtool_options['chat-nut-rus'] .'px;}' : NULL; $ico = !empty($foxtool_options['chat-ico-color']) ? '.ft-chatbox-skin5 .ft-cpho svg path, .ft-chatbox-skin5 .ft-csms svg path, .ft-chatbox-skin5 .ft-cmes svg path, .ft-chatbox-skin5 .ft-ctel svg path, .ft-chatbox-skin5 .ft-czal svg path, .ft-chatbox-skin5 .ft-cwha svg path, .ft-chatbox-skin5 .ft-cvib svg path, .ft-chatbox-skin5 .ft-csky svg path, .ft-chatbox-skin5 .ft-cmai svg path, .ft-chatbox-skin5 .ft-cmap svg path,.ft-chatbox-skin5 .ft-ccus svg path{fill:'. $foxtool_options['chat-ico-color'] . ' !important;}' : NULL; if(!empty($foxtool_options['chat-nut-mar'])){ echo ''; } // skin mac dinh chat } else { $defaultIcon = ''; if (isset($foxtool_options['chat-nut-ico'])) { switch ($foxtool_options['chat-nut-ico']) { case 'Icon2': $ico = ''; break; case 'Icon3': $ico = ''; break; case 'Icon4': $ico = ''; break; case 'Icon5': $ico = ''; break; default: $ico = $defaultIcon; } } else { $ico = $defaultIcon; } ?>
>
= 300 ){ $bot = '.ft-chatbox{bottom:50%;}'; } else { $bot = NULL; } $ope = !empty($foxtool_options['chat-nut-op']) ? '.ft-chatbox #chatona{opacity:'. $foxtool_options['chat-nut-op'] .';}' : NULL; $radi = !empty($foxtool_options['chat-nut-rus']) ? '.ft-chatbox #chatona, .ft-chaton svg{border-radius:'. $foxtool_options['chat-nut-rus'] .'px;}' : NULL; $ico = !empty($foxtool_options['chat-ico-color']) ? '.ft-cco svg{background:'. $foxtool_options['chat-ico-color'] . ' !important;}' : NULL; if(!empty($foxtool_options['chat-nut-mar'])){ echo ''; } } } // chat navi $pages_list = explode("\n", str_replace("\r", "", $foxtool_options['chat-nav-hi'] ?? '')); if(isset($foxtool_options['chat-nav1']) && !is_page($pages_list)){ $navi_mojs = isset($foxtool_options['chat-nav-js']) ? 'id="navi-mojs"' : null; $nav04_id = $foxtool_options['chat-nav04'] ?? ''; if (strpos($nav04_id, '#') === 0) { $id_nav04 = 'id="' . substr($nav04_id, 1) . '"'; } elseif (strpos($nav04_id, '.') === 0) { $id_nav04 = 'class="' . substr($nav04_id, 1) . '"'; } else { $id_nav04 = null; } $nav0_svg = !empty($foxtool_options['chat-nav01']) ? ''. $foxtool_options['chat-nav01']. '' : null; $nav0_tit = !empty($foxtool_options['chat-nav02']) ? $foxtool_options['chat-nav02'] : null; $nav0_link = !empty($foxtool_options['chat-nav03']) ? $id_nav04 .' title="'. $nav0_tit .'" href="'. $foxtool_options['chat-nav03'] .'"' : 'title="'. $nav0_tit .'" onclick="ftnone(event, \'ft-navi-chaton\');"'; $nav0 = !empty($foxtool_options['chat-nav01']) ? ''. $nav0_svg .''. $nav0_tit .'' : null; $nav41_id = $foxtool_options['chat-nav41'] ?? ''; if (strpos($nav41_id, '#') === 0) { $id_nav41 = 'id="' . substr($nav41_id, 1) . '"'; } elseif (strpos($nav41_id, '.') === 0) { $id_nav41 = 'class="' . substr($nav41_id, 1) . '"'; } else { $id_nav41 = null; } $nav1 = !empty($foxtool_options['chat-nav11']) ? ''. $foxtool_options['chat-nav11'] .''. $foxtool_options['chat-nav21'] .'' : null; $nav42_id = $foxtool_options['chat-nav42'] ?? ''; if (strpos($nav42_id, '#') === 0) { $id_nav42 = 'id="' . substr($nav42_id, 1) . '"'; } elseif (strpos($nav42_id, '.') === 0) { $id_nav42 = 'class="' . substr($nav42_id, 1) . '"'; } else { $id_nav42 = null; } $nav2 = !empty($foxtool_options['chat-nav12']) ? ''. $foxtool_options['chat-nav12'] .''. $foxtool_options['chat-nav22'] .'' : null; $nav43_id = $foxtool_options['chat-nav43'] ?? ''; if (strpos($nav43_id, '#') === 0) { $id_nav43 = 'id="' . substr($nav43_id, 1) . '"'; } elseif (strpos($nav43_id, '.') === 0) { $id_nav43 = 'class="' . substr($nav43_id, 1) . '"'; } else { $id_nav43 = null; } $nav3 = !empty($foxtool_options['chat-nav13']) ? ''. $foxtool_options['chat-nav13'] .''. $foxtool_options['chat-nav23'] .'' : null; $nav44_id = $foxtool_options['chat-nav44'] ?? ''; if (strpos($nav44_id, '#') === 0) { $id_nav44 = 'id="' . substr($nav44_id, 1) . '"'; } elseif (strpos($nav44_id, '.') === 0) { $id_nav44 = 'class="' . substr($nav44_id, 1) . '"'; } else { $id_nav44 = null; } $nav4 = !empty($foxtool_options['chat-nav14']) ? ''. $foxtool_options['chat-nav14'] .''. $foxtool_options['chat-nav24'] .'' : null; // chat navi skin $momo1 = ''; $momo2 = ''; if (isset($foxtool_options['chat-nav-skin']) && $foxtool_options['chat-nav-skin'] == 'Simple'){ $navclass1 = 'navi-skin2'; $navclass2 = 'navi-chat-skin2'; $navclass3 = 'ft-navi-cen1'; $navicon = $nav0; } else if (isset($foxtool_options['chat-nav-skin']) && $foxtool_options['chat-nav-skin'] == 'Docky'){ $navclass1 = 'navi-skin3'; $navclass2 = 'navi-chat-skin3'; $navclass3 = 'ft-navi-cen2'; $navicon = $nav0; } else if (isset($foxtool_options['chat-nav-skin']) && $foxtool_options['chat-nav-skin'] == 'Momo'){ $navclass1 = 'navi-skin1'; $navclass2 = 'navi-chat-skin1'; $navclass3 = 'ft-navi-cen-momo'; $navicon = '
'. $nav0_svg .'
'. $nav0_tit .'
'; $momo1 = '
'; $momo2 = '
'; } else if (isset($foxtool_options['chat-nav-skin']) && $foxtool_options['chat-nav-skin'] == 'Lom'){ $navclass1 = 'navi-skin5'; $navclass2 = 'navi-chat-skin5'; $navclass3 = 'ft-navi-cen-momo'; $navicon = '
'. $nav0_svg .'
'. $nav0_tit .'
'; $momo1 = '
'; } else { $navclass1 = 'navi-skin1'; $navclass2 = 'navi-chat-skin1'; $navclass3 = 'ft-navi-cen'; $navicon = '
'. $nav0_svg .'
'. $nav0_tit .'
'; } // chat on on navi if (isset($foxtool_options['chat-nut1']) && empty($foxtool_options['chat-nav03'])){ ?>
>
'. $navi . $radi . $ico .''; } // chat tawk if(isset($foxtool_options['chat-tawk1']) && !empty($foxtool_options['chat-tawk11'])){ echo $foxtool_options['chat-tawk11']; } } add_action('wp_footer', 'foxtool_add_chat'); // menu navi if(isset($foxtool_options['chat-nav1'])){ function foxtool_support_menu() { register_nav_menus( array( 'menu-navi' => __( 'Navigation bar (Foxtool)', 'foxtool' ), ) ); } add_action( 'init', 'foxtool_support_menu' ); }