public static function zopimme() { global $current_user; get_currentuserinfo(); $code = get_option(Zopim_Options::ZOPIM_OPTION_CODE); if (($code == "" || $code == "zopim") && !(isset($_GET['page']) && preg_match("/zopim/", $_GET['page'])) && !preg_match("/zopim/", $_SERVER["SERVER_NAME"])) { return; } echo "<!--Embed from Zopim Live Chat Wordpress Plugin v" . VERSION_NUMBER . "-->\n <!--Start of Zopim Live Chat Script-->\n <script type=\"text/javascript\">\n window.\$zopim||(function(d,s){var z=\$zopim=function(c){z._.push(c)},\$=z.s=\n d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.\n _.push(o)};z._=[];z.set._=[];\$.async=!0;\$.setAttribute('charset','utf-8');\n \$.src='//v2.zopim.com/?" . $code . "';z.t=+new Date;\$.\n type='text/javascript';e.parentNode.insertBefore(\$,e)})(document,'script');\n </script>"; echo '<script>'; if (isset($current_user)) { $firstname = $current_user->display_name; $useremail = $current_user->user_email; if ($firstname != "" && $useremail != "") { echo "\$zopim(function(){\$zopim.livechat.set({name: '{$firstname}', email: '{$useremail}'}); });"; } } echo Zopim_Options::get_widget_options(); echo '</script>'; echo "<!--End of Zopim Live Chat Script-->"; }
?> </div> </a> (<?php echo $messages['open-tab-label']; ?> ) <form method="post" action="admin.php?page=zopim_account_config"> <?php $notices = Zopim_Notices::get_instance(); $notices->do_notices('before_udpate_widget_textarea'); ?> <p> <?php echo $messages['textarea-label']; ?> <br/> <textarea name="widget-options"><?php echo esc_textarea(Zopim_Options::get_widget_options()); ?> </textarea> <br/> <input class="button-primary" type="submit" value="Update widget options"/> </p> </form> </div>