LiveChat – WP live chat plugin for WordPress - Version 2.1.0

Version Description

  • Added "Settings" link to plugin settings page
  • Added "Download application" button
  • Added Control Panel
  • Added Chat button installation help for themes with no widgets support
Download this release

Release Info

Developer livechat
Plugin Icon 128x128 LiveChat – WP live chat plugin for WordPress
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.0 to 2.1.0

livechat.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Live Chat Software for Wordpress
4
  Plugin URI: http://www.livechatinc.com
5
  Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install the live chat button and monitoring code on any WordPress website.
6
  Author: LIVECHAT Software
7
- Version: 2.0.0
8
  Author URI: http://www.livechatinc.com
9
  */
10
 
@@ -18,6 +18,7 @@ Author URI: http://www.livechatinc.com
18
  */
19
 
20
  define ('LIVECHAT_PLUGIN_URL', WP_PLUGIN_URL . str_replace('\\', '/', strrchr(dirname(__FILE__), DIRECTORY_SEPARATOR)) . '/plugin_files');
 
21
 
22
  function livechat_admin_head()
23
  {
@@ -40,6 +41,8 @@ function livechat_admin_footer()
40
  */
41
  function livechat_sanitize_license_number ($license_number)
42
  {
 
 
43
  if (preg_match('/^\d{2,}$/', $license_number)) return $license_number;
44
 
45
  return '';;
@@ -47,16 +50,26 @@ function livechat_sanitize_license_number ($license_number)
47
 
48
  function livechat_sanitize_lang ($lang)
49
  {
 
50
  if (preg_match('/^[a-z]{2}$/', $lang)) return $lang;
51
 
52
  return 'en';
53
  }
54
 
 
 
 
 
 
 
 
 
55
  function livechat_admin_register_settings()
56
  {
 
57
  register_setting ('livechat_license_information', 'livechat_license_number', 'livechat_sanitize_license_number');
58
  register_setting ('livechat_license_information', 'livechat_lang', 'livechat_sanitize_lang');
59
- register_setting ('livechat_license_information', 'livechat_groups');
60
  register_setting ('livechat_license_information', 'livechat_params');
61
  register_setting ('livechat_license_information', 'livechat_license_created_flag');
62
  }
@@ -79,12 +92,27 @@ function livechat_read_options()
79
  /**
80
  * Creates new admin menu
81
  */
 
 
 
 
 
 
 
82
  function livechat_admin_menu()
83
  {
84
- require_once (dirname(__FILE__).'/plugin_files/settings.php');
 
 
85
 
86
- add_menu_page ('Live chat settings', 'Live chat', 'administrator', '_livechat_settings', '_livechat_settings' /* live chat logo here */);
87
- add_submenu_page ('_livechat_settings', 'Live chat settings', 'Settings', 'administrator', '_livechat_settings', '_livechat_settings');
 
 
 
 
 
 
88
  }
89
 
90
  add_action ('admin_head', 'livechat_admin_head');
@@ -92,6 +120,26 @@ add_action ('admin_footer', 'livechat_admin_footer');
92
  add_action ('admin_menu', 'livechat_admin_menu');
93
  add_action ('admin_init', 'livechat_admin_register_settings');
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
 
97
  //
@@ -111,26 +159,40 @@ add_action ('get_footer', 'livechat_monitoring_code');
111
 
112
 
113
  //
114
- // Chat button code installation
115
  //
116
 
117
- function livechat_chat_button_code()
118
  {
119
- require_once (dirname(__FILE__).'/plugin_files/chat_button_code.php');
120
 
121
  list ($license_number, $lang, $groups, $params) = livechat_read_options();
122
 
123
  _livechat_chat_button_code ($license_number, $lang, $groups);
124
  }
125
 
126
- function livechat_chat_button_code_control()
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  {
128
- require_once (dirname(__FILE__).'/plugin_files/chat_button_code.php');
129
 
130
  list ($license_number, $lang, $groups, $params) = livechat_read_options();
131
 
132
- _livechat_chat_button_code_control ($license_number, $lang, $groups);
133
  }
134
 
135
- wp_register_sidebar_widget ('livechat_widget', 'Live chat for Wordpress', 'livechat_chat_button_code');
136
- wp_register_widget_control ('livechat_widget', 'Live chat for Wordpress', 'livechat_chat_button_code_control');
 
4
  Plugin URI: http://www.livechatinc.com
5
  Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install the live chat button and monitoring code on any WordPress website.
6
  Author: LIVECHAT Software
7
+ Version: 2.1.0
8
  Author URI: http://www.livechatinc.com
9
  */
10
 
18
  */
19
 
20
  define ('LIVECHAT_PLUGIN_URL', WP_PLUGIN_URL . str_replace('\\', '/', strrchr(dirname(__FILE__), DIRECTORY_SEPARATOR)) . '/plugin_files');
21
+ define ('LIVECHAT_LICENSE_INSTALLED', (bool)(strlen(get_option('livechat_license_number') > 0)));
22
 
23
  function livechat_admin_head()
24
  {
41
  */
42
  function livechat_sanitize_license_number ($license_number)
43
  {
44
+ $license_number = trim($license_number);
45
+ if (intval($license_number) > 0) return intval($license_number);
46
  if (preg_match('/^\d{2,}$/', $license_number)) return $license_number;
47
 
48
  return '';;
50
 
51
  function livechat_sanitize_lang ($lang)
52
  {
53
+ $lang = trim($lang);
54
  if (preg_match('/^[a-z]{2}$/', $lang)) return $lang;
55
 
56
  return 'en';
57
  }
58
 
59
+ function livechat_sanitize_groups ($groups)
60
+ {
61
+ $groups = trim($groups);
62
+ if (preg_match('/^(\d+)(,\d+)+$/', $groups)) return $groups;
63
+
64
+ return '0';
65
+ }
66
+
67
  function livechat_admin_register_settings()
68
  {
69
+ register_setting ('livechat_license_information', 'livechat_license_not_installed');
70
  register_setting ('livechat_license_information', 'livechat_license_number', 'livechat_sanitize_license_number');
71
  register_setting ('livechat_license_information', 'livechat_lang', 'livechat_sanitize_lang');
72
+ register_setting ('livechat_license_information', 'livechat_groups', 'livechat_sanitize_groups');
73
  register_setting ('livechat_license_information', 'livechat_params');
74
  register_setting ('livechat_license_information', 'livechat_license_created_flag');
75
  }
92
  /**
93
  * Creates new admin menu
94
  */
95
+ function livechat_settings_link($links)
96
+ {
97
+ $settings_link = sprintf( '<a href="admin.php?page=livechat_settings">%s</a>', __('Settings'));
98
+ array_unshift ($links, $settings_link);
99
+ return $links;
100
+ }
101
+
102
  function livechat_admin_menu()
103
  {
104
+ global $wp_registered_sidebars;
105
+ define('LIVECHAT_WIDGETS_ENABLED', (bool)(sizeof($wp_registered_sidebars) > 0));
106
+
107
 
108
+ add_menu_page ('Live chat settings', 'Live chat', 'administrator', 'livechat_settings', 'livechat_settings' /* live chat logo here */);
109
+ add_submenu_page ('livechat_settings', 'Live chat settings', 'Settings', 'administrator', 'livechat_settings', 'livechat_settings');
110
+ if (LIVECHAT_LICENSE_INSTALLED && LIVECHAT_WIDGETS_ENABLED == false) add_submenu_page ('livechat_settings', 'Chat button', 'Chat button', 'administrator', 'livechat_chat_button', 'livechat_chat_button');
111
+ add_submenu_page ('livechat_settings', 'Control Panel', 'Control Panel', 'administrator', 'livechat_control_panel', 'livechat_control_panel');
112
+
113
+ // Settings link
114
+ $plugin = plugin_basename(__FILE__);
115
+ add_filter( 'plugin_action_links_'.$plugin, 'livechat_settings_link');
116
  }
117
 
118
  add_action ('admin_head', 'livechat_admin_head');
120
  add_action ('admin_menu', 'livechat_admin_menu');
121
  add_action ('admin_init', 'livechat_admin_register_settings');
122
 
123
+ //
124
+ // Main settings page
125
+ //
126
+
127
+ function livechat_settings()
128
+ {
129
+ require_once (dirname(__FILE__).'/plugin_files/settings.php');
130
+
131
+ _livechat_settings();
132
+ }
133
+
134
+ //
135
+ // Control panel page
136
+ //
137
+
138
+ function livechat_control_panel()
139
+ {
140
+ echo '<iframe id="control_panel" src="https://panel.livechatinc.net/" frameborder="0"></iframe>';
141
+ echo '<p>Optionally, open the Control Panel in <a href="https://panel.livechatinc.net/" target="_blank">external window</a>.</p>';
142
+ }
143
 
144
 
145
  //
159
 
160
 
161
  //
162
+ // Chat button info page
163
  //
164
 
165
+ function livechat_chat_button()
166
  {
167
+ require_once (dirname(__FILE__).'/plugin_files/chat_button.php');
168
 
169
  list ($license_number, $lang, $groups, $params) = livechat_read_options();
170
 
171
  _livechat_chat_button_code ($license_number, $lang, $groups);
172
  }
173
 
174
+ //
175
+ // Chat button Widget
176
+ //
177
+
178
+ function livechat_chat_button_widget()
179
+ {
180
+ require_once (dirname(__FILE__).'/plugin_files/chat_button.php');
181
+
182
+ list ($license_number, $lang, $groups, $params) = livechat_read_options();
183
+
184
+ _livechat_chat_button_widget ($license_number, $lang, $groups);
185
+ }
186
+
187
+ function livechat_chat_button_widget_control()
188
  {
189
+ require_once (dirname(__FILE__).'/plugin_files/chat_button.php');
190
 
191
  list ($license_number, $lang, $groups, $params) = livechat_read_options();
192
 
193
+ _livechat_chat_button_widget_control ($license_number, $lang, $groups);
194
  }
195
 
196
+
197
+ wp_register_sidebar_widget ('livechat_widget', 'Live chat for Wordpress', 'livechat_chat_button_widget');
198
+ wp_register_widget_control ('livechat_widget', 'Live chat for Wordpress', 'livechat_chat_button_widget_control');
plugin_files/chat_button.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Chat button Widget
4
+ function _livechat_chat_button_widget ($license_number, $lang, $groups, $use_ssl = false)
5
+ {
6
+ ?>
7
+
8
+ <!-- BEGIN LIVECHAT button tag. See also www.livechatinc.com -->
9
+ <div style="text-align:center"><a id="LivechatButton" href="http<?php echo $use_ssl ? 's' : ''; ?>://chat.livechatinc.net/licence/<?php echo $license_number; ?>/open_chat.cgi?groups=<?php echo $groups; ?>&amp;lang=<?php echo $lang; ?>" target="chat_<?php echo $license_number; ?>" onclick="window.open('http<?php echo $use_ssl ? 's' : ''; ?>://chat.livechatinc.net/licence/<?php echo $license_number; ?>/open_chat.cgi?groups=<?php echo $groups; ?>'+'&amp;lang=<?php echo $lang; ?>&amp;dc='+escape(document.cookie+';l='+document.location+';r='+document.referer+';s='+typeof lc_session),'Czat_<?php echo $license_number; ?>','width=529,height=520,resizable=yes,scrollbars=no,status=1');return false;"></a><script type='text/javascript'>var img=new Image();img.style.border='0';img.src=(("https:" == document.location.protocol) ? "https://" : "http://")+'chat.livechatinc.net/licence/<?php echo $license_number; ?>/button.cgi?lang=<?php echo $lang; ?>&groups=<?php echo $groups; ?>'+'&d='+((new Date()).getTime());var _livechat_button=document.getElementById('LivechatButton');if(_livechat_button!=null){_livechat_button.appendChild(img);}</script><br><span style="font-family:Tahoma,sans-serif;font-size:10px;color:#333"><a href="http://www.livechatinc.com" style="font-size:10px;text-decoration:none" target="_blank">Live Chat</a> <span style="color: #475780">Software for Business</span></span></div>
10
+ <!-- END LIVECHAT button tag. See also www.livechatinc.com -->
11
+
12
+ <?php
13
+ }
14
+
15
+ // Chat button Widget controls
16
+ function _livechat_chat_button_widget_control ($license_number, $lang, $groups, $use_ssl = false)
17
+ {
18
+ if (LIVECHAT_LICENSE_INSTALLED):
19
+ ?>
20
+ <p>Your live chat button is installed properly!</p>
21
+ <hr class="livechat">
22
+ <p>License number: <strong><?php echo $license_number; ?></strong><br>
23
+ Language: <strong><?php echo $lang; ?></strong><br>
24
+ Groups: <strong><?php echo $groups; ?></strong></p>
25
+ <hr class="livechat">
26
+ <p>To change these settings, go to <a href="?page=livechat_settings">Live chat plugin settings page</a>.</p>
27
+ <?php else: ?>
28
+ <p>Your live chat button <strong>is not working yet</strong>.</p>
29
+ <p>You need to <a href="?page=livechat_settings">set up your live chat account</a> first.</p>
30
+ <?php endif; ?>
31
+ <?php
32
+ }
33
+
34
+
35
+ // Chat button info page
36
+ function _livechat_chat_button_code ($license_number, $lang, $groups, $use_ssl = false)
37
+ {
38
+ ?>
39
+ <div class="wrap">
40
+ <h2>Live chat software for Wordpress</h2>
41
+ <p>Your theme <strong>does not</strong> support Widgets <a class="help" href="http://codex.wordpress.org/WordPress_Widgets">(read more)</a>. Thus, you can't easily drag&amp;drop the Widget in your Wordpress admin page.</p>
42
+ <hr class="livechat">
43
+ <p>To install live chat button on your page, you need to <strong>put the following code in a visible place of your website</strong>:</p>
44
+
45
+ <textarea id="chat_button" cols="80" rows="12" readonly="readonly" onclick="this.select()">
46
+ <!-- BEGIN LIVECHAT button tag. See also www.livechatinc.com -->
47
+ <div style="text-align:center"><a id="LivechatButton" href="http<?php echo $use_ssl ? 's' : ''; ?>://chat.livechatinc.net/licence/<?php echo $license_number; ?>/open_chat.cgi?groups=<?php echo $groups; ?>&amp;lang=<?php echo $lang; ?>" target="chat_<?php echo $license_number; ?>" onclick="window.open('http<?php echo $use_ssl ? 's' : ''; ?>://chat.livechatinc.net/licence/<?php echo $license_number; ?>/open_chat.cgi?groups=<?php echo $groups; ?>'+'&amp;lang=<?php echo $lang; ?>&amp;dc='+escape(document.cookie+';l='+document.location+';r='+document.referer+';s='+typeof lc_session),'Czat_<?php echo $license_number; ?>','width=529,height=520,resizable=yes,scrollbars=no,status=1');return false;"></a><script type='text/javascript'>var img=new Image();img.style.border='0';img.src=(("https:" == document.location.protocol) ? "https://" : "http://")+'chat.livechatinc.net/licence/<?php echo $license_number; ?>/button.cgi?lang=<?php echo $lang; ?>&groups=<?php echo $groups; ?>'+'&d='+((new Date()).getTime());var _livechat_button=document.getElementById('LivechatButton');if(_livechat_button!=null){_livechat_button.appendChild(img);}</script><br><span style="font-family:Tahoma,sans-serif;font-size:10px;color:#333"><a href="http://www.livechatinc.com" style="font-size:10px;text-decoration:none" target="_blank">Live Chat</a> <span style="color: #475780">Software for Business</span></span></div>
48
+ <!-- END LIVECHAT button tag. See also www.livechatinc.com -->
49
+ </textarea>
50
+
51
+ <p>Need help? Read more about <a href="http://www.livechatinc.com/en/support/manual/chat_button.htm" target="_blank">live chat buttons</a>.</p>
52
+ </div>
53
+ <?php
54
+ }
55
+
plugin_files/chat_button_code.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
-
3
- function _livechat_chat_button_code ($license_number, $lang, $groups, $use_ssl = false)
4
- {
5
- ?>
6
-
7
- <!-- BEGIN LIVECHAT button tag. See also www.livechatinc.com -->
8
- <div style="text-align:center"><a id="LivechatButton" href="http<?php echo $use_ssl ? 's' : ''; ?>://chat.livechatinc.net/licence/<?php echo $license_number; ?>/open_chat.cgi?groups=<?php echo $groups; ?>&amp;lang=<?php echo $lang; ?>" target="chat_<?php echo $license_number; ?>" onclick="window.open('http<?php echo $use_ssl ? 's' : ''; ?>://chat.livechatinc.net/licence/<?php echo $license_number; ?>/open_chat.cgi?groups=<?php echo $groups; ?>'+'&amp;lang=<?php echo $lang; ?>&amp;dc='+escape(document.cookie+';l='+document.location+';r='+document.referer+';s='+typeof lc_session),'Czat_<?php echo $license_number; ?>','width=529,height=520,resizable=yes,scrollbars=no,status=1');return false;"></a><script type='text/javascript'>var img=new Image();img.style.border='0';img.src=(("https:" == document.location.protocol) ? "https://" : "http://")+'chat.livechatinc.net/licence/<?php echo $license_number; ?>/button.cgi?lang=<?php echo $lang; ?>&groups=<?php echo $groups; ?>'+'&d='+((new Date()).getTime());var _livechat_button=document.getElementById('LivechatButton');if(_livechat_button!=null){_livechat_button.appendChild(img);}</script><br><span style="font-family:Tahoma,sans-serif;font-size:10px;color:#333"><a href="http://www.livechatinc.com" style="font-size:10px;text-decoration:none" target="_blank">Live Chat</a> <span style="color: #475780">Software for Business</span></span></div>
9
- <!-- END LIVECHAT button tag. See also www.livechatinc.com -->
10
-
11
- <?php
12
- }
13
-
14
- function _livechat_chat_button_code_control ($license_number, $lang, $groups, $use_ssl = false)
15
- {
16
- if (strlen(get_option('livechat_license_number') > 0)):
17
- ?>
18
- <p>Your live chat button is installed properly!</p>
19
- <hr class="livechat">
20
- <p>License number: <strong><?php echo $license_number; ?></strong><br>
21
- Language: <strong><?php echo $lang; ?></strong><br>
22
- Groups: <strong><?php echo $groups; ?></strong></p>
23
- <hr class="livechat">
24
- <p>To change these settings, go to <a href="?page=_livechat_settings">Live chat plugin settings page</a>.</p>
25
- <?php else: ?>
26
- <p>Your live chat button <strong>is not working yet</strong>.</p>
27
- <p>You need to <a href="?page=_livechat_settings">set up your live chat account</a> first.</p>
28
- <?php endif; ?>
29
- <?php
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin_files/css/styles.css CHANGED
@@ -2,6 +2,7 @@
2
  .postbox h3 { cursor: default; }
3
  .postbox_content { padding: 0 10px; }
4
  .postbox_content ul { margin-top: 5px; }
 
5
  .explanation { display: block; margin-top: 3px; padding-left: 5px; }
6
  a.help,
7
  span.help a { color: #bbb; }
@@ -21,4 +22,16 @@ hr.livechat { margin-bottom: 1em; height: 1px; border: 0; color: #999; backgroun
21
  #ajax_message.wait,
22
  #ajax_message.message { display: block; }
23
  #ajax_message.wait { text-indent: 28px; }
24
- #ajax_message.message { background-image: none; text-indent: 0px; }
 
 
 
 
 
 
 
 
 
 
 
 
2
  .postbox h3 { cursor: default; }
3
  .postbox_content { padding: 0 10px; }
4
  .postbox_content ul { margin-top: 5px; }
5
+ .postbox label { line-height: 1.5em; }
6
  .explanation { display: block; margin-top: 3px; padding-left: 5px; }
7
  a.help,
8
  span.help a { color: #bbb; }
22
  #ajax_message.wait,
23
  #ajax_message.message { display: block; }
24
  #ajax_message.wait { text-indent: 28px; }
25
+ #ajax_message.message { background-image: none; text-indent: 0px; }
26
+
27
+ #control_panel { width: 99%; border: 0; }
28
+ #chat_button { font-family: "Courier New", Courier, monospace; width: 650px; height: 300px; font-size: 85%; }
29
+
30
+ .awesome, .awesome:visited { background: #222 url(../images/awesome_button_overlay.png) repeat-x; display: inline-block; padding: 5px 10px 6px; color: #fff; text-decoration: none; -moz-border-radius: 5px; -webkit-border-radius: 5px; -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5); text-shadow: 0 -1px 1px rgba(0,0,0,0.25); border-bottom: 1px solid rgba(0,0,0,0.25); position: relative; cursor: pointer; }
31
+ .awesome:hover { background-color: #111; color: #fff; }
32
+ .awesome:active { top: 1px; }
33
+ .awesome, .awesome:visited { font-size: 13px; font-weight: bold; line-height: 1; text-shadow: 0 -1px 1px rgba(0,0,0,0.25); }
34
+ .blue.awesome, .blue.awesome:visited { background-color: #2daebf; }
35
+ .blue.awesome:hover { background-color: #007d9a; }
36
+ .red.awesome, .red.awesome:visited { background-color: #e33100; }
37
+ .red.awesome:hover { background-color: #872300; }
plugin_files/images/awesome_button_overlay.png ADDED
Binary file
plugin_files/js/scripts.js CHANGED
@@ -16,5 +16,25 @@ $(document).ready(function()
16
  }
17
 
18
  show_form();
19
- $('#choice_account input').change(show_form);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  });
16
  }
17
 
18
  show_form();
19
+ $('#choice_account input').click(show_form);
20
+
21
+ // Control Panel iframe height
22
+ var cp = $('#control_panel');
23
+ if (cp.length)
24
+ {
25
+ var cp_resize = function()
26
+ {
27
+ var cp_height = window.innerHeight ? window.innerHeight : $(window).height();
28
+ cp_height -= $('#wphead').height();
29
+ cp_height -= $('#updated-nag').height();
30
+ cp_height -= $('#control_panel + p').height();
31
+ cp_height -= $('#footer').height();
32
+ cp_height -= 70;
33
+
34
+ cp.attr('height', cp_height);
35
+ }
36
+ cp_resize();
37
+ $(window).resize(cp_resize);
38
+ }
39
+
40
  });
plugin_files/settings.php CHANGED
@@ -2,12 +2,12 @@
2
 
3
  function _livechat_helper_license_created_info()
4
  {
5
- echo '<div class="updated installed_ok"><p><strong>Your live chat license has been created! Please follow the instructions we\'ve sent you on your e-mail address to install live chat agent application.</strong></p></div>';
6
  }
7
 
8
  function _livechat_helper_monitoring_code_info()
9
  {
10
- if (strlen(get_option('livechat_license_number') > 0))
11
  {
12
  echo '<div class="updated installed_ok"><p><strong>Your live chat monitoring code is installed properly. <a class="help" href="http://www.livechatinc.com/en/support/manual/monitoring_code.htm">(what is a monitoring code?)</a> </strong></p></div>';
13
  }
@@ -15,7 +15,7 @@ function _livechat_helper_monitoring_code_info()
15
 
16
  function _livechat_helper_chat_button_info()
17
  {
18
- if (strlen(get_option('livechat_license_number') > 0))
19
  {
20
  if (is_active_widget (null, 'livechat_widget', true))
21
  {
@@ -23,7 +23,15 @@ function _livechat_helper_chat_button_info()
23
  }
24
  else
25
  {
26
- echo '<div class="updated info"><p><strong>To install your live chat button, go to <a href="widgets.php">Widgets</a> page. <a class="help" href="http://www.livechatinc.com/en/support/manual/chat_button.htm" target="_blank">(what is a chat button?)</a> </strong></p></div>';
 
 
 
 
 
 
 
 
27
  }
28
  }
29
  }
@@ -72,24 +80,30 @@ else
72
 
73
  <!-- Already have an account -->
74
  <div class="metabox-holder" id="livechat_already_have" style="display:none">
 
 
 
 
 
 
 
 
 
 
 
75
  <div class="postbox">
76
  <form method="post" action="options.php">
77
  <?php settings_fields('livechat_license_information'); ?>
78
 
79
- <h3>Enter your live chat account information</h3>
80
  <div class="postbox_content">
81
  <table class="form-table">
82
  <tr>
83
  <th scope="row"><label for="livechat_license_number">My license number is:</label></th>
84
- <td><input type="text" name="livechat_license_number" id="livechat_license_number" value="<?php echo get_option('livechat_license_number'); ?>" /> <span class="explanation">You will find your license number in the <a href="https://panel.livechatinc.net/" target="_blank">Control Panel</a>.</span></td>
85
  </tr>
86
- </table>
87
- </div>
88
 
89
- <?php if (strlen(get_option('livechat_license_number')) > 1): ?>
90
- <h3 class="no-radius">Advanced settings</h3>
91
- <div class="postbox_content">
92
- <table class="form-table">
93
  <?php
94
  $lang = get_option('livechat_lang');
95
  if (empty($lang)) $lang = 'en';
@@ -115,10 +129,9 @@ else
115
  <th scope="row"><label for="livechat_params">Params:</label></th>
116
  <td><input type="text" name="livechat_params" id="livechat_params" value="<?php echo $params; ?>" /> <a class="help" href="http://www.livechatinc.com/en/support/documentation/customizing_web_agent_.htm" target="_blank">advanced help</a></td>
117
  </tr>
118
- </table>
119
  <?php else: ?>
120
- <div class="postbox_content">
121
  <?php endif; ?>
 
122
 
123
  <p class="submit">
124
  <input type="hidden" name="livechat_license_created_flag" value="0" id="livechat_license_created_flag">
2
 
3
  function _livechat_helper_license_created_info()
4
  {
5
+ echo '<div class="updated installed_ok"><p><strong>Your live chat license has been created! Please install the <a href="http://www.livechatinc.com/download/contact_center/LIVECHAT_Contact_Center.exe">live chat application</a> and start chatting!</strong></p></div>';
6
  }
7
 
8
  function _livechat_helper_monitoring_code_info()
9
  {
10
+ if (LIVECHAT_LICENSE_INSTALLED)
11
  {
12
  echo '<div class="updated installed_ok"><p><strong>Your live chat monitoring code is installed properly. <a class="help" href="http://www.livechatinc.com/en/support/manual/monitoring_code.htm">(what is a monitoring code?)</a> </strong></p></div>';
13
  }
15
 
16
  function _livechat_helper_chat_button_info()
17
  {
18
+ if (LIVECHAT_LICENSE_INSTALLED)
19
  {
20
  if (is_active_widget (null, 'livechat_widget', true))
21
  {
23
  }
24
  else
25
  {
26
+ // Check if theme supports Widgets
27
+ if (LIVECHAT_WIDGETS_ENABLED)
28
+ {
29
+ echo '<div class="updated info"><p><strong>To install your live chat button, go to <a href="widgets.php">Widgets</a> page. <a class="help" href="http://www.livechatinc.com/en/support/manual/chat_button.htm" target="_blank">(what is a chat button?)</a> </strong></p></div>';
30
+ }
31
+ else
32
+ {
33
+ echo '<div class="updated info"><p><strong>To install your live chat button, <a href="?page=livechat_chat_button">click here</a>. <a class="help" href="http://www.livechatinc.com/en/support/manual/chat_button.htm" target="_blank">(what is a chat button?)</a> </strong></p></div>';
34
+ }
35
  }
36
  }
37
  }
80
 
81
  <!-- Already have an account -->
82
  <div class="metabox-holder" id="livechat_already_have" style="display:none">
83
+
84
+ <?php if (LIVECHAT_LICENSE_INSTALLED): ?>
85
+ <div class="postbox">
86
+ <h3>Download application</h3>
87
+ <div class="postbox_content">
88
+ <p>Download the live chat application and start chatting with your customers!</p>
89
+ <p><a href="http://www.livechatinc.com/download/contact_center/LIVECHAT_Contact_Center.exe" class="awesome blue">Download application</a></p>
90
+ </div>
91
+ </div>
92
+ <?php endif; ?>
93
+
94
  <div class="postbox">
95
  <form method="post" action="options.php">
96
  <?php settings_fields('livechat_license_information'); ?>
97
 
98
+ <h3>Live chat account</h3>
99
  <div class="postbox_content">
100
  <table class="form-table">
101
  <tr>
102
  <th scope="row"><label for="livechat_license_number">My license number is:</label></th>
103
+ <td><input type="text" name="livechat_license_number" id="livechat_license_number" value="<?php echo get_option('livechat_license_number'); ?>" /><?php if (LIVECHAT_LICENSE_INSTALLED == false): ?> <span class="explanation">You will find your license number in the <a href="?page=livechat_control_panel">Control Panel</a>.</span><?php endif; ?></td>
104
  </tr>
 
 
105
 
106
+ <?php if (LIVECHAT_LICENSE_INSTALLED): ?>
 
 
 
107
  <?php
108
  $lang = get_option('livechat_lang');
109
  if (empty($lang)) $lang = 'en';
129
  <th scope="row"><label for="livechat_params">Params:</label></th>
130
  <td><input type="text" name="livechat_params" id="livechat_params" value="<?php echo $params; ?>" /> <a class="help" href="http://www.livechatinc.com/en/support/documentation/customizing_web_agent_.htm" target="_blank">advanced help</a></td>
131
  </tr>
 
132
  <?php else: ?>
 
133
  <?php endif; ?>
134
+ </table>
135
 
136
  <p class="submit">
137
  <input type="hidden" name="livechat_license_created_flag" value="0" id="livechat_license_created_flag">
readme.txt CHANGED
@@ -214,6 +214,12 @@ This add-on allows agents to use Skype account to call back the customers in the
214
 
215
  == Changelog ==
216
 
 
 
 
 
 
 
217
  = 2.0.0 =
218
  * Rewritten whole plugin from scratch
219
  * Ability to create new license from Wordpress plugin settings
214
 
215
  == Changelog ==
216
 
217
+ = 2.1.0 =
218
+ * Added "Settings" link to plugin settings page
219
+ * Added "Download application" button
220
+ * Added Control Panel
221
+ * Added Chat button installation help for themes with no widgets support
222
+
223
  = 2.0.0 =
224
  * Rewritten whole plugin from scratch
225
  * Ability to create new license from Wordpress plugin settings