Version Description
It is highly recommended that you upgrade to WP Live Chat Support version 8.0.08 for security reasons.
Download this release
Release Info
Developer | WP-LiveChat |
Plugin | WP Live Chat Support |
Version | 8.0.08 |
Comparing to | |
See all releases |
Code changes from version 8.0.07 to 8.0.08
- css/admin-chat-style.css +74 -0
- functions.php +36 -12
- includes/settings_page.php +1 -1
- js/themes/modern.js +1 -1
- js/wplc_server.js +33 -4
- js/wplc_u.js +14 -14
- js/wplc_u_admin_chat.js +52 -51
- js/wplc_u_node_events.js +8 -7
- readme.txt +13 -1
- wp-live-chat-support.php +95 -49
css/admin-chat-style.css
CHANGED
@@ -440,4 +440,78 @@ span.bleeper-edit-message {
|
|
440 |
cursor: not-allowed;
|
441 |
opacity: .5;
|
442 |
text-decoration: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
}
|
440 |
cursor: not-allowed;
|
441 |
opacity: .5;
|
442 |
text-decoration: none;
|
443 |
+
}
|
444 |
+
|
445 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio,
|
446 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio {
|
447 |
+
height: 30px;
|
448 |
+
top: 4px;
|
449 |
+
padding: 0 10px 0 0;
|
450 |
+
background-color: #e0e0e0;
|
451 |
+
border-radius: 13px;
|
452 |
+
}
|
453 |
+
|
454 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio:hover,
|
455 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio:hover {
|
456 |
+
cursor: pointer;
|
457 |
+
}
|
458 |
+
|
459 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio {
|
460 |
+
top: 14px;
|
461 |
+
padding-right: 35px;
|
462 |
+
padding-left: 10px;
|
463 |
+
}
|
464 |
+
|
465 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio:after,
|
466 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio:before {
|
467 |
+
content: none;
|
468 |
+
}
|
469 |
+
|
470 |
+
.wplc-msg-content-audio-icon {
|
471 |
+
display: inline-block;
|
472 |
+
width: 30px;
|
473 |
+
height: 30px;
|
474 |
+
position: relative;
|
475 |
+
margin-right: 5px;
|
476 |
+
background-color: #0776b8;
|
477 |
+
border-radius: 30px;
|
478 |
+
font-family: FontAwesome;
|
479 |
+
}
|
480 |
+
|
481 |
+
.wplc-msg-content-audio-icon:after {
|
482 |
+
position: absolute;
|
483 |
+
top: 6px;
|
484 |
+
left: 9px;
|
485 |
+
content: '\f130';
|
486 |
+
font-size: 18px;
|
487 |
+
}
|
488 |
+
|
489 |
+
.wplc-admin-message .wplc-msg-content-audio-icon:after {
|
490 |
+
left: 10px;
|
491 |
+
}
|
492 |
+
|
493 |
+
.wplc-user-message .wplc-msg-content-audio-icon {
|
494 |
+
position: absolute;
|
495 |
+
right: 0;
|
496 |
+
margin-right: 0;
|
497 |
+
margin-left: 5px;
|
498 |
+
}
|
499 |
+
|
500 |
+
.wplc-msg-content-audio .messageBody {
|
501 |
+
float: right;
|
502 |
+
vertical-align: middle;
|
503 |
+
}
|
504 |
+
|
505 |
+
#nifty_wrapper .wplc-msg-content-audio .messageBody a {
|
506 |
+
outline: 0;
|
507 |
+
color: #333 !important;
|
508 |
+
font-size: 15px;
|
509 |
+
line-height: 30px;
|
510 |
+
text-decoration: none !important;
|
511 |
+
}
|
512 |
+
|
513 |
+
#nifty_wrapper .wplc-msg-content-audio .messageBody a:active,
|
514 |
+
#nifty_wrapper .wplc-msg-content-audio .messageBody a:focus {
|
515 |
+
outline: 0;
|
516 |
+
box-shadow: none;
|
517 |
}
|
functions.php
CHANGED
@@ -218,7 +218,7 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
|
|
218 |
}
|
219 |
|
220 |
$msg_id = '';
|
221 |
-
|
222 |
if ($other !== false) {
|
223 |
if (!empty($other->msgID)) {
|
224 |
$msg_id = $other->msgID;
|
@@ -234,7 +234,7 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
|
|
234 |
|
235 |
if (!$aid) {
|
236 |
$wplc_current_user = get_current_user_id();
|
237 |
-
|
238 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
|
239 |
$other_data = array('aid'=>$wplc_current_user);
|
240 |
} else {
|
@@ -719,6 +719,7 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
|
|
719 |
|
720 |
$timestamp = strtotime( $result->timestamp );
|
721 |
$other_data['datetime'] = $timestamp;
|
|
|
722 |
|
723 |
//
|
724 |
if($result->originates == 1){
|
@@ -992,7 +993,7 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
992 |
|
993 |
} else if ($result->originates == 0 || $result->originates == 3) {
|
994 |
|
995 |
-
|
996 |
|
997 |
$system_notification = true;
|
998 |
$cuid = get_current_user_id();
|
@@ -1035,9 +1036,9 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
1035 |
$msg = stripslashes($msg);
|
1036 |
}
|
1037 |
|
1038 |
-
if ( isset( $result->afrom ) && intval( $result->afrom ) > 0 ) {
|
1039 |
$msg_array[$id]['afrom'] = intval( $result->afrom ); $other_data['aid'] = intval( $result->afrom );
|
1040 |
-
|
1041 |
}
|
1042 |
if ( isset( $result->ato ) && intval( $result->ato ) > 0 ) { $msg_array[$id]['ato'] = intval( $result->ato ); }
|
1043 |
|
@@ -1058,7 +1059,7 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
1058 |
} else {
|
1059 |
$user_from = 'User';
|
1060 |
}
|
1061 |
-
|
1062 |
|
1063 |
$msg_array[$id]['msg'] = $msg;
|
1064 |
|
@@ -1067,7 +1068,7 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
1067 |
} else {
|
1068 |
$msg_hist .= $user_from . ": " . $msg . "<br />";
|
1069 |
}
|
1070 |
-
|
1071 |
|
1072 |
$msg_array[$id]['originates'] = $result->originates;
|
1073 |
$msg_array[$id]['other'] = $other_data;
|
@@ -1234,6 +1235,7 @@ function wplc_return_admin_chat_messages($cid) {
|
|
1234 |
|
1235 |
$timestamp = strtotime( $result->timestamp );
|
1236 |
$other_data['datetime'] = $timestamp;
|
|
|
1237 |
|
1238 |
if (intval($result->originates) == 3) {
|
1239 |
/*
|
@@ -2100,11 +2102,20 @@ function wplc_admin_display_missed_chats() {
|
|
2100 |
</thead>
|
2101 |
<tbody id=\"the-list\" class='list:wp_list_text_link'>";
|
2102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2103 |
|
2104 |
if (function_exists("wplc_register_pro_version")) {
|
2105 |
-
$sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0) ORDER BY `timestamp` DESC";
|
2106 |
} else {
|
2107 |
-
$sql = "SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC";
|
2108 |
}
|
2109 |
|
2110 |
$results = $wpdb->get_results($sql);
|
@@ -2122,9 +2133,9 @@ function wplc_admin_display_missed_chats() {
|
|
2122 |
";
|
2123 |
|
2124 |
echo "<tr id=\"record_" . $result->id . "\">";
|
2125 |
-
echo "<td class='chat_id column-chat_d'>" . $result->timestamp . "</td>";
|
2126 |
-
echo "<td class='chat_name column_chat_name' id='chat_name_" . $result->id . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=30\" class='wplc-user-message-avatar' /> " . $result->name . "</td>";
|
2127 |
-
echo "<td class='chat_email column_chat_email' id='chat_email_" . $result->id . "'><a href='mailto:" . $result->email . "' title='Email " . ".$result->email." . "'>" . $result->email . "</a></td>";
|
2128 |
echo "<td class='chat_name column_chat_url' id='chat_url_" . $result->id . "'>" . esc_url($result->url) . "</td>";
|
2129 |
echo "<td class='chat_name column_chat_url'>".$actions."</td>";
|
2130 |
echo "</tr>";
|
@@ -2134,6 +2145,19 @@ function wplc_admin_display_missed_chats() {
|
|
2134 |
echo "
|
2135 |
</tbody>
|
2136 |
</table>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2137 |
}
|
2138 |
|
2139 |
|
218 |
}
|
219 |
|
220 |
$msg_id = '';
|
221 |
+
|
222 |
if ($other !== false) {
|
223 |
if (!empty($other->msgID)) {
|
224 |
$msg_id = $other->msgID;
|
234 |
|
235 |
if (!$aid) {
|
236 |
$wplc_current_user = get_current_user_id();
|
237 |
+
|
238 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
|
239 |
$other_data = array('aid'=>$wplc_current_user);
|
240 |
} else {
|
719 |
|
720 |
$timestamp = strtotime( $result->timestamp );
|
721 |
$other_data['datetime'] = $timestamp;
|
722 |
+
$other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
|
723 |
|
724 |
//
|
725 |
if($result->originates == 1){
|
993 |
|
994 |
} else if ($result->originates == 0 || $result->originates == 3) {
|
995 |
|
996 |
+
|
997 |
|
998 |
$system_notification = true;
|
999 |
$cuid = get_current_user_id();
|
1036 |
$msg = stripslashes($msg);
|
1037 |
}
|
1038 |
|
1039 |
+
if ( isset( $result->afrom ) && intval( $result->afrom ) > 0 ) {
|
1040 |
$msg_array[$id]['afrom'] = intval( $result->afrom ); $other_data['aid'] = intval( $result->afrom );
|
1041 |
+
|
1042 |
}
|
1043 |
if ( isset( $result->ato ) && intval( $result->ato ) > 0 ) { $msg_array[$id]['ato'] = intval( $result->ato ); }
|
1044 |
|
1059 |
} else {
|
1060 |
$user_from = 'User';
|
1061 |
}
|
1062 |
+
|
1063 |
|
1064 |
$msg_array[$id]['msg'] = $msg;
|
1065 |
|
1068 |
} else {
|
1069 |
$msg_hist .= $user_from . ": " . $msg . "<br />";
|
1070 |
}
|
1071 |
+
|
1072 |
|
1073 |
$msg_array[$id]['originates'] = $result->originates;
|
1074 |
$msg_array[$id]['other'] = $other_data;
|
1235 |
|
1236 |
$timestamp = strtotime( $result->timestamp );
|
1237 |
$other_data['datetime'] = $timestamp;
|
1238 |
+
$other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
|
1239 |
|
1240 |
if (intval($result->originates) == 3) {
|
1241 |
/*
|
2102 |
</thead>
|
2103 |
<tbody id=\"the-list\" class='list:wp_list_text_link'>";
|
2104 |
|
2105 |
+
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
|
2106 |
+
$limit = 20; // number of rows in page
|
2107 |
+
$offset = ( $pagenum - 1 ) * $limit;
|
2108 |
+
if (function_exists("wplc_register_pro_version")) {
|
2109 |
+
$total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0)" );
|
2110 |
+
} else {
|
2111 |
+
$total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE `status` = 0" );
|
2112 |
+
}
|
2113 |
+
$num_of_pages = ceil( $total / $limit );
|
2114 |
|
2115 |
if (function_exists("wplc_register_pro_version")) {
|
2116 |
+
$sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0) ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
|
2117 |
} else {
|
2118 |
+
$sql = "SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
|
2119 |
}
|
2120 |
|
2121 |
$results = $wpdb->get_results($sql);
|
2133 |
";
|
2134 |
|
2135 |
echo "<tr id=\"record_" . $result->id . "\">";
|
2136 |
+
echo "<td class='chat_id column-chat_d'>" . sanitize_text_field($result->timestamp) . "</td>";
|
2137 |
+
echo "<td class='chat_name column_chat_name' id='chat_name_" . $result->id . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=30\" class='wplc-user-message-avatar' /> " . sanitize_text_field($result->name) . "</td>";
|
2138 |
+
echo "<td class='chat_email column_chat_email' id='chat_email_" . $result->id . "'><a href='mailto:" . sanitize_text_field($result->email) . "' title='Email " . ".$result->email." . "'>" . sanitize_text_field($result->email) . "</a></td>";
|
2139 |
echo "<td class='chat_name column_chat_url' id='chat_url_" . $result->id . "'>" . esc_url($result->url) . "</td>";
|
2140 |
echo "<td class='chat_name column_chat_url'>".$actions."</td>";
|
2141 |
echo "</tr>";
|
2145 |
echo "
|
2146 |
</tbody>
|
2147 |
</table>";
|
2148 |
+
|
2149 |
+
$page_links = paginate_links( array(
|
2150 |
+
'base' => add_query_arg( 'pagenum', '%#%' ),
|
2151 |
+
'format' => '',
|
2152 |
+
'prev_text' => __( '«', 'wplivechat' ),
|
2153 |
+
'next_text' => __( '»', 'wplivechat' ),
|
2154 |
+
'total' => $num_of_pages,
|
2155 |
+
'current' => $pagenum
|
2156 |
+
) );
|
2157 |
+
|
2158 |
+
if ( $page_links ) {
|
2159 |
+
echo '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0;float:none;text-align:center;">' . $page_links . '</div></div>';
|
2160 |
+
}
|
2161 |
}
|
2162 |
|
2163 |
|
includes/settings_page.php
CHANGED
@@ -511,7 +511,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
|
|
511 |
</td>
|
512 |
</tr>
|
513 |
<?php
|
514 |
-
if(defined('
|
515 |
{
|
516 |
?>
|
517 |
<tr>
|
511 |
</td>
|
512 |
</tr>
|
513 |
<?php
|
514 |
+
if(defined('WPLC_PRO_PLUGIN'))
|
515 |
{
|
516 |
?>
|
517 |
<tr>
|
js/themes/modern.js
CHANGED
@@ -249,7 +249,7 @@ jQuery(document).on( "wplc_open_chat_2", function( e ) {
|
|
249 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
250 |
|
251 |
|
252 |
-
if (Cookies.get('wplc_minimize') === 'yes') { } else {
|
253 |
|
254 |
jQuery("#wp-live-chat-1").hide();
|
255 |
jQuery("#wp-live-chat-2-inner").hide();
|
249 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
250 |
|
251 |
|
252 |
+
if (Cookies.get('wplc_minimize') === 'yes' && !jQuery("#wp-live-chat-header").hasClass("active")) { } else {
|
253 |
|
254 |
jQuery("#wp-live-chat-1").hide();
|
255 |
jQuery("#wp-live-chat-2-inner").hide();
|
js/wplc_server.js
CHANGED
@@ -649,7 +649,7 @@ function wplc_add_date_and_time(the_message,originates) {
|
|
649 |
.replace( /h/g, time_hours_12 < 10 ? '0' + time_hours_12 : time_hours_12 )
|
650 |
.replace( /G/g, time_hours_24 )
|
651 |
.replace( /H/g, time_hours_24 < 10 ? '0' + time_hours_24 : time_hours_24 )
|
652 |
-
.replace( /i/g, time_minutes < 10 ? '0' +
|
653 |
.replace( /a/g, time_am_pm.toLowerCase() )
|
654 |
.replace( /A/g, time_am_pm.toUpperCase() );
|
655 |
|
@@ -745,6 +745,9 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
745 |
|
746 |
var message_edit_string = "";
|
747 |
|
|
|
|
|
|
|
748 |
if (parseInt(the_message.originates) === 1) {
|
749 |
//From Admin
|
750 |
|
@@ -759,6 +762,12 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
759 |
}
|
760 |
message_class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
|
761 |
|
|
|
|
|
|
|
|
|
|
|
|
|
762 |
if (aoru === 'u') {
|
763 |
|
764 |
/* message came from admin, intended for user */
|
@@ -820,6 +829,12 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
820 |
} else {
|
821 |
/* most likely from the user */
|
822 |
message_class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
|
|
|
|
|
|
|
|
|
|
|
|
|
823 |
if (aoru === 'u') {
|
824 |
message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
|
825 |
|
@@ -878,6 +893,9 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
878 |
if (message_content !== ""){
|
879 |
message_content = wplc_sanitize_attributes(message_content);
|
880 |
|
|
|
|
|
|
|
881 |
// Open the HTML of a message
|
882 |
var concatenated_message = "<span class='" + message_class + "' mid='"+the_message.mid+"'>";
|
883 |
|
@@ -888,9 +906,15 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
888 |
}
|
889 |
|
890 |
// Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
|
|
|
|
|
|
|
891 |
concatenated_message += "<div class='wplc-msg-content' mid='"+the_message.mid+"'>";
|
892 |
-
|
893 |
-
|
|
|
|
|
|
|
894 |
concatenated_message += message_from;
|
895 |
}
|
896 |
} else {
|
@@ -899,7 +923,9 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
899 |
}
|
900 |
|
901 |
var original_message = message_content;
|
902 |
-
|
|
|
|
|
903 |
message_content = niftyFormatParser(message_content);
|
904 |
}
|
905 |
|
@@ -907,6 +933,9 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
907 |
if (gifExtensionPattern.test(message_content)) {
|
908 |
cleanedGif = getCleanedGif(message_content);
|
909 |
concatenated_message += "<span class='messageBody' data-message='"+ cleanedGif +"'><img src='"+ cleanedGif + "' class='gif-img'/></span>"+ message_edit_string;
|
|
|
|
|
|
|
910 |
} else {
|
911 |
// If it is a regular message
|
912 |
concatenated_message += "<span class='messageBody' data-message='" + original_message + "'>"+message_content+"</span>"+ message_edit_string;
|
649 |
.replace( /h/g, time_hours_12 < 10 ? '0' + time_hours_12 : time_hours_12 )
|
650 |
.replace( /G/g, time_hours_24 )
|
651 |
.replace( /H/g, time_hours_24 < 10 ? '0' + time_hours_24 : time_hours_24 )
|
652 |
+
.replace( /i/g, time_minutes < 10 ? '0' + time_minutes : time_minutes )
|
653 |
.replace( /a/g, time_am_pm.toLowerCase() )
|
654 |
.replace( /A/g, time_am_pm.toUpperCase() );
|
655 |
|
745 |
|
746 |
var message_edit_string = "";
|
747 |
|
748 |
+
var audioPattern = new RegExp(/-blob.wav/);
|
749 |
+
var isAudioPattern = false;
|
750 |
+
|
751 |
if (parseInt(the_message.originates) === 1) {
|
752 |
//From Admin
|
753 |
|
762 |
}
|
763 |
message_class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
|
764 |
|
765 |
+
// If it is audio message
|
766 |
+
isAudioPattern = audioPattern.test(the_message.msg);
|
767 |
+
if (isAudioPattern) {
|
768 |
+
message_class += " wplc-user-message-audio";
|
769 |
+
}
|
770 |
+
|
771 |
if (aoru === 'u') {
|
772 |
|
773 |
/* message came from admin, intended for user */
|
829 |
} else {
|
830 |
/* most likely from the user */
|
831 |
message_class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
|
832 |
+
|
833 |
+
isAudioPattern = audioPattern.test(the_message.msg);
|
834 |
+
if (isAudioPattern) {
|
835 |
+
message_class += " wplc-user-message-audio";
|
836 |
+
}
|
837 |
+
|
838 |
if (aoru === 'u') {
|
839 |
message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
|
840 |
|
893 |
if (message_content !== ""){
|
894 |
message_content = wplc_sanitize_attributes(message_content);
|
895 |
|
896 |
+
// If it is audio message
|
897 |
+
isAudioPattern = audioPattern.test(message_content);
|
898 |
+
|
899 |
// Open the HTML of a message
|
900 |
var concatenated_message = "<span class='" + message_class + "' mid='"+the_message.mid+"'>";
|
901 |
|
906 |
}
|
907 |
|
908 |
// Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
|
909 |
+
if (isAudioPattern) {
|
910 |
+
concatenated_message += "<div class='wplc-msg-content wplc-msg-content-audio' mid='" + the_message.mid + "'>";
|
911 |
+
} else {
|
912 |
concatenated_message += "<div class='wplc-msg-content' mid='"+the_message.mid+"'>";
|
913 |
+
}
|
914 |
+
|
915 |
+
if (isAudioPattern) {
|
916 |
+
concatenated_message += "<span class='wplc-msg-content-audio-icon'></span>";
|
917 |
+
} else if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
|
918 |
concatenated_message += message_from;
|
919 |
}
|
920 |
} else {
|
923 |
}
|
924 |
|
925 |
var original_message = message_content;
|
926 |
+
if (isAudioPattern) {
|
927 |
+
message_content = "<a href='" + message_content + "' target='_blank'>" + wplc_visitor_voice.play_sound + "</a>";
|
928 |
+
} else if (typeof niftyFormatParser !== "undefined"){
|
929 |
message_content = niftyFormatParser(message_content);
|
930 |
}
|
931 |
|
933 |
if (gifExtensionPattern.test(message_content)) {
|
934 |
cleanedGif = getCleanedGif(message_content);
|
935 |
concatenated_message += "<span class='messageBody' data-message='"+ cleanedGif +"'><img src='"+ cleanedGif + "' class='gif-img'/></span>"+ message_edit_string;
|
936 |
+
} else if (isAudioPattern) {
|
937 |
+
// If it is audio pattern
|
938 |
+
concatenated_message += "<span class='messageBody'>"+message_content+"</span>";
|
939 |
} else {
|
940 |
// If it is a regular message
|
941 |
concatenated_message += "<span class='messageBody' data-message='" + original_message + "'>"+message_content+"</span>"+ message_edit_string;
|
js/wplc_u.js
CHANGED
@@ -56,7 +56,7 @@ var wplc_long_poll_delay = 1500;
|
|
56 |
|
57 |
|
58 |
jQuery(document).ready(function() {
|
59 |
-
|
60 |
/* Gutenberg functions */
|
61 |
jQuery('.wp-block-wp-live-chat-support-wplc-chat-box').on('click',function(){
|
62 |
jQuery("#wplc_hovercard").fadeOut("fast");
|
@@ -64,7 +64,7 @@ jQuery(document).ready(function() {
|
|
64 |
wplc_is_chat_open = true;
|
65 |
jQuery.event.trigger({type: "wplc_open_chat"});
|
66 |
});
|
67 |
-
|
68 |
wplc_map_node_variables();
|
69 |
|
70 |
/* preload the images */
|
@@ -205,9 +205,9 @@ jQuery(document).ready(function() {
|
|
205 |
|
206 |
wplc_call_to_server_chat(data,true,false);
|
207 |
}
|
208 |
-
|
209 |
if(wplc_cid !== null && wplc_init_chat_box_check == true && wplc_init_chat_box !== false){
|
210 |
-
|
211 |
wplc_init_chat_box(wplc_cid,wplc_chat_status);
|
212 |
} else {
|
213 |
//Node and offline
|
@@ -537,7 +537,7 @@ function wplc_loop_response_handler(response, data){
|
|
537 |
wplc_scroll_to_bottom();
|
538 |
});
|
539 |
|
540 |
-
|
541 |
}
|
542 |
}
|
543 |
}
|
@@ -811,11 +811,11 @@ function wplc_cbox_animation() {
|
|
811 |
break;
|
812 |
}
|
813 |
|
814 |
-
//jQuery("#wp-live-chat").css({ "display" : "block" });
|
815 |
if(jQuery("#wp-live-chat").attr('wplc-auto-pop-up') === "1"){
|
816 |
|
817 |
var wplc_force_must_min = Cookies.get('wplc_minimize');
|
818 |
-
if(wplc_force_must_min === 'yes'){
|
819 |
/* User has actively chosen to minimize the chat, leave it alone */
|
820 |
} else {
|
821 |
setTimeout(function(){
|
@@ -890,26 +890,26 @@ function wplc_strip(str) {
|
|
890 |
}
|
891 |
|
892 |
(function($) {
|
893 |
-
|
894 |
$(document).ready(function(event) {
|
895 |
-
|
896 |
if(!window.wdtEmojiBundle)
|
897 |
return;
|
898 |
-
|
899 |
$(document.body).on("click", function(event) {
|
900 |
-
|
901 |
// If click event isn't on the emoji window, or the emoji open button, close the emoji window
|
902 |
if($(event.target).closest(".wdt-emoji-picker, .wdt-emoji-popup").length == 0 && !(
|
903 |
event.target.parentNode == null && $(event.target).hasClass("fa-smile-o")
|
904 |
))
|
905 |
wdtEmojiBundle.close();
|
906 |
-
|
907 |
});
|
908 |
-
|
909 |
// Close emoji window on scroll
|
910 |
$(window).scroll(function(event) {
|
911 |
wdtEmojiBundle.close();
|
912 |
});
|
913 |
});
|
914 |
-
|
915 |
})(jQuery);
|
56 |
|
57 |
|
58 |
jQuery(document).ready(function() {
|
59 |
+
|
60 |
/* Gutenberg functions */
|
61 |
jQuery('.wp-block-wp-live-chat-support-wplc-chat-box').on('click',function(){
|
62 |
jQuery("#wplc_hovercard").fadeOut("fast");
|
64 |
wplc_is_chat_open = true;
|
65 |
jQuery.event.trigger({type: "wplc_open_chat"});
|
66 |
});
|
67 |
+
|
68 |
wplc_map_node_variables();
|
69 |
|
70 |
/* preload the images */
|
205 |
|
206 |
wplc_call_to_server_chat(data,true,false);
|
207 |
}
|
208 |
+
|
209 |
if(wplc_cid !== null && wplc_init_chat_box_check == true && wplc_init_chat_box !== false){
|
210 |
+
|
211 |
wplc_init_chat_box(wplc_cid,wplc_chat_status);
|
212 |
} else {
|
213 |
//Node and offline
|
537 |
wplc_scroll_to_bottom();
|
538 |
});
|
539 |
|
540 |
+
wplc_new_message_sound = true;
|
541 |
}
|
542 |
}
|
543 |
}
|
811 |
break;
|
812 |
}
|
813 |
|
814 |
+
//jQuery("#wp-live-chat").css({ "display" : "block" });
|
815 |
if(jQuery("#wp-live-chat").attr('wplc-auto-pop-up') === "1"){
|
816 |
|
817 |
var wplc_force_must_min = Cookies.get('wplc_minimize');
|
818 |
+
if(wplc_force_must_min === 'yes'){
|
819 |
/* User has actively chosen to minimize the chat, leave it alone */
|
820 |
} else {
|
821 |
setTimeout(function(){
|
890 |
}
|
891 |
|
892 |
(function($) {
|
893 |
+
|
894 |
$(document).ready(function(event) {
|
895 |
+
|
896 |
if(!window.wdtEmojiBundle)
|
897 |
return;
|
898 |
+
|
899 |
$(document.body).on("click", function(event) {
|
900 |
+
|
901 |
// If click event isn't on the emoji window, or the emoji open button, close the emoji window
|
902 |
if($(event.target).closest(".wdt-emoji-picker, .wdt-emoji-popup").length == 0 && !(
|
903 |
event.target.parentNode == null && $(event.target).hasClass("fa-smile-o")
|
904 |
))
|
905 |
wdtEmojiBundle.close();
|
906 |
+
|
907 |
});
|
908 |
+
|
909 |
// Close emoji window on scroll
|
910 |
$(window).scroll(function(event) {
|
911 |
wdtEmojiBundle.close();
|
912 |
});
|
913 |
});
|
914 |
+
|
915 |
})(jQuery);
|
js/wplc_u_admin_chat.js
CHANGED
@@ -31,7 +31,7 @@ function wplc_admin_retry_handler(data){
|
|
31 |
},500);
|
32 |
}
|
33 |
|
34 |
-
if (typeof wplc_action2 !== "undefined" && wplc_action2 !== "") {
|
35 |
|
36 |
var data = {
|
37 |
action: 'wplc_admin_long_poll_chat',
|
@@ -63,7 +63,7 @@ jQuery(document).ready(function(){
|
|
63 |
var htmlToParse = jQuery(".admin_chat_box_inner").html();
|
64 |
jQuery(".admin_chat_box_inner").html(niftyFormatParser(htmlToParse));
|
65 |
}
|
66 |
-
|
67 |
});
|
68 |
|
69 |
function wplc_call_to_server_admin_chat(data) {
|
@@ -75,7 +75,7 @@ function wplc_call_to_server_admin_chat(data) {
|
|
75 |
|
76 |
wplc_server_last_loop_data = data;
|
77 |
|
78 |
-
wplc_server.send(wplc_ajaxurl, data, "POST", 120000,
|
79 |
function (response) {
|
80 |
wplc_poll_delay = 1500;
|
81 |
wplc_loop_response_handler(response);
|
@@ -126,7 +126,7 @@ function wplc_loop_response_handler(response){
|
|
126 |
if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
|
127 |
|
128 |
response = JSON.parse(response);
|
129 |
-
|
130 |
|
131 |
jQuery.event.trigger({type: "wplc_admin_chat_loop",response:response});
|
132 |
|
@@ -144,7 +144,7 @@ function wplc_loop_response_handler(response){
|
|
144 |
the_message = response['chat_history'][k];
|
145 |
the_message.mid = k;
|
146 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
147 |
-
wplc_scroll_to_bottom();
|
148 |
});
|
149 |
|
150 |
}
|
@@ -156,30 +156,31 @@ function wplc_loop_response_handler(response){
|
|
156 |
}
|
157 |
if (response['action'] === "wplc_new_chat_message") {
|
158 |
jQuery("#wplc_user_typing").fadeOut("slow").remove();
|
159 |
-
|
160 |
current_len = jQuery("#admin_chat_box_area_" + cid).html().length;
|
161 |
|
162 |
if (typeof response['chat_message'] === "object") {
|
163 |
for (k in response['chat_message']) {
|
164 |
response['chat_message'][k].mid = k;
|
165 |
wplc_push_message_to_chatbox(response['chat_message'][k], 'a', function() {
|
166 |
-
wplc_scroll_to_bottom();
|
167 |
});
|
168 |
-
|
169 |
}
|
170 |
} else {
|
171 |
wplc_push_message_to_chatbox(response['chat_message'], 'a', function() {
|
172 |
wplc_scroll_to_bottom();
|
173 |
});
|
174 |
|
175 |
-
new_length = jQuery("#admin_chat_box_area_" + cid).html().length;
|
176 |
-
|
177 |
-
if (current_len < new_length) {
|
178 |
-
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1" && ! (/User is browsing <small/.test(response['chat_message']))) {
|
179 |
-
new Audio(wplc_ding_file).play()
|
180 |
-
}
|
181 |
-
}
|
182 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
}
|
184 |
if (response['action'] === "wplc_user_open_chat") {
|
185 |
data['action_2'] = "";
|
@@ -192,13 +193,13 @@ function wplc_loop_response_handler(response){
|
|
192 |
var the_message = response['data'][index];
|
193 |
the_message.mid = index;
|
194 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
195 |
-
wplc_scroll_to_bottom();
|
196 |
-
});
|
197 |
-
|
198 |
|
199 |
}
|
200 |
}
|
201 |
-
}
|
202 |
}
|
203 |
}
|
204 |
|
@@ -207,7 +208,7 @@ function wplc_loop_response_handler(response){
|
|
207 |
*/
|
208 |
function wplc_scroll_to_bottom() {
|
209 |
var height = jQuery('#admin_chat_box_area_' + cid)[0].scrollHeight;
|
210 |
-
jQuery('#admin_chat_box_area_' + cid).scrollTop(height);
|
211 |
}
|
212 |
|
213 |
function wplc_display_error(error) {
|
@@ -237,9 +238,9 @@ function wplc_display_chat_status_update(new_chat_status, cid) {
|
|
237 |
var wplc_d = new Date();
|
238 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
239 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
240 |
-
wplc_scroll_to_bottom();
|
241 |
});
|
242 |
-
|
243 |
}
|
244 |
else if (chat_status === "3" && previous_chat_status === "10") {
|
245 |
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string3+"</em><br />");
|
@@ -250,7 +251,7 @@ function wplc_display_chat_status_update(new_chat_status, cid) {
|
|
250 |
var wplc_d = new Date();
|
251 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
252 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
253 |
-
wplc_scroll_to_bottom();
|
254 |
});
|
255 |
}
|
256 |
else if (chat_status === "1" || chat_status === "8") {
|
@@ -262,12 +263,12 @@ function wplc_display_chat_status_update(new_chat_status, cid) {
|
|
262 |
var wplc_d = new Date();
|
263 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
264 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
265 |
-
wplc_scroll_to_bottom();
|
266 |
document.getElementById('wplc_admin_chatmsg').disabled = true;
|
267 |
});
|
268 |
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string4+"</em><br />");
|
269 |
wplc_scroll_to_bottom();
|
270 |
-
|
271 |
jQuery(".admin_chat_box_inner_bottom").hide();
|
272 |
jQuery(".admin_chat_quick_controls").hide();
|
273 |
jQuery(".end_chat_div").hide();
|
@@ -297,14 +298,14 @@ jQuery(document).ready(function () {
|
|
297 |
if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
|
298 |
var firstRunData = data;
|
299 |
firstRunData.first_run = "true";
|
300 |
-
WPLCServer.Ajax.send(wplc_ajaxurl, firstRunData, "POST", 120000,
|
301 |
function (response) {
|
302 |
wplc_poll_delay = 1500; //This section is not really relevant as this wont run again, but copy and paste haha
|
303 |
wplc_loop_response_handler(response);
|
304 |
}
|
305 |
);
|
306 |
}
|
307 |
-
|
308 |
if (typeof wplc_action2 !== "undefined" && wplc_action2 !== "") { return; }
|
309 |
|
310 |
if (jQuery('#wplc_admin_cid').length) {
|
@@ -350,7 +351,7 @@ jQuery(document).ready(function () {
|
|
350 |
|
351 |
};
|
352 |
jQuery.post(wplc_ajaxurl, data, function (response) {
|
353 |
-
|
354 |
window.close();
|
355 |
});
|
356 |
|
@@ -362,11 +363,11 @@ jQuery(document).ready(function () {
|
|
362 |
str=str.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1) ");
|
363 |
str=str.replace(/<(?:.|\s)*?>/g, "");
|
364 |
|
365 |
-
str=str.replace('iframe', "");
|
366 |
-
str=str.replace('src', "");
|
367 |
-
str=str.replace('href', "");
|
368 |
-
str=str.replace('<', "");
|
369 |
-
str=str.replace('>', "");
|
370 |
|
371 |
return str;
|
372 |
}
|
@@ -387,7 +388,7 @@ jQuery(document).ready(function () {
|
|
387 |
} else {
|
388 |
wplc_name = wplc_name;
|
389 |
}
|
390 |
-
|
391 |
jQuery("#wplc_admin_chatmsg").val('');
|
392 |
|
393 |
if(wplc_chat !== ""){
|
@@ -399,7 +400,7 @@ jQuery(document).ready(function () {
|
|
399 |
if(typeof niftyFormatParser !== "undefined"){
|
400 |
//PRO
|
401 |
wplc_chat_parsed = niftyFormatParser(wplc_chat_parsed);
|
402 |
-
}
|
403 |
the_message = {};
|
404 |
the_message.originates = 1;
|
405 |
the_message.aid = wplc_extra_data.agent_id;
|
@@ -408,9 +409,9 @@ jQuery(document).ready(function () {
|
|
408 |
var wplc_d = new Date();
|
409 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
410 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
411 |
-
wplc_scroll_to_bottom();
|
412 |
});
|
413 |
-
|
414 |
|
415 |
|
416 |
wplc_extra_data.msg_data = {};
|
@@ -419,7 +420,7 @@ jQuery(document).ready(function () {
|
|
419 |
if (typeof wplc_admin_agent_email !== "undefined")
|
420 |
wplc_extra_data.msg_data.aemail = wplc_admin_agent_email;
|
421 |
|
422 |
-
|
423 |
|
424 |
var data = {
|
425 |
action: 'wplc_admin_send_msg',
|
@@ -428,12 +429,12 @@ jQuery(document).ready(function () {
|
|
428 |
msg: wplc_chat_parsed,
|
429 |
wplc_extra_data:wplc_extra_data
|
430 |
};
|
431 |
-
|
432 |
if(typeof wplc_admin_agent_name !== "undefined"){
|
433 |
data.msg_from_print = wplc_admin_agent_name;
|
434 |
}
|
435 |
|
436 |
-
wplc_server.sendMessage(wplc_ajaxurl, data, "POST", 120000,
|
437 |
function(){
|
438 |
//Success
|
439 |
wplc_server.asyncStorage(wplc_ajaxurl, data, 120000);
|
@@ -458,7 +459,7 @@ function niftyShareFile(fileToUpload, failedID, successID, uploadingID, original
|
|
458 |
formData.append('file', fileToUpload);
|
459 |
formData.append('timestamp', Date.now());
|
460 |
formData.append('security', wplc_ajax_nonce );
|
461 |
-
|
462 |
/*Handle jQuery Elements*/
|
463 |
jQuery(uploadingID).show();
|
464 |
jQuery(originalID).hide();
|
@@ -473,20 +474,20 @@ function niftyShareFile(fileToUpload, failedID, successID, uploadingID, original
|
|
473 |
type : 'POST',
|
474 |
data : formData,
|
475 |
cache: false,
|
476 |
-
processData: false,
|
477 |
-
contentType: false,
|
478 |
-
success : function(data) {
|
479 |
if(parseInt(data) !== 0){
|
480 |
jQuery(uploadingID).hide();
|
481 |
jQuery(successID).show();
|
482 |
setTimeout(function(){
|
483 |
jQuery(successID).hide();
|
484 |
-
jQuery(originalID).show();
|
485 |
}, 2000);
|
486 |
|
487 |
-
//All good post the link to file
|
488 |
var tag = (data.indexOf(".png") !== -1 || data.indexOf(".PNG") !== -1 || data.indexOf(".jpg") !== -1 || data.indexOf(".JPG") !== -1 || data.indexOf(".jpeg") !== -1 || data.indexOf(".gif") !== -1 || data.indexOf(".bmp")!== -1 ) ? "img" : "link";
|
489 |
-
|
490 |
if(tag !== "img"){
|
491 |
tag = (data.indexOf(".mp4") !== -1 || data.indexOf(".mpeg4") !== -1 || data.indexOf(".webm") !== -1 || data.indexOf(".oog") !== -1 ) ? "video" : "link"; //video now
|
492 |
}
|
@@ -498,7 +499,7 @@ function niftyShareFile(fileToUpload, failedID, successID, uploadingID, original
|
|
498 |
jQuery(failedID).show();
|
499 |
setTimeout(function(){
|
500 |
jQuery(failedID).hide();
|
501 |
-
jQuery(originalID).show();
|
502 |
}, 2000);
|
503 |
|
504 |
}
|
@@ -508,7 +509,7 @@ function niftyShareFile(fileToUpload, failedID, successID, uploadingID, original
|
|
508 |
jQuery(failedID).show();
|
509 |
setTimeout(function(){
|
510 |
jQuery(failedID).hide();
|
511 |
-
jQuery(originalID).show();
|
512 |
}, 2000);
|
513 |
}
|
514 |
});
|
@@ -518,7 +519,7 @@ function niftyShareFile(fileToUpload, failedID, successID, uploadingID, original
|
|
518 |
jQuery(failedID).show();
|
519 |
setTimeout(function(){
|
520 |
jQuery(failedID).hide();
|
521 |
-
jQuery(originalID).show();
|
522 |
}, 2000);
|
523 |
}
|
524 |
} else{
|
@@ -527,7 +528,7 @@ function niftyShareFile(fileToUpload, failedID, successID, uploadingID, original
|
|
527 |
jQuery(failedID).show();
|
528 |
setTimeout(function(){
|
529 |
jQuery(failedID).hide();
|
530 |
-
jQuery(originalID).show();
|
531 |
}, 2000);
|
532 |
}
|
533 |
}
|
31 |
},500);
|
32 |
}
|
33 |
|
34 |
+
if (typeof wplc_action2 !== "undefined" && wplc_action2 !== "") {
|
35 |
|
36 |
var data = {
|
37 |
action: 'wplc_admin_long_poll_chat',
|
63 |
var htmlToParse = jQuery(".admin_chat_box_inner").html();
|
64 |
jQuery(".admin_chat_box_inner").html(niftyFormatParser(htmlToParse));
|
65 |
}
|
66 |
+
|
67 |
});
|
68 |
|
69 |
function wplc_call_to_server_admin_chat(data) {
|
75 |
|
76 |
wplc_server_last_loop_data = data;
|
77 |
|
78 |
+
wplc_server.send(wplc_ajaxurl, data, "POST", 120000,
|
79 |
function (response) {
|
80 |
wplc_poll_delay = 1500;
|
81 |
wplc_loop_response_handler(response);
|
126 |
if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
|
127 |
|
128 |
response = JSON.parse(response);
|
129 |
+
|
130 |
|
131 |
jQuery.event.trigger({type: "wplc_admin_chat_loop",response:response});
|
132 |
|
144 |
the_message = response['chat_history'][k];
|
145 |
the_message.mid = k;
|
146 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
147 |
+
wplc_scroll_to_bottom();
|
148 |
});
|
149 |
|
150 |
}
|
156 |
}
|
157 |
if (response['action'] === "wplc_new_chat_message") {
|
158 |
jQuery("#wplc_user_typing").fadeOut("slow").remove();
|
159 |
+
|
160 |
current_len = jQuery("#admin_chat_box_area_" + cid).html().length;
|
161 |
|
162 |
if (typeof response['chat_message'] === "object") {
|
163 |
for (k in response['chat_message']) {
|
164 |
response['chat_message'][k].mid = k;
|
165 |
wplc_push_message_to_chatbox(response['chat_message'][k], 'a', function() {
|
166 |
+
wplc_scroll_to_bottom();
|
167 |
});
|
168 |
+
|
169 |
}
|
170 |
} else {
|
171 |
wplc_push_message_to_chatbox(response['chat_message'], 'a', function() {
|
172 |
wplc_scroll_to_bottom();
|
173 |
});
|
174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
176 |
+
|
177 |
+
new_length = jQuery("#admin_chat_box_area_" + cid).html().length;
|
178 |
+
|
179 |
+
if (current_len < new_length) {
|
180 |
+
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1" && ! (/User is browsing <small/.test(response['chat_message']))) {
|
181 |
+
new Audio(wplc_ding_file).play()
|
182 |
+
}
|
183 |
+
}
|
184 |
}
|
185 |
if (response['action'] === "wplc_user_open_chat") {
|
186 |
data['action_2'] = "";
|
193 |
var the_message = response['data'][index];
|
194 |
the_message.mid = index;
|
195 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
196 |
+
wplc_scroll_to_bottom();
|
197 |
+
});
|
198 |
+
|
199 |
|
200 |
}
|
201 |
}
|
202 |
+
}
|
203 |
}
|
204 |
}
|
205 |
|
208 |
*/
|
209 |
function wplc_scroll_to_bottom() {
|
210 |
var height = jQuery('#admin_chat_box_area_' + cid)[0].scrollHeight;
|
211 |
+
jQuery('#admin_chat_box_area_' + cid).scrollTop(height);
|
212 |
}
|
213 |
|
214 |
function wplc_display_error(error) {
|
238 |
var wplc_d = new Date();
|
239 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
240 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
241 |
+
wplc_scroll_to_bottom();
|
242 |
});
|
243 |
+
|
244 |
}
|
245 |
else if (chat_status === "3" && previous_chat_status === "10") {
|
246 |
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string3+"</em><br />");
|
251 |
var wplc_d = new Date();
|
252 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
253 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
254 |
+
wplc_scroll_to_bottom();
|
255 |
});
|
256 |
}
|
257 |
else if (chat_status === "1" || chat_status === "8") {
|
263 |
var wplc_d = new Date();
|
264 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
265 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
266 |
+
wplc_scroll_to_bottom();
|
267 |
document.getElementById('wplc_admin_chatmsg').disabled = true;
|
268 |
});
|
269 |
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string4+"</em><br />");
|
270 |
wplc_scroll_to_bottom();
|
271 |
+
|
272 |
jQuery(".admin_chat_box_inner_bottom").hide();
|
273 |
jQuery(".admin_chat_quick_controls").hide();
|
274 |
jQuery(".end_chat_div").hide();
|
298 |
if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
|
299 |
var firstRunData = data;
|
300 |
firstRunData.first_run = "true";
|
301 |
+
WPLCServer.Ajax.send(wplc_ajaxurl, firstRunData, "POST", 120000,
|
302 |
function (response) {
|
303 |
wplc_poll_delay = 1500; //This section is not really relevant as this wont run again, but copy and paste haha
|
304 |
wplc_loop_response_handler(response);
|
305 |
}
|
306 |
);
|
307 |
}
|
308 |
+
|
309 |
if (typeof wplc_action2 !== "undefined" && wplc_action2 !== "") { return; }
|
310 |
|
311 |
if (jQuery('#wplc_admin_cid').length) {
|
351 |
|
352 |
};
|
353 |
jQuery.post(wplc_ajaxurl, data, function (response) {
|
354 |
+
|
355 |
window.close();
|
356 |
});
|
357 |
|
363 |
str=str.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1) ");
|
364 |
str=str.replace(/<(?:.|\s)*?>/g, "");
|
365 |
|
366 |
+
str=str.replace('iframe', "");
|
367 |
+
str=str.replace('src', "");
|
368 |
+
str=str.replace('href', "");
|
369 |
+
str=str.replace('<', "");
|
370 |
+
str=str.replace('>', "");
|
371 |
|
372 |
return str;
|
373 |
}
|
388 |
} else {
|
389 |
wplc_name = wplc_name;
|
390 |
}
|
391 |
+
|
392 |
jQuery("#wplc_admin_chatmsg").val('');
|
393 |
|
394 |
if(wplc_chat !== ""){
|
400 |
if(typeof niftyFormatParser !== "undefined"){
|
401 |
//PRO
|
402 |
wplc_chat_parsed = niftyFormatParser(wplc_chat_parsed);
|
403 |
+
}
|
404 |
the_message = {};
|
405 |
the_message.originates = 1;
|
406 |
the_message.aid = wplc_extra_data.agent_id;
|
409 |
var wplc_d = new Date();
|
410 |
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
411 |
wplc_push_message_to_chatbox(the_message,'a', function() {
|
412 |
+
wplc_scroll_to_bottom();
|
413 |
});
|
414 |
+
|
415 |
|
416 |
|
417 |
wplc_extra_data.msg_data = {};
|
420 |
if (typeof wplc_admin_agent_email !== "undefined")
|
421 |
wplc_extra_data.msg_data.aemail = wplc_admin_agent_email;
|
422 |
|
423 |
+
|
424 |
|
425 |
var data = {
|
426 |
action: 'wplc_admin_send_msg',
|
429 |
msg: wplc_chat_parsed,
|
430 |
wplc_extra_data:wplc_extra_data
|
431 |
};
|
432 |
+
|
433 |
if(typeof wplc_admin_agent_name !== "undefined"){
|
434 |
data.msg_from_print = wplc_admin_agent_name;
|
435 |
}
|
436 |
|
437 |
+
wplc_server.sendMessage(wplc_ajaxurl, data, "POST", 120000,
|
438 |
function(){
|
439 |
//Success
|
440 |
wplc_server.asyncStorage(wplc_ajaxurl, data, 120000);
|
459 |
formData.append('file', fileToUpload);
|
460 |
formData.append('timestamp', Date.now());
|
461 |
formData.append('security', wplc_ajax_nonce );
|
462 |
+
|
463 |
/*Handle jQuery Elements*/
|
464 |
jQuery(uploadingID).show();
|
465 |
jQuery(originalID).hide();
|
474 |
type : 'POST',
|
475 |
data : formData,
|
476 |
cache: false,
|
477 |
+
processData: false,
|
478 |
+
contentType: false,
|
479 |
+
success : function(data) {
|
480 |
if(parseInt(data) !== 0){
|
481 |
jQuery(uploadingID).hide();
|
482 |
jQuery(successID).show();
|
483 |
setTimeout(function(){
|
484 |
jQuery(successID).hide();
|
485 |
+
jQuery(originalID).show();
|
486 |
}, 2000);
|
487 |
|
488 |
+
//All good post the link to file
|
489 |
var tag = (data.indexOf(".png") !== -1 || data.indexOf(".PNG") !== -1 || data.indexOf(".jpg") !== -1 || data.indexOf(".JPG") !== -1 || data.indexOf(".jpeg") !== -1 || data.indexOf(".gif") !== -1 || data.indexOf(".bmp")!== -1 ) ? "img" : "link";
|
490 |
+
|
491 |
if(tag !== "img"){
|
492 |
tag = (data.indexOf(".mp4") !== -1 || data.indexOf(".mpeg4") !== -1 || data.indexOf(".webm") !== -1 || data.indexOf(".oog") !== -1 ) ? "video" : "link"; //video now
|
493 |
}
|
499 |
jQuery(failedID).show();
|
500 |
setTimeout(function(){
|
501 |
jQuery(failedID).hide();
|
502 |
+
jQuery(originalID).show();
|
503 |
}, 2000);
|
504 |
|
505 |
}
|
509 |
jQuery(failedID).show();
|
510 |
setTimeout(function(){
|
511 |
jQuery(failedID).hide();
|
512 |
+
jQuery(originalID).show();
|
513 |
}, 2000);
|
514 |
}
|
515 |
});
|
519 |
jQuery(failedID).show();
|
520 |
setTimeout(function(){
|
521 |
jQuery(failedID).hide();
|
522 |
+
jQuery(originalID).show();
|
523 |
}, 2000);
|
524 |
}
|
525 |
} else{
|
528 |
jQuery(failedID).show();
|
529 |
setTimeout(function(){
|
530 |
jQuery(failedID).hide();
|
531 |
+
jQuery(originalID).show();
|
532 |
}, 2000);
|
533 |
}
|
534 |
}
|
js/wplc_u_node_events.js
CHANGED
@@ -189,14 +189,15 @@ jQuery(document).ready(function() {
|
|
189 |
msg_id: e.msg_id,
|
190 |
wplc_extra_data:wplc_extra_data
|
191 |
};
|
192 |
-
wplc_rest_api('send_message', data, 12000, null);
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
jQuery("#wplc_chatmsg").val('');
|
198 |
-
|
199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
});
|
202 |
|
189 |
msg_id: e.msg_id,
|
190 |
wplc_extra_data:wplc_extra_data
|
191 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
+
if(typeof wplc_chat === "string" && wplc_chat.trim() !== ""){
|
194 |
+
/*
|
195 |
+
* Will only send message if this is not empty string
|
196 |
+
* This will resolve some issues with rest storage
|
197 |
+
*/
|
198 |
+
wplc_rest_api('send_message', data, 12000, null);
|
199 |
+
jQuery("#wplc_chatmsg").val('');
|
200 |
+
}
|
201 |
|
202 |
});
|
203 |
|
readme.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
=== WP Live Chat Support ===
|
2 |
Contributors: WP-LiveChat, NickDuncan, CodeCabin_, dylanauty
|
3 |
Donate link: http://www.wp-livechat.com
|
4 |
Tags: live chat, live support, chat plugin, live help, wordpress live chat, chat, live chat plugin, live support plugin, live chat support plugin, chat plugin, support plugin, live help
|
@@ -208,6 +208,9 @@ If the live chat box still does not appear on your website, please go through th
|
|
208 |
|
209 |
== Upgrade Notice ==
|
210 |
|
|
|
|
|
|
|
211 |
= 8.0.06 =
|
212 |
It is highly recommended that you upgrade to WP Live Chat Support version 8.0.06 for security reasons.
|
213 |
|
@@ -226,6 +229,15 @@ We have patched the PHPMailer vulnerability. Please update to version 7.0.02.
|
|
226 |
|
227 |
== Changelog ==
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
= 8.0.07 - 2018-03-23 - Low priority =
|
230 |
* Fixed a "direct user to page" bug
|
231 |
|
1 |
+
=== WP Live Chat Support ===
|
2 |
Contributors: WP-LiveChat, NickDuncan, CodeCabin_, dylanauty
|
3 |
Donate link: http://www.wp-livechat.com
|
4 |
Tags: live chat, live support, chat plugin, live help, wordpress live chat, chat, live chat plugin, live support plugin, live chat support plugin, chat plugin, support plugin, live help
|
208 |
|
209 |
== Upgrade Notice ==
|
210 |
|
211 |
+
= 8.0.08 =
|
212 |
+
It is highly recommended that you upgrade to WP Live Chat Support version 8.0.08 for security reasons.
|
213 |
+
|
214 |
= 8.0.06 =
|
215 |
It is highly recommended that you upgrade to WP Live Chat Support version 8.0.06 for security reasons.
|
216 |
|
229 |
|
230 |
== Changelog ==
|
231 |
|
232 |
+
= 8.0.08 - 2018-05-14 - High priority =
|
233 |
+
* XSS vulnerability fixes thanks to Riccardo Ten cate
|
234 |
+
* Fixed REST Storage Issue
|
235 |
+
* Add pagination to History, Missed Chats and Offline Messages admin pages
|
236 |
+
* Fix for Disable Emojis setting not displaying when Pro is active
|
237 |
+
* Fix for timestamp not displaying correctly
|
238 |
+
* Fix for WP Rocket comaptibility
|
239 |
+
* Fix for chat box not popping up for returning visitors that had previously minimized
|
240 |
+
|
241 |
= 8.0.07 - 2018-03-23 - Low priority =
|
242 |
* Fixed a "direct user to page" bug
|
243 |
|
wp-live-chat-support.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Live Chat Support
|
4 |
Plugin URI: http://www.wp-livechat.com
|
5 |
Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
|
6 |
-
Version: 8.0.
|
7 |
Author: WP-LiveChat
|
8 |
Author URI: http://www.wp-livechat.com
|
9 |
Text Domain: wplivechat
|
@@ -11,14 +11,22 @@
|
|
11 |
*/
|
12 |
|
13 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
*
|
15 |
* 8.0.07 - 2018-03-23 - Low priority
|
16 |
* Fixed a "direct user to page" bug
|
17 |
-
*
|
18 |
* 8.0.06 - 2018-03-23 - High priority
|
19 |
* XSS vulnerability fixes thanks to https://www.gubello.me/blog/
|
20 |
* Fixed a chat width styling bug on the front end
|
21 |
-
*
|
22 |
* 8.0.05 - 2018-03-09 - Medium priority
|
23 |
* Chat minimize is now respected
|
24 |
* GIF integration support (Giphy, Tenor)
|
@@ -28,20 +36,20 @@
|
|
28 |
* Fixes chat history styling
|
29 |
* Mac style fix (front end)
|
30 |
* Email transcript integrated
|
31 |
-
*
|
32 |
* 8.0.04 - 2018-02-12 - Low priority
|
33 |
* Allowed strings from the front end to be translated
|
34 |
* Fixed the iPhone Safari display bug (zooming in to the chat box)
|
35 |
* Added support for the agent to detect and connect to the closest chat server
|
36 |
-
*
|
37 |
* 8.0.03 - 2018-01-30 - Medium priority
|
38 |
* Fixed a CSS bug
|
39 |
* Corrected a bug with the default theme not being set correctly.
|
40 |
-
*
|
41 |
* 8.0.02 - 2018-01-29 - Medium priority
|
42 |
* Fixed a PHP warning
|
43 |
* Modified rest_url filter to no longer use anonymous function
|
44 |
-
* Fixed styling conflicts between our settings and other pages in WordPress admin
|
45 |
* Fixed issues with file uploads (Bleeper core)
|
46 |
* Fixed hints in settings area
|
47 |
* Fixed links in chat bubbles not being clearly visible
|
@@ -49,7 +57,7 @@
|
|
49 |
* Fixed the bug that caused issues if your folder name was not wp-live-chat-support
|
50 |
* Fixed issue where inactive chat status is not removed when new message from that chat is received
|
51 |
* Welcome page styling fixed
|
52 |
-
*
|
53 |
* 8.0.01 - 2018-01-24 - High priority
|
54 |
* Massive improvements to the performance of the plugin
|
55 |
* New, modern dashboard
|
@@ -616,7 +624,7 @@ global $debug_start;
|
|
616 |
$wplc_tblname_offline_msgs = $wpdb->prefix . "wplc_offline_messages";
|
617 |
$wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
|
618 |
$wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
|
619 |
-
$wplc_version = "8.0.
|
620 |
|
621 |
define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
|
622 |
define('WPLC_BASIC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
|
@@ -705,7 +713,7 @@ function wplc_init() {
|
|
705 |
* @return void
|
706 |
*/
|
707 |
function wplc_redirect_on_activate( $plugin ) {
|
708 |
-
|
709 |
if( $plugin == plugin_basename( __FILE__ ) ) {
|
710 |
if (get_option("WPLC_V8_FIRST_TIME") == true) {
|
711 |
update_option("WPLC_V8_FIRST_TIME",false);
|
@@ -846,7 +854,7 @@ function wplc_version_control() {
|
|
846 |
if (!isset($wplc_settings['wplc_preferred_gif_provider'])) { $wplc_settings["wplc_preferred_gif_provider"] = 1; }
|
847 |
if (!isset($wplc_settings['wplc_giphy_api_key'])) { $wplc_settings["wplc_giphy_api_key"] = ""; }
|
848 |
if (!isset($wplc_settings['wplc_tenor_api_key'])) { $wplc_settings["wplc_tenor_api_key"] = ""; }
|
849 |
-
|
850 |
wplc_handle_db();
|
851 |
update_option("wplc_current_version", $wplc_version);
|
852 |
|
@@ -1125,6 +1133,10 @@ function wplc_load_user_js () {
|
|
1125 |
function wplc_push_js_to_front_basic() {
|
1126 |
global $wplc_is_mobile;
|
1127 |
global $wplc_version;
|
|
|
|
|
|
|
|
|
1128 |
wp_enqueue_script('jquery');
|
1129 |
|
1130 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
@@ -1162,11 +1174,11 @@ function wplc_push_js_to_front_basic() {
|
|
1162 |
wp_register_script('wplc-server-script', plugins_url('/js/wplc_server.js', __FILE__), array('jquery'), $wplc_version);
|
1163 |
wp_enqueue_script('wplc-server-script');
|
1164 |
|
1165 |
-
wp_localize_script( 'wplc-server-script', 'wplc_datetime_format', array(
|
1166 |
'date_format' => get_option( 'date_format' ),
|
1167 |
'time_format' => get_option( 'time_format' ),
|
1168 |
) );
|
1169 |
-
|
1170 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
1171 |
wp_localize_script('wplc-server-script', 'wplc_use_node_server', "true");
|
1172 |
|
@@ -1281,10 +1293,6 @@ function wplc_push_js_to_front_basic() {
|
|
1281 |
wp_enqueue_script('wplc-theme-classic');
|
1282 |
}
|
1283 |
|
1284 |
-
|
1285 |
-
wp_register_script('wplc-user-jquery-cookie', plugins_url('/js/jquery-cookie.js', __FILE__), array('wplc-user-script'),false, false);
|
1286 |
-
wp_enqueue_script('wplc-user-jquery-cookie');
|
1287 |
-
|
1288 |
$ajax_url = admin_url('admin-ajax.php');
|
1289 |
$home_ajax_url = $ajax_url;
|
1290 |
|
@@ -1346,8 +1354,8 @@ function wplc_push_js_to_front_basic() {
|
|
1346 |
wp_localize_script( 'wplc-user-script', 'wplc_show_chat_detail', $wplc_chat_detail );
|
1347 |
}
|
1348 |
|
1349 |
-
|
1350 |
-
|
1351 |
/**
|
1352 |
* Create a JS object for all Agent ID's and Gravatar MD5's
|
1353 |
*/
|
@@ -2310,7 +2318,7 @@ function wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_u
|
|
2310 |
function wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale, $class_override = false) {
|
2311 |
|
2312 |
$ret_msg = "<div id='wplc_first_message'>";
|
2313 |
-
|
2314 |
if(!isset($wplc_settings['wplc_newtheme'])){ $wplc_settings['wplc_newtheme'] = "theme-2"; }
|
2315 |
|
2316 |
if ($logged_in) {
|
@@ -2331,8 +2339,8 @@ function wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged
|
|
2331 |
|
2332 |
$ret_msg .= $wplc_tl_msg;
|
2333 |
} else {
|
2334 |
-
|
2335 |
-
|
2336 |
$wplc_na = __('Chat offline. Leave a message', 'wplivechat');
|
2337 |
$wplc_tl_msg = "<span class='wplc_offline'>" . ($wplc_using_locale ? $wplc_na : stripslashes($wplc_settings['wplc_pro_na'])) . "</span>";
|
2338 |
$ret_msg .= $wplc_tl_msg;
|
@@ -2371,18 +2379,18 @@ function wplc_filter_control_loggedin($logged_in) {
|
|
2371 |
} else {
|
2372 |
$logged_in = true;
|
2373 |
}
|
2374 |
-
|
2375 |
$logged_in_checks = apply_filters("wplc_filter_is_admin_logged_in",array());
|
2376 |
-
|
2377 |
/* if we are logged in ANYWHERE, set this to true */
|
2378 |
foreach($logged_in_checks as $key => $val) {
|
2379 |
if ($val) { $logged_in = true; break; }
|
2380 |
}
|
2381 |
$logged_in_via_app = false;
|
2382 |
if (isset($logged_in_checks['app']) && $logged_in_checks['app'] == true) { $logged_in_via_app = true; }
|
2383 |
-
|
2384 |
$logged_in = apply_filters("wplc_final_loggedin_control",$logged_in,$logged_in_via_app);
|
2385 |
-
|
2386 |
/* admin is using the basic version and is logged in */
|
2387 |
if ($wplc_is_admin_logged_in) { $logged_in = true; }
|
2388 |
|
@@ -2438,7 +2446,7 @@ function wplc_output_box_ajax_new($cid = null) {
|
|
2438 |
$ret_msg['type'] = 'returning';
|
2439 |
|
2440 |
if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1) {
|
2441 |
-
//This is using node, we shouldn't generate the header data as part of the chat box.
|
2442 |
//We will do this dynamically on the front end
|
2443 |
|
2444 |
//var_dump("NOPEEE");
|
@@ -2791,7 +2799,7 @@ function wplc_hook_control_superadmin_head() {
|
|
2791 |
|
2792 |
function wplc_superadmin_javascript() {
|
2793 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
2794 |
-
|
2795 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== "history") ){
|
2796 |
|
2797 |
//Using node, remote scripts please
|
@@ -3470,7 +3478,7 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3470 |
$user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
|
3471 |
}
|
3472 |
|
3473 |
-
echo "<h2>$status " . __( 'Chat with', 'wplivechat' ) . " " . $result->name . "</h2>";
|
3474 |
if ( isset( $_GET['action'] ) && 'history' === $_GET['action'] ) {
|
3475 |
echo "<span class='wplc-history__date'><strong>" . __( 'Starting Time:', 'wplivechat' ) . "</strong>" . date( 'Y-m-d H:i:s', current_time( strtotime( $result->timestamp ) ) ) . "</span>";
|
3476 |
echo "<span class='wplc-history__date wplc-history__date-end'><strong>" . __( 'Ending Time:', 'wplivechat' ) . "</strong>" . date( 'Y-m-d H:i:s', current_time( strtotime( $result->last_active_timestamp ) ) ) . "</span>";
|
@@ -3509,8 +3517,8 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3509 |
echo " <div style='float:left;'>";
|
3510 |
|
3511 |
echo " <div class='admin_visitor_info_box1'>";
|
3512 |
-
echo " <span class='admin_chat_name'>" . $result->name . "</span>";
|
3513 |
-
echo " <span class='admin_chat_email'>" . $result->email . "</span>";
|
3514 |
echo " </div>";
|
3515 |
echo " </div>";
|
3516 |
|
@@ -3524,11 +3532,11 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3524 |
echo " <strong>" . __("Advanced Info", "wplivechat") . "</strong>";
|
3525 |
echo " <hr />";
|
3526 |
echo " <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />";
|
3527 |
-
echo " <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> "
|
3528 |
echo " </div>";
|
3529 |
echo "<hr />";
|
3530 |
|
3531 |
-
echo (apply_filters("wplc_filter_advanced_info","", $result->id, $result->name, $result));
|
3532 |
|
3533 |
echo " <div id=\"wplc_sound_update\"></div>";
|
3534 |
|
@@ -3586,7 +3594,7 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3586 |
'date_format' => get_option( 'date_format' ),
|
3587 |
'time_format' => get_option( 'time_format' ),
|
3588 |
) );
|
3589 |
-
|
3590 |
global $admin_chat_data;
|
3591 |
if (!$admin_chat_data) {
|
3592 |
$cdata = wplc_get_chat_data($cid, __LINE__);
|
@@ -3647,7 +3655,7 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3647 |
wp_localize_script('wplc-admin-chat-server', 'wplc_admin_agent_email', md5($agent_data->user_email));
|
3648 |
}
|
3649 |
|
3650 |
-
|
3651 |
wp_register_script('wplc-admin-chat-js', plugins_url('js/wplc_u_admin_chat.js', __FILE__), array('wplc-admin-chat-server'), $wplc_version, false);
|
3652 |
wp_enqueue_script('wplc-admin-chat-js');
|
3653 |
|
@@ -3715,8 +3723,8 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3715 |
wp_enqueue_script('wplc-admin-chat-js');
|
3716 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_show_chat_detail', $wplc_chat_detail );
|
3717 |
|
3718 |
-
|
3719 |
-
|
3720 |
if (!empty( $wplc_agent_data ) ) {
|
3721 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_name', $wplc_agent_data->display_name );
|
3722 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_email', md5( $wplc_agent_data->user_email ) );
|
@@ -3978,7 +3986,7 @@ function wplc_add_user_stylesheet() {
|
|
3978 |
$wplc_settings = get_option( 'WPLC_SETTINGS' );
|
3979 |
if ( isset( $wplc_settings ) && isset( $wplc_settings['wplc_enable_font_awesome'] ) && '1' === $wplc_settings['wplc_enable_font_awesome'] ) {
|
3980 |
wp_register_style( 'wplc-font-awesome', plugins_url( '/css/font-awesome.min.css', __FILE__ ) );
|
3981 |
-
|
3982 |
wp_enqueue_style( 'wplc-font-awesome' );
|
3983 |
}
|
3984 |
wp_register_style('wplc-style', plugins_url('/css/wplcstyle.css', __FILE__), array(), $wplc_version);
|
@@ -4219,7 +4227,7 @@ function wplc_add_admin_stylesheet() {
|
|
4219 |
if (isset($_GET['page']) && ($_GET['page'] == 'wplivechat-menu' || $_GET['page'] == 'wplivechat-menu-api-keys-page' || $_GET['page'] == 'wplivechat-menu-extensions-page' || $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] == 'wplivechat-menu-offline-messages' || $_GET['page'] == 'wplivechat-menu-history' || $_GET['page'] == 'wplivechat-menu-missed-chats')) {
|
4220 |
wp_register_style( 'wplc-jquery-ui', plugins_url( '/css/jquery-ui.css', __FILE__ ), false, $wplc_version );
|
4221 |
wp_enqueue_style( 'wplc-jquery-ui' );
|
4222 |
-
|
4223 |
wp_enqueue_script( 'jquery-ui-core' );
|
4224 |
wp_enqueue_script( 'jquery-effects-core' );
|
4225 |
|
@@ -4245,7 +4253,7 @@ function wplc_add_admin_stylesheet() {
|
|
4245 |
// Gif Integration styles - admin
|
4246 |
wp_register_style( 'wplc-gif-integration', plugins_url( '/css/wplc_gif_integration.css', __FILE__ ) );
|
4247 |
wp_enqueue_style( 'wplc-gif-integration' );
|
4248 |
-
|
4249 |
// This loads the chat styling on all admin pages as we are using the popout dashboard
|
4250 |
if ( isset( $wplc_settings['wplc_use_node_server'] ) && ( $wplc_settings['wplc_use_node_server'] == 1 ) && ( isset( $wplc_settings['wplc_enable_all_admin_pages'] ) && $wplc_settings['wplc_enable_all_admin_pages'] === '1') ) {
|
4251 |
|
@@ -4281,7 +4289,7 @@ $gutenberg_default_html = '<!-- Default HTML -->
|
|
4281 |
<span class="wplc_block_text">{wplc_text}</span>
|
4282 |
<span class="wplc_block_icon">{wplc_icon}</span>
|
4283 |
</div>';
|
4284 |
-
|
4285 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
|
4286 |
wp_enqueue_script('jquery');
|
4287 |
wp_enqueue_script('jquery-ui-core');
|
@@ -4399,6 +4407,11 @@ function wplc_hook_control_chat_history() {
|
|
4399 |
}
|
4400 |
}
|
4401 |
|
|
|
|
|
|
|
|
|
|
|
4402 |
|
4403 |
$results = $wpdb->get_results(
|
4404 |
"
|
@@ -4406,6 +4419,7 @@ function wplc_hook_control_chat_history() {
|
|
4406 |
FROM $wplc_tblname_chats
|
4407 |
WHERE `name` NOT LIKE 'agent-to-agent chat'
|
4408 |
ORDER BY `timestamp` DESC
|
|
|
4409 |
"
|
4410 |
);
|
4411 |
echo "
|
@@ -4446,8 +4460,8 @@ function wplc_hook_control_chat_history() {
|
|
4446 |
|
4447 |
echo "<tr id=\"record_" . $tcid . "\" $trstyle>";
|
4448 |
echo "<td class='chat_id column-chat_d'>" . date("Y-m-d H:i:s", current_time( strtotime( $result->timestamp ) ) ) . "</td>";
|
4449 |
-
echo "<td class='chat_name column_chat_name' id='chat_name_" . $tcid . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=40\" /> " . $result->name . "</td>";
|
4450 |
-
echo "<td class='chat_email column_chat_email' id='chat_email_" . $tcid . "'><a href='mailto:" . $result->email . "' title='Email " . ".$result->email." . "'>" . $result->email . "</a></td>";
|
4451 |
echo "<td class='chat_name column_chat_url' id='chat_url_" . $tcid . "'>" . esc_url($result->url) . "</td>";
|
4452 |
echo "<td class='chat_status column_chat_status' id='chat_status_" . $tcid . "'><strong>" . wplc_return_status($result->status) . "</strong></td>";
|
4453 |
echo "<td class='chat_action column-chat_action' id='chat_action_" . $tcid . "'>$actions</td>";
|
@@ -4456,6 +4470,19 @@ function wplc_hook_control_chat_history() {
|
|
4456 |
}
|
4457 |
echo "</table>";
|
4458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4459 |
|
4460 |
}
|
4461 |
|
@@ -4549,7 +4576,13 @@ function wplc_admin_display_offline_messages_new() {
|
|
4549 |
</thead>
|
4550 |
<tbody id=\"the-list\" class='list:wp_list_text_link'>";
|
4551 |
|
4552 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4553 |
|
4554 |
$results = $wpdb->get_results($sql);
|
4555 |
|
@@ -4570,6 +4603,19 @@ function wplc_admin_display_offline_messages_new() {
|
|
4570 |
echo "
|
4571 |
</tbody>
|
4572 |
</table>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4573 |
}
|
4574 |
|
4575 |
/**
|
@@ -5116,17 +5162,17 @@ function wp_button_pointers_load_scripts($hook) {
|
|
5116 |
if ( isset( $wplc_settings['wplc_enable_all_admin_pages'] ) && $wplc_settings['wplc_enable_all_admin_pages'] === '1' ) {
|
5117 |
/* Run admin JS on all admin pages */
|
5118 |
$wplcrun = true;
|
5119 |
-
|
5120 |
-
|
5121 |
} else {
|
5122 |
-
|
5123 |
if( $hook === 'toplevel_page_wplivechat-menu') { $wplcrun = true; } // stop if we are not on the right page
|
5124 |
}
|
5125 |
|
5126 |
|
5127 |
-
if ( $wplcrun ) {
|
|
|
5128 |
|
5129 |
-
|
5130 |
|
5131 |
|
5132 |
$pointer_localize_strings = array(
|
3 |
Plugin Name: WP Live Chat Support
|
4 |
Plugin URI: http://www.wp-livechat.com
|
5 |
Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
|
6 |
+
Version: 8.0.08
|
7 |
Author: WP-LiveChat
|
8 |
Author URI: http://www.wp-livechat.com
|
9 |
Text Domain: wplivechat
|
11 |
*/
|
12 |
|
13 |
/**
|
14 |
+
* 8.0.08 - High priority
|
15 |
+
* XSS vulnerability fixes thanks to Riccardo Ten cate
|
16 |
+
* Fixed REST Storage Issue
|
17 |
+
* Add pagination to History, Missed Chats and Offline Messages admin pages
|
18 |
+
* Fix for Disable Emojis setting not displaying when Pro is active
|
19 |
+
* Fix for timestamp not displaying correctly
|
20 |
+
* Fix for WP Rocket comaptibility
|
21 |
+
* Fix for chat box not popping up for returning visitors that had previously minimized
|
22 |
*
|
23 |
* 8.0.07 - 2018-03-23 - Low priority
|
24 |
* Fixed a "direct user to page" bug
|
25 |
+
*
|
26 |
* 8.0.06 - 2018-03-23 - High priority
|
27 |
* XSS vulnerability fixes thanks to https://www.gubello.me/blog/
|
28 |
* Fixed a chat width styling bug on the front end
|
29 |
+
*
|
30 |
* 8.0.05 - 2018-03-09 - Medium priority
|
31 |
* Chat minimize is now respected
|
32 |
* GIF integration support (Giphy, Tenor)
|
36 |
* Fixes chat history styling
|
37 |
* Mac style fix (front end)
|
38 |
* Email transcript integrated
|
39 |
+
*
|
40 |
* 8.0.04 - 2018-02-12 - Low priority
|
41 |
* Allowed strings from the front end to be translated
|
42 |
* Fixed the iPhone Safari display bug (zooming in to the chat box)
|
43 |
* Added support for the agent to detect and connect to the closest chat server
|
44 |
+
*
|
45 |
* 8.0.03 - 2018-01-30 - Medium priority
|
46 |
* Fixed a CSS bug
|
47 |
* Corrected a bug with the default theme not being set correctly.
|
48 |
+
*
|
49 |
* 8.0.02 - 2018-01-29 - Medium priority
|
50 |
* Fixed a PHP warning
|
51 |
* Modified rest_url filter to no longer use anonymous function
|
52 |
+
* Fixed styling conflicts between our settings and other pages in WordPress admin
|
53 |
* Fixed issues with file uploads (Bleeper core)
|
54 |
* Fixed hints in settings area
|
55 |
* Fixed links in chat bubbles not being clearly visible
|
57 |
* Fixed the bug that caused issues if your folder name was not wp-live-chat-support
|
58 |
* Fixed issue where inactive chat status is not removed when new message from that chat is received
|
59 |
* Welcome page styling fixed
|
60 |
+
*
|
61 |
* 8.0.01 - 2018-01-24 - High priority
|
62 |
* Massive improvements to the performance of the plugin
|
63 |
* New, modern dashboard
|
624 |
$wplc_tblname_offline_msgs = $wpdb->prefix . "wplc_offline_messages";
|
625 |
$wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
|
626 |
$wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
|
627 |
+
$wplc_version = "8.0.08";
|
628 |
|
629 |
define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
|
630 |
define('WPLC_BASIC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
|
713 |
* @return void
|
714 |
*/
|
715 |
function wplc_redirect_on_activate( $plugin ) {
|
716 |
+
|
717 |
if( $plugin == plugin_basename( __FILE__ ) ) {
|
718 |
if (get_option("WPLC_V8_FIRST_TIME") == true) {
|
719 |
update_option("WPLC_V8_FIRST_TIME",false);
|
854 |
if (!isset($wplc_settings['wplc_preferred_gif_provider'])) { $wplc_settings["wplc_preferred_gif_provider"] = 1; }
|
855 |
if (!isset($wplc_settings['wplc_giphy_api_key'])) { $wplc_settings["wplc_giphy_api_key"] = ""; }
|
856 |
if (!isset($wplc_settings['wplc_tenor_api_key'])) { $wplc_settings["wplc_tenor_api_key"] = ""; }
|
857 |
+
|
858 |
wplc_handle_db();
|
859 |
update_option("wplc_current_version", $wplc_version);
|
860 |
|
1133 |
function wplc_push_js_to_front_basic() {
|
1134 |
global $wplc_is_mobile;
|
1135 |
global $wplc_version;
|
1136 |
+
|
1137 |
+
wp_register_script('wplc-user-jquery-cookie', plugins_url('/js/jquery-cookie.js', __FILE__), array('jquery'),false, false);
|
1138 |
+
wp_enqueue_script('wplc-user-jquery-cookie');
|
1139 |
+
|
1140 |
wp_enqueue_script('jquery');
|
1141 |
|
1142 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
1174 |
wp_register_script('wplc-server-script', plugins_url('/js/wplc_server.js', __FILE__), array('jquery'), $wplc_version);
|
1175 |
wp_enqueue_script('wplc-server-script');
|
1176 |
|
1177 |
+
wp_localize_script( 'wplc-server-script', 'wplc_datetime_format', array(
|
1178 |
'date_format' => get_option( 'date_format' ),
|
1179 |
'time_format' => get_option( 'time_format' ),
|
1180 |
) );
|
1181 |
+
|
1182 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
1183 |
wp_localize_script('wplc-server-script', 'wplc_use_node_server', "true");
|
1184 |
|
1293 |
wp_enqueue_script('wplc-theme-classic');
|
1294 |
}
|
1295 |
|
|
|
|
|
|
|
|
|
1296 |
$ajax_url = admin_url('admin-ajax.php');
|
1297 |
$home_ajax_url = $ajax_url;
|
1298 |
|
1354 |
wp_localize_script( 'wplc-user-script', 'wplc_show_chat_detail', $wplc_chat_detail );
|
1355 |
}
|
1356 |
|
1357 |
+
|
1358 |
+
|
1359 |
/**
|
1360 |
* Create a JS object for all Agent ID's and Gravatar MD5's
|
1361 |
*/
|
2318 |
function wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale, $class_override = false) {
|
2319 |
|
2320 |
$ret_msg = "<div id='wplc_first_message'>";
|
2321 |
+
|
2322 |
if(!isset($wplc_settings['wplc_newtheme'])){ $wplc_settings['wplc_newtheme'] = "theme-2"; }
|
2323 |
|
2324 |
if ($logged_in) {
|
2339 |
|
2340 |
$ret_msg .= $wplc_tl_msg;
|
2341 |
} else {
|
2342 |
+
|
2343 |
+
|
2344 |
$wplc_na = __('Chat offline. Leave a message', 'wplivechat');
|
2345 |
$wplc_tl_msg = "<span class='wplc_offline'>" . ($wplc_using_locale ? $wplc_na : stripslashes($wplc_settings['wplc_pro_na'])) . "</span>";
|
2346 |
$ret_msg .= $wplc_tl_msg;
|
2379 |
} else {
|
2380 |
$logged_in = true;
|
2381 |
}
|
2382 |
+
|
2383 |
$logged_in_checks = apply_filters("wplc_filter_is_admin_logged_in",array());
|
2384 |
+
|
2385 |
/* if we are logged in ANYWHERE, set this to true */
|
2386 |
foreach($logged_in_checks as $key => $val) {
|
2387 |
if ($val) { $logged_in = true; break; }
|
2388 |
}
|
2389 |
$logged_in_via_app = false;
|
2390 |
if (isset($logged_in_checks['app']) && $logged_in_checks['app'] == true) { $logged_in_via_app = true; }
|
2391 |
+
|
2392 |
$logged_in = apply_filters("wplc_final_loggedin_control",$logged_in,$logged_in_via_app);
|
2393 |
+
|
2394 |
/* admin is using the basic version and is logged in */
|
2395 |
if ($wplc_is_admin_logged_in) { $logged_in = true; }
|
2396 |
|
2446 |
$ret_msg['type'] = 'returning';
|
2447 |
|
2448 |
if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1) {
|
2449 |
+
//This is using node, we shouldn't generate the header data as part of the chat box.
|
2450 |
//We will do this dynamically on the front end
|
2451 |
|
2452 |
//var_dump("NOPEEE");
|
2799 |
|
2800 |
function wplc_superadmin_javascript() {
|
2801 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
2802 |
+
|
2803 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== "history") ){
|
2804 |
|
2805 |
//Using node, remote scripts please
|
3478 |
$user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
|
3479 |
}
|
3480 |
|
3481 |
+
echo "<h2>$status " . __( 'Chat with', 'wplivechat' ) . " " . sanitize_text_field($result->name) . "</h2>";
|
3482 |
if ( isset( $_GET['action'] ) && 'history' === $_GET['action'] ) {
|
3483 |
echo "<span class='wplc-history__date'><strong>" . __( 'Starting Time:', 'wplivechat' ) . "</strong>" . date( 'Y-m-d H:i:s', current_time( strtotime( $result->timestamp ) ) ) . "</span>";
|
3484 |
echo "<span class='wplc-history__date wplc-history__date-end'><strong>" . __( 'Ending Time:', 'wplivechat' ) . "</strong>" . date( 'Y-m-d H:i:s', current_time( strtotime( $result->last_active_timestamp ) ) ) . "</span>";
|
3517 |
echo " <div style='float:left;'>";
|
3518 |
|
3519 |
echo " <div class='admin_visitor_info_box1'>";
|
3520 |
+
echo " <span class='admin_chat_name'>" . sanitize_text_field($result->name) . "</span>";
|
3521 |
+
echo " <span class='admin_chat_email'>" . sanitize_text_field($result->email) . "</span>";
|
3522 |
echo " </div>";
|
3523 |
echo " </div>";
|
3524 |
|
3532 |
echo " <strong>" . __("Advanced Info", "wplivechat") . "</strong>";
|
3533 |
echo " <hr />";
|
3534 |
echo " <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />";
|
3535 |
+
echo " <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> ".sanitize_text_field($user_ip);
|
3536 |
echo " </div>";
|
3537 |
echo "<hr />";
|
3538 |
|
3539 |
+
echo (apply_filters("wplc_filter_advanced_info","", sanitize_text_field($result->id), sanitize_text_field($result->name), $result));
|
3540 |
|
3541 |
echo " <div id=\"wplc_sound_update\"></div>";
|
3542 |
|
3594 |
'date_format' => get_option( 'date_format' ),
|
3595 |
'time_format' => get_option( 'time_format' ),
|
3596 |
) );
|
3597 |
+
|
3598 |
global $admin_chat_data;
|
3599 |
if (!$admin_chat_data) {
|
3600 |
$cdata = wplc_get_chat_data($cid, __LINE__);
|
3655 |
wp_localize_script('wplc-admin-chat-server', 'wplc_admin_agent_email', md5($agent_data->user_email));
|
3656 |
}
|
3657 |
|
3658 |
+
|
3659 |
wp_register_script('wplc-admin-chat-js', plugins_url('js/wplc_u_admin_chat.js', __FILE__), array('wplc-admin-chat-server'), $wplc_version, false);
|
3660 |
wp_enqueue_script('wplc-admin-chat-js');
|
3661 |
|
3723 |
wp_enqueue_script('wplc-admin-chat-js');
|
3724 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_show_chat_detail', $wplc_chat_detail );
|
3725 |
|
3726 |
+
|
3727 |
+
|
3728 |
if (!empty( $wplc_agent_data ) ) {
|
3729 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_name', $wplc_agent_data->display_name );
|
3730 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_email', md5( $wplc_agent_data->user_email ) );
|
3986 |
$wplc_settings = get_option( 'WPLC_SETTINGS' );
|
3987 |
if ( isset( $wplc_settings ) && isset( $wplc_settings['wplc_enable_font_awesome'] ) && '1' === $wplc_settings['wplc_enable_font_awesome'] ) {
|
3988 |
wp_register_style( 'wplc-font-awesome', plugins_url( '/css/font-awesome.min.css', __FILE__ ) );
|
3989 |
+
|
3990 |
wp_enqueue_style( 'wplc-font-awesome' );
|
3991 |
}
|
3992 |
wp_register_style('wplc-style', plugins_url('/css/wplcstyle.css', __FILE__), array(), $wplc_version);
|
4227 |
if (isset($_GET['page']) && ($_GET['page'] == 'wplivechat-menu' || $_GET['page'] == 'wplivechat-menu-api-keys-page' || $_GET['page'] == 'wplivechat-menu-extensions-page' || $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] == 'wplivechat-menu-offline-messages' || $_GET['page'] == 'wplivechat-menu-history' || $_GET['page'] == 'wplivechat-menu-missed-chats')) {
|
4228 |
wp_register_style( 'wplc-jquery-ui', plugins_url( '/css/jquery-ui.css', __FILE__ ), false, $wplc_version );
|
4229 |
wp_enqueue_style( 'wplc-jquery-ui' );
|
4230 |
+
|
4231 |
wp_enqueue_script( 'jquery-ui-core' );
|
4232 |
wp_enqueue_script( 'jquery-effects-core' );
|
4233 |
|
4253 |
// Gif Integration styles - admin
|
4254 |
wp_register_style( 'wplc-gif-integration', plugins_url( '/css/wplc_gif_integration.css', __FILE__ ) );
|
4255 |
wp_enqueue_style( 'wplc-gif-integration' );
|
4256 |
+
|
4257 |
// This loads the chat styling on all admin pages as we are using the popout dashboard
|
4258 |
if ( isset( $wplc_settings['wplc_use_node_server'] ) && ( $wplc_settings['wplc_use_node_server'] == 1 ) && ( isset( $wplc_settings['wplc_enable_all_admin_pages'] ) && $wplc_settings['wplc_enable_all_admin_pages'] === '1') ) {
|
4259 |
|
4289 |
<span class="wplc_block_text">{wplc_text}</span>
|
4290 |
<span class="wplc_block_icon">{wplc_icon}</span>
|
4291 |
</div>';
|
4292 |
+
|
4293 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
|
4294 |
wp_enqueue_script('jquery');
|
4295 |
wp_enqueue_script('jquery-ui-core');
|
4407 |
}
|
4408 |
}
|
4409 |
|
4410 |
+
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
|
4411 |
+
$limit = 20; // number of rows in page
|
4412 |
+
$offset = ( $pagenum - 1 ) * $limit;
|
4413 |
+
$total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats" );
|
4414 |
+
$num_of_pages = ceil( $total / $limit );
|
4415 |
|
4416 |
$results = $wpdb->get_results(
|
4417 |
"
|
4419 |
FROM $wplc_tblname_chats
|
4420 |
WHERE `name` NOT LIKE 'agent-to-agent chat'
|
4421 |
ORDER BY `timestamp` DESC
|
4422 |
+
LIMIT $limit OFFSET $offset
|
4423 |
"
|
4424 |
);
|
4425 |
echo "
|
4460 |
|
4461 |
echo "<tr id=\"record_" . $tcid . "\" $trstyle>";
|
4462 |
echo "<td class='chat_id column-chat_d'>" . date("Y-m-d H:i:s", current_time( strtotime( $result->timestamp ) ) ) . "</td>";
|
4463 |
+
echo "<td class='chat_name column_chat_name' id='chat_name_" . $tcid . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=40\" /> " . sanitize_text_field($result->name) . "</td>";
|
4464 |
+
echo "<td class='chat_email column_chat_email' id='chat_email_" . $tcid . "'><a href='mailto:" . sanitize_text_field($result->email) . "' title='Email " . ".$result->email." . "'>" . sanitize_text_field ($result->email) . "</a></td>";
|
4465 |
echo "<td class='chat_name column_chat_url' id='chat_url_" . $tcid . "'>" . esc_url($result->url) . "</td>";
|
4466 |
echo "<td class='chat_status column_chat_status' id='chat_status_" . $tcid . "'><strong>" . wplc_return_status($result->status) . "</strong></td>";
|
4467 |
echo "<td class='chat_action column-chat_action' id='chat_action_" . $tcid . "'>$actions</td>";
|
4470 |
}
|
4471 |
echo "</table>";
|
4472 |
|
4473 |
+
$page_links = paginate_links( array(
|
4474 |
+
'base' => add_query_arg( 'pagenum', '%#%' ),
|
4475 |
+
'format' => '',
|
4476 |
+
'prev_text' => __( '«', 'wplivechat' ),
|
4477 |
+
'next_text' => __( '»', 'wplivechat' ),
|
4478 |
+
'total' => $num_of_pages,
|
4479 |
+
'current' => $pagenum
|
4480 |
+
) );
|
4481 |
+
|
4482 |
+
if ( $page_links ) {
|
4483 |
+
echo '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0;float:none;text-align:center;">' . $page_links . '</div></div>';
|
4484 |
+
}
|
4485 |
+
|
4486 |
|
4487 |
}
|
4488 |
|
4576 |
</thead>
|
4577 |
<tbody id=\"the-list\" class='list:wp_list_text_link'>";
|
4578 |
|
4579 |
+
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
|
4580 |
+
$limit = 20; // number of rows in page
|
4581 |
+
$offset = ( $pagenum - 1 ) * $limit;
|
4582 |
+
$total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_offline_msgs" );
|
4583 |
+
$num_of_pages = ceil( $total / $limit );
|
4584 |
+
|
4585 |
+
$sql = "SELECT * FROM $wplc_tblname_offline_msgs ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
|
4586 |
|
4587 |
$results = $wpdb->get_results($sql);
|
4588 |
|
4603 |
echo "
|
4604 |
</tbody>
|
4605 |
</table>";
|
4606 |
+
|
4607 |
+
$page_links = paginate_links( array(
|
4608 |
+
'base' => add_query_arg( 'pagenum', '%#%' ),
|
4609 |
+
'format' => '',
|
4610 |
+
'prev_text' => __( '«', 'wplivechat' ),
|
4611 |
+
'next_text' => __( '»', 'wplivechat' ),
|
4612 |
+
'total' => $num_of_pages,
|
4613 |
+
'current' => $pagenum
|
4614 |
+
) );
|
4615 |
+
|
4616 |
+
if ( $page_links ) {
|
4617 |
+
echo '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0;float:none;text-align:center;">' . $page_links . '</div></div>';
|
4618 |
+
}
|
4619 |
}
|
4620 |
|
4621 |
/**
|
5162 |
if ( isset( $wplc_settings['wplc_enable_all_admin_pages'] ) && $wplc_settings['wplc_enable_all_admin_pages'] === '1' ) {
|
5163 |
/* Run admin JS on all admin pages */
|
5164 |
$wplcrun = true;
|
5165 |
+
|
5166 |
+
|
5167 |
} else {
|
5168 |
+
|
5169 |
if( $hook === 'toplevel_page_wplivechat-menu') { $wplcrun = true; } // stop if we are not on the right page
|
5170 |
}
|
5171 |
|
5172 |
|
5173 |
+
if ( $wplcrun ) {
|
5174 |
+
|
5175 |
|
|
|
5176 |
|
5177 |
|
5178 |
$pointer_localize_strings = array(
|