function LivelyChatSupport_settings_hash_updater() { global $livelychatsupport_addon_version; $old_settings = array("activation_code" => get_option("livelychatsupport_activation_code"), "addons" => get_option("livelychatsupport_addons"), "visible_pages" => stripslashes(get_option("livelychatsupport_visible_pages", "*")), "subscriber_name" => get_option("livelychatsupport_name"), "subscriber_email" => get_option("livelychatsupport_email"), "default_responder_id" => get_option("livelychatsupport_default_responder_id"), "online" => get_option("livelychatsupport_online", "hours"), "colour" => get_option("livelychatsupport_colour", "#570060"), "position" => get_option("livelychatsupport_position", "right"), "offline_thanks" => nl2br(stripslashes(get_option("livelychatsupport_offline_thanks", __("Thanks for contacting us. We'll get back to you as soon as we can.", "lively-chat-support")))), "cta_online_text" => stripslashes(get_option("livelychatsupport_cta_online_text", __("Chat With Us Now!", "lively-chat-support"))), "cta_offline_text" => stripslashes(get_option("livelychatsupport_cta_offline_text", __("Need help? Email Us Here!", "lively-chat-support"))), "cta_online_image" => get_option("livelychatsupport_cta_online_image", ""), "cta_online_image_offset_y" => get_option("livelychatsupport_cta_online_image_offset_y", 200), "cta_online_image_offset_x" => get_option("livelychatsupport_cta_online_image_offset_x", 0), "cta_offline_image" => get_option("livelychatsupport_cta_offline_image", ""), "cta_offline_image_offset_y" => get_option("livelychatsupport_cta_offline_image_offset_y", 200), "cta_offline_image_offset_x" => get_option("livelychatsupport_cta_offline_image_offset_x", 0), "sms_responder_id" => get_option("livelychatsupport_sms_responder_id"), "twilio_sid" => get_option("livelychatsupport_twilio_sid"), "twilio_auth" => get_option("livelychatsupport_twilio_auth"), "twilio_phone" => get_option("livelychatsupport_twilio_phone"), "start" => get_option("livelychatsupport_filter_start", date("F j, Y", current_time("timestamp"))), "finish" => get_option("livelychatsupport_filter_finish", date("F j, Y", current_time("timestamp"))), "show_powered_by" => get_option("livelychatsupport_show_powered_by", "true")); LivelyChatSupport_settings($old_settings); LivelyChatSupport_settings(array("addon_version" => $livelychatsupport_addon_version)); }
global $wpdb; $convos_table = $wpdb->prefix . "livelychatsupport_convos"; if (isset($_GET["convo_token"])) { $convo = $wpdb->get_row("SELECT * FROM {$convos_table} WHERE token = '{$_GET['convo_token']}'"); } else { $convo = null; } if ($convo != null) { if (strtotime($livelychatsupport["start"]) >= strtotime($convo->updated_at)) { $livelychatsupport["start"] = date("F j, Y", current_time("timestamp") - 86400); LivelyChatSupport_settings(array("start" => $livelychatsupport["start"])); } if (strtotime($livelychatsupport["finish"]) <= strtotime($convo->updated_at)) { $livelychatsupport["finish"] = date("F j, Y", current_time("timestamp") + 86400); LivelyChatSupport_settings(array("finish" => $livelychatsupport["finish"])); } } $convos = LivelyChatSupport_find_visitors(); ?> <ul id="online_convos" class="livelychatsupport-sidebar" data-add_convo="<?php echo admin_url('admin-ajax.php'); ?> " data-convos="<?php echo htmlspecialchars(json_encode(array("convos" => $convos))); ?> "> <li> <label> <?php
function LivelyChatSupport_two_hide() { LivelyChatSupport_settings(array("show_feedback" => false)); }
function LivelyChatSupport_activate() { global $livelychatsupport_addon_version; if (isset($_POST["activation_code"])) { $request = new WP_Http(); $result = $request->request('http://guitarvid.com/activation/lively-chat-support/activate.php?code=' . trim($_POST["activation_code"])); $response = json_decode($result["body"]); if ($response->success == 1) { $addons = array(); foreach ($response->files as $file => $data) { array_push($addons, $file); } LivelyChatSupport_settings(array("addons" => implode("|", $addons), "activation_code" => trim($_POST["activation_code"]), "addon_version" => $livelychatsupport_addon_version)); } } }