Zendesk Chat - Version 1.0.7

Version Description

  • Maintenance update: Remove phased out "middle left", "middle right" positions
  • Add options to let user decides hiding of chat bubble, no longer force show/hide
  • Enable option for not using plugins' greeting messages
Download this release

Release Info

Developer bencxr
Plugin Icon 128x128 Zendesk Chat
Version 1.0.7
Comparing to
See all releases

Code changes from version 1.0.6 to 1.0.7

Files changed (5) hide show
  1. customizewidget.php +83 -29
  2. readme.txt +39 -17
  3. screenshot-1.png +0 -0
  4. screenshot-2.png +0 -0
  5. zopim.php +24 -18
customizewidget.php CHANGED
@@ -14,23 +14,27 @@ function zopim_customize_widget() {
14
  if (count($_POST) > 0) {
15
  update_option('zopimLang', $_POST["zopimLang"]);
16
  update_option('zopimPosition', $_POST["zopimPosition"]);
 
 
 
 
 
17
 
18
  update_checkbox("zopimGetVisitorInfo");
19
  update_checkbox("zopimHideOnOffline");
20
- update_checkbox("zopimBubbleEnable");
21
 
22
- $greetings->online->window = stripslashes($_POST["zopimOnlineLong"]);
23
- $greetings->online->bar = stripslashes($_POST["zopimOnlineShort"]);
24
- $greetings->away->window = stripslashes($_POST["zopimAwayLong"]);
25
- $greetings->away->bar = stripslashes($_POST["zopimAwayShort"]);
26
- $greetings->offline->window = stripslashes($_POST["zopimOfflineLong"]);
27
- $greetings->offline->bar = stripslashes($_POST["zopimOfflineShort"]);
 
 
 
 
28
 
29
- update_option('zopimGreetings', to_json($greetings));
30
- update_option('zopimColor', $_POST["zopimColor"]);
31
- update_option('zopimTheme', $_POST["zopimTheme"]);
32
- update_option('zopimBubbleTitle', stripslashes($_POST["zopimBubbleTitle"]));
33
- update_option('zopimBubbleText', stripslashes($_POST["zopimBubbleText"]));
34
  $message = "<b>Changes saved!</b><br>";
35
  }
36
 
@@ -110,13 +114,35 @@ function zopim_customize_widget() {
110
  }
111
 
112
  function updateBubbleStatus() {
113
- if (document.getElementById("zopimBubbleEnable").checked) {
114
- $zopim.livechat.bubble.show();
115
- $zopim.livechat.bubble.reset();
116
- } else {
117
- $zopim.livechat.bubble.hide();
118
- }
 
 
 
 
 
 
119
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
 
121
  var timer;
122
  function updateSoon() {
@@ -197,7 +223,7 @@ line-height:21px;
197
 
198
  <select name="zopimPosition" id="zopimPosition" onchange="updatePosition()">
199
  <?php
200
- $positions = array("br" => "Bottom Right", "bl" => "Bottom Left", "mr" => "Right", "ml" => "Left");
201
  echo generate_options($positions, get_option('zopimPosition'));
202
  ?>
203
  </select>
@@ -208,7 +234,10 @@ line-height:21px;
208
  <th scope="row">Hide chat bar when offline<br>
209
  <!-- <div class="smallExplanation">Hide the chat bar when no agents are available to answer questions. This prevents visitors from sending you offline messages. </div> -->
210
  </th>
211
- <td><input onchange="updateWidget()" type="checkbox" id="zopimHideOnOffline" name="zopimHideOnOffline" value="zopimHideOnOffline" <?php if (get_option('zopimHideOnOffline') && get_option('zopimHideOnOffline')!="disabled") { echo "checked='checked'"; } ?> /> This prevents visitors from sending you offline messages</td>
 
 
 
212
  </tr>
213
  </table>
214
  </div>
@@ -278,7 +307,13 @@ line-height:21px;
278
  <tr valign="top">
279
  <th scope="row">Display Help Bubble<br>
280
  </th>
281
- <td><input onchange="updateBubbleStatus()" type="checkbox" id="zopimBubbleEnable" name="zopimBubbleEnable" value="zopimBubbleEnable" <?php if (get_option('zopimBubbleEnable')!="disabled") { echo "checked='checked'"; } ?> /> Use this pretty chat bubble to grab attention!</td>
 
 
 
 
 
 
282
  </tr>
283
  <tr valign="top">
284
  <th scope="row" class="sethead">Help Bubble Title
@@ -304,53 +339,70 @@ line-height:21px;
304
  </div>
305
  </div>
306
 
 
 
 
 
 
 
 
307
  <div class="metabox-holder">
308
  <div class="postbox">
309
  <h3 class="hndle"><span>Greeting Message Settings</span></h3>
310
  <div style="padding:10px;">
311
  <table class="form-table">
312
- <tr><td colspan="2"><div class="secthead">Message Shown on Chat Bar</div></td></tr>
 
 
 
 
 
 
 
313
  <tr valign="top">
314
  <th scope="row" class="sethead">Online</th>
315
  <td>
316
- <input class="inputtextshort" name="zopimOnlineShort" id="zopimOnlineShort" onKeyup="updateSoon()" value="<?php echo $greetings->online->bar; ?>">
 
 
 
317
  </td>
318
  </tr>
319
 
320
  <tr valign="top">
321
  <th scope="row" class="sethead">Away</th>
322
  <td>
323
- <input class="inputtextshort" name="zopimAwayShort" id="zopimAwayShort" onKeyup="updateSoon()" value="<?php echo $greetings->away->bar; ?>">
324
  </td>
325
  </tr>
326
 
327
  <tr valign="top">
328
  <th scope="row" class="sethead">Offline</th>
329
  <td>
330
- <input class="inputtextshort" name="zopimOfflineShort" id="zopimOfflineShort" onKeyup="updateSoon()" value="<?php echo $greetings->offline->bar; ?>">
331
  </td>
332
  </tr>
333
 
334
 
335
- <tr><td colspan="2"><div class="secthead">Message Shown on Chat Panel</div></td></tr>
336
  <tr valign="top">
337
  <th scope="row" class="sethead">Online</th>
338
  <td>
339
- <textarea class="inputtext" name="zopimOnlineLong" id="zopimOnlineLong" onKeyup="updateSoon()"><?php echo $greetings->online->window; ?></textarea>
340
  </td>
341
  </tr>
342
 
343
  <tr valign="top">
344
  <th scope="row" class="sethead">Away</th>
345
  <td>
346
- <textarea class="inputtext" name="zopimAwayLong" id="zopimAwayLong" onKeyup="updateSoon()"><?php echo $greetings->away->window; ?></textarea>
347
  </td>
348
  </tr>
349
 
350
  <tr valign="top">
351
  <th scope="row" class="sethead">Offline</th>
352
  <td>
353
- <textarea class="inputtext" name="zopimOfflineLong" id="zopimOfflineLong" onKeyup="updateSoon()"><?php echo $greetings->offline->window; ?></textarea>
354
  </td>
355
  </tr>
356
  </table>
@@ -406,6 +458,8 @@ function get_languages() {
406
 
407
  function update_checkbox($fieldname) {
408
  if (isset($_POST["$fieldname"]) && $_POST["$fieldname"] != "") {
 
 
409
  update_option($fieldname, $_POST["$fieldname"]);
410
  } else {
411
  update_option($fieldname, "disabled");
14
  if (count($_POST) > 0) {
15
  update_option('zopimLang', $_POST["zopimLang"]);
16
  update_option('zopimPosition', $_POST["zopimPosition"]);
17
+ update_option("zopimBubbleEnable", $_POST["zopimBubbleEnable"] );
18
+ update_option('zopimColor', $_POST["zopimColor"]);
19
+ update_option('zopimTheme', $_POST["zopimTheme"]);
20
+ update_option('zopimBubbleTitle', stripslashes($_POST["zopimBubbleTitle"]));
21
+ update_option('zopimBubbleText', stripslashes($_POST["zopimBubbleText"]));
22
 
23
  update_checkbox("zopimGetVisitorInfo");
24
  update_checkbox("zopimHideOnOffline");
25
+ update_checkbox("zopimUseGreetings");
26
 
27
+ if ( isset($_POST['zopimUseGreetings']) && $_POST['zopimUseGreetings'] != "") {
28
+ $greetings->online->window = stripslashes($_POST["zopimOnlineLong"]);
29
+ $greetings->online->bar = stripslashes($_POST["zopimOnlineShort"]);
30
+ $greetings->away->window = stripslashes($_POST["zopimAwayLong"]);
31
+ $greetings->away->bar = stripslashes($_POST["zopimAwayShort"]);
32
+ $greetings->offline->window = stripslashes($_POST["zopimOfflineLong"]);
33
+ $greetings->offline->bar = stripslashes($_POST["zopimOfflineShort"]);
34
+
35
+ update_option('zopimGreetings', to_json($greetings));
36
+ }
37
 
 
 
 
 
 
38
  $message = "<b>Changes saved!</b><br>";
39
  }
40
 
114
  }
115
 
116
  function updateBubbleStatus() {
117
+ var value = document.getElementById("zopimBubbleEnable").value;
118
+ switch (value) {
119
+ case 'default':
120
+ $zopim.livechat.bubble.reset();
121
+ break;
122
+ case 'show':
123
+ $zopim.livechat.bubble.show();
124
+ break;
125
+ case 'hide':
126
+ $zopim.livechat.bubble.hide();
127
+ break;
128
+ }
129
  }
130
+
131
+ function greetingsChanged() {
132
+ var inputs = ['zopimOnlineShort', 'zopimAwayShort', 'zopimOfflineShort',
133
+ 'zopimOnlineLong' , 'zopimAwayLong', 'zopimOfflineLong'];
134
+ var isDisabled = false;
135
+
136
+ if (document.getElementById('zopimUseGreetings').checked)
137
+ isDisabled = false;
138
+ else
139
+ isDisabled = true;
140
+
141
+ for (var i=0; i<inputs.length; i++) {
142
+ var el = document.getElementById(inputs[i]);
143
+ el.disabled = isDisabled;
144
+ }
145
+ }
146
 
147
  var timer;
148
  function updateSoon() {
223
 
224
  <select name="zopimPosition" id="zopimPosition" onchange="updatePosition()">
225
  <?php
226
+ $positions = array("br" => "Bottom Right", "bl" => "Bottom Left");
227
  echo generate_options($positions, get_option('zopimPosition'));
228
  ?>
229
  </select>
234
  <th scope="row">Hide chat bar when offline<br>
235
  <!-- <div class="smallExplanation">Hide the chat bar when no agents are available to answer questions. This prevents visitors from sending you offline messages. </div> -->
236
  </th>
237
+ <td>
238
+ <input onchange="updateWidget()" type="checkbox" id="zopimHideOnOffline" name="zopimHideOnOffline" value="zopimHideOnOffline" <?php if (get_option('zopimHideOnOffline') && get_option('zopimHideOnOffline')!="disabled") { echo "checked='checked'"; } ?> /> This prevents visitors from sending you offline messages -
239
+ <a href="#" onclick="$zopim.livechat.button.show();return false">force show chat button</a>
240
+ </td>
241
  </tr>
242
  </table>
243
  </div>
307
  <tr valign="top">
308
  <th scope="row">Display Help Bubble<br>
309
  </th>
310
+ <td>
311
+ <select onchange="updateBubbleStatus()" type="checkbox" id="zopimBubbleEnable" name="zopimBubbleEnable">
312
+ <?php
313
+ $bubble_modes = array("default" => "Let user decide", "show" => "Always show", "hide" => "Always hide");
314
+ echo generate_options($bubble_modes, get_option('zopimBubbleEnable'));
315
+ ?>
316
+ </select>
317
  </tr>
318
  <tr valign="top">
319
  <th scope="row" class="sethead">Help Bubble Title
339
  </div>
340
  </div>
341
 
342
+ <?php
343
+ if (get_option("zopimUseGreetings") && get_option("zopimUseGreetings"!="disabled")) {
344
+ $useGreetings = true;
345
+ } else {
346
+ $useGreetings = false;
347
+ }
348
+ ?>
349
  <div class="metabox-holder">
350
  <div class="postbox">
351
  <h3 class="hndle"><span>Greeting Message Settings</span></h3>
352
  <div style="padding:10px;">
353
  <table class="form-table">
354
+ <tr>
355
+ <td colspan="2">
356
+ <input type="checkbox" id="zopimUseGreetings" onchange="greetingsChanged()" value="zopimUseGreetings" name="zopimUseGreetings"
357
+ <?php if (get_option('zopimUseGreetings') && get_option('zopimUseGreetings')!="disabled") { echo "checked='checked'"; } ?>/>
358
+ Use these greeting messages
359
+ </td>
360
+ </tr>
361
+ <tr><td colspan="2"><div class="secthead">Message Shown on Chat Bar (max 26 characters)</div></td></tr>
362
  <tr valign="top">
363
  <th scope="row" class="sethead">Online</th>
364
  <td>
365
+ <input class="inputtextshort" name="zopimOnlineShort" id="zopimOnlineShort" onKeyup="updateSoon()"
366
+ value="<?php echo $greetings->online->bar; ?>"
367
+ <?php if (!$useGreetings) echo "disabled='disabled'"?>
368
+ maxlength="26">
369
  </td>
370
  </tr>
371
 
372
  <tr valign="top">
373
  <th scope="row" class="sethead">Away</th>
374
  <td>
375
+ <input class="inputtextshort" name="zopimAwayShort" id="zopimAwayShort" onKeyup="updateSoon()" value="<?php echo $greetings->away->bar; ?>" <?php if (!$useGreetings) echo "disabled='disabled'"?> maxlength="26">
376
  </td>
377
  </tr>
378
 
379
  <tr valign="top">
380
  <th scope="row" class="sethead">Offline</th>
381
  <td>
382
+ <input class="inputtextshort" name="zopimOfflineShort" id="zopimOfflineShort" onKeyup="updateSoon()" value="<?php echo $greetings->offline->bar; ?>" <?php if (!$useGreetings) echo "disabled='disabled'"?> maxlength="26">
383
  </td>
384
  </tr>
385
 
386
 
387
+ <tr><td colspan="2"><div class="secthead">Message Shown on Chat Panel (max 140 characters)</div></td></tr>
388
  <tr valign="top">
389
  <th scope="row" class="sethead">Online</th>
390
  <td>
391
+ <textarea class="inputtext" name="zopimOnlineLong" id="zopimOnlineLong" onKeyup="updateSoon()" <?php if (!$useGreetings) echo "disabled='disabled'"?> ><?php echo $greetings->online->window; ?></textarea>
392
  </td>
393
  </tr>
394
 
395
  <tr valign="top">
396
  <th scope="row" class="sethead">Away</th>
397
  <td>
398
+ <textarea class="inputtext" name="zopimAwayLong" id="zopimAwayLong" onKeyup="updateSoon()" <?php if (!$useGreetings) echo "disabled='disabled'"?> ><?php echo $greetings->away->window; ?></textarea>
399
  </td>
400
  </tr>
401
 
402
  <tr valign="top">
403
  <th scope="row" class="sethead">Offline</th>
404
  <td>
405
+ <textarea class="inputtext" name="zopimOfflineLong" id="zopimOfflineLong" onKeyup="updateSoon()" <?php if (!$useGreetings) echo "disabled='disabled'"?> ><?php echo $greetings->offline->window; ?></textarea>
406
  </td>
407
  </tr>
408
  </table>
458
 
459
  function update_checkbox($fieldname) {
460
  if (isset($_POST["$fieldname"]) && $_POST["$fieldname"] != "") {
461
+ echo $fieldname." : ".$_POST["$fieldname"];
462
+
463
  update_option($fieldname, $_POST["$fieldname"]);
464
  } else {
465
  update_option($fieldname, "disabled");
readme.txt CHANGED
@@ -2,33 +2,53 @@
2
  Contributors: bencxr
3
  Tags: widget, plugin, sidebar, page, admin, enhancement, livechat, chat, widget
4
  Requires at least: 2.7
5
- Tested up to: 2.9.2
6
- Stable tag: 1.0.6
7
 
8
- Visitors can chat with you directly by clicking on the Zopim Chat Bar.
9
 
10
  == Description ==
11
 
12
- What if your website could talk? Zopim increases engagement between you and your visitors, by allowing them to chat with you!
13
- Great for improving interaction with your users and increasing the time they spend on your site.
 
14
 
15
- **Why use Zopim?**
16
 
17
- * Installation happens in a flash - 60 seconds setup!
18
 
19
- * Choose to reply to visitors via your favorite IM client or the high productivity Dashboard
20
 
21
- * Know exactly who enters your site! The name and email is automatically detected if he is a Wordpress user.
 
22
 
23
- * Monitor visitors live as they surf, including their entry, location, history, current URL, repeat visitors etc
24
 
25
- * Customize widget look and feel: themes, colours, positions, greeting message.
26
 
27
- * Localise the widget to the language you want: English, Hebrew, Persian, Polish, Indonesian, Swedish, Bulgarian, Czech, Slovenian, Russian, Danish, Chinese, Croation, Thai, French, Dutch, Turkish, German, Faroese, Korean, Japanese.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- * Access a high productivity Dashboard: with saved chat history, templated messages, visitor prioritization, Q & A, smart responder
30
 
31
  == Changelog ==
 
 
 
 
 
32
  = 1.0.6 =
33
  * Maintenance update: Class' redeclaration conflict fix.
34
 
@@ -89,10 +109,11 @@ Great for improving interaction with your users and increasing the time they spe
89
 
90
  == Screenshots ==
91
 
92
- 1. Chat window on your website
93
- 2. Typical usage session in the dashboard
94
  3. Account Configuration
95
  4. Styling and customiation
 
96
 
97
  == Frequently Asked Questions ==
98
 
@@ -123,5 +144,6 @@ After enabling the plug in, head on to the widget customization page to change s
123
 
124
  == Installation ==
125
 
126
- *Server Requirements:* PHP4 or PHP5 with PHP Curl installed.
127
- *Wordpress versions:* Wordpress 2.7 and up.
 
2
  Contributors: bencxr
3
  Tags: widget, plugin, sidebar, page, admin, enhancement, livechat, chat, widget
4
  Requires at least: 2.7
5
+ Tested up to: 3.0.3
6
+ Stable tag: 1.0.7
7
 
8
+ Zopim is an award winning facebook-like chatbar built for websites. It connects website owners and visitors together via a cross-browser platform.
9
 
10
  == Description ==
11
 
12
+ Update: In Oct 2010, Zopim was nominated Asia.s Top 10 Web Apps and selected as Red Herring Asia Top 100 Finalists. Read about it here: <a href="http://blog.zopim.com/?p=681">http://blog.zopim.com/?p=681</a>
13
+ <br/>
14
+ Build relationships with visitors to your website. They will be pleasantly surprised to know that a real person is there to respond to them.
15
 
16
+ * Know what your customers are looking at. See which product page they are currently viewing
17
 
18
+ * Let customers with questions reach you directly. Or proactively click on them to start a conversation
19
 
20
+ * Reply to chats via any browser, or your favorite IM client. Chat from Gtalk, MSN, Yahoo! Messenger, AOL, and from Smart Phones that support mobile IM client.
21
 
22
+ **What does Zopim look like?**
23
+ Zopim shows up as a chatbar docked to the bottom of your website. Visitors chat with you by clicking on the Zopim Chat Bar.
24
 
25
+ **3 Reasons to Use Zopim (& Not Anyone Else)**
26
 
27
+ * Nice Interface, Great User Experience
28
 
29
+ * One click deployment. So simple to setup and use, you.ll start loving it :)
30
+
31
+ * 16 hours online chat support even for free accounts . simply visit our website!
32
+
33
+ **Zopim works across major browsers and IM**
34
+
35
+ * Internet Explorer 6+, Firefox, Google Chrome, Opera, Safari ...
36
+
37
+ * Gtalk / MSN / Yahoo! Messenger / AIM
38
+
39
+ * iPhone, Blackberry & any other Smart Phones that supports mobile IM clients
40
+
41
+ **See all languages available, lovingly translated by Zopim users (in alphabetical order)**
42
+
43
+ * Arabic | Bulgarian | Chinese | Croatian | Czech | Danish | Dutch; Flemish | Estonian | Faroese | Finnish | French | Georgian | German | Greek | Hebrew | Hungarian | Icelandic | Indonesian | Italian | Japanese | Korean | Kurdish | Latvian | Lithuanian | Macedonian | Malay | Norwegian Bokmal | Persian | Polish | Portuguese | Romanian | Russian | Serbian | Slovak | Slovenian | Spanish; Castilian | Swedish | Thai | Turkish | Ukranian | Urdu | Vietnamese
44
 
 
45
 
46
  == Changelog ==
47
+ = 1.0.7 =
48
+ * Maintenance update: Remove phased out "middle left", "middle right" positions
49
+ * Add options to let user decides hiding of chat bubble, no longer force show/hide
50
+ * Enable option for not using plugins' greeting messages
51
+
52
  = 1.0.6 =
53
  * Maintenance update: Class' redeclaration conflict fix.
54
 
109
 
110
  == Screenshots ==
111
 
112
+ 1. Chat window on your website - active chat
113
+ 2. Chat widget on your website - minimized
114
  3. Account Configuration
115
  4. Styling and customiation
116
+ 5. Another nice screenshot on a 'virtual' monitor
117
 
118
  == Frequently Asked Questions ==
119
 
144
 
145
  == Installation ==
146
 
147
+ *Server Requirements:* PHP4 or PHP5 with PHP Curl installed.<br/>
148
+ *Wordpress versions:* Wordpress 2.7 and up.<br/>
149
+ *Thanks for using us* :)
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
zopim.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Zopim Widget
5
  Plugin URI: http://www.zopim.org
6
  Description: Zopim embeds a chatbar on your website, so that any visitor can chat with you directly by clicking on the chatbar.
7
  Author: Isidore
8
- Version: 1.0.6
9
  Author URI: http://www.isidorechan.com/
10
  */
11
 
@@ -91,24 +91,30 @@ document.write(unescape(\"%3Cscript src='\" + document.location.protocol + \"//"
91
  if (get_option('zopimBubbleText') != "") {
92
  echo "\n\$zopim.livechat.bubble.setText('".addslashes(get_option('zopimBubbleText'))."');";
93
  }
94
- if (get_option('zopimHideOnOffline') == "checked") {
95
- echo "\n\$zopim.livechat.button.setHideWhenOffline(true);";
96
- }
97
- if (get_option('zopimBubbleEnable') == "checked") {
98
  echo "\n\$zopim.livechat.bubble.show(true);";
99
- }
100
- if (get_option('zopimGreetings') != "") {
101
- $greetings = json_to_array(get_option('zopimGreetings'));
102
- foreach ($greetings as $i => $v) {
103
- foreach ($v as $j => $k) {
104
- $greetings->$i->$j = str_replace("\r\n", "\\n", $greetings->$i->$j);
105
- }
106
- }
107
- echo "\n\$zopim.livechat.setGreetings({
108
- 'online': ['".addslashes($greetings->online->bar)."', '".addslashes($greetings->online->window)."'],
109
- 'offline': ['".addslashes($greetings->offline->bar)."', '".addslashes($greetings->offline->window)."'],
110
- 'away': ['".addslashes($greetings->away->bar)."', '".addslashes($greetings->away->window)."'] });
111
- ";
 
 
 
 
 
 
 
 
 
112
  }
113
  echo "</script>";
114
  }
5
  Plugin URI: http://www.zopim.org
6
  Description: Zopim embeds a chatbar on your website, so that any visitor can chat with you directly by clicking on the chatbar.
7
  Author: Isidore
8
+ Version: 1.0.7
9
  Author URI: http://www.isidorechan.com/
10
  */
11
 
91
  if (get_option('zopimBubbleText') != "") {
92
  echo "\n\$zopim.livechat.bubble.setText('".addslashes(get_option('zopimBubbleText'))."');";
93
  }
94
+ if (get_option('zopimBubbleEnable') == "show") {
 
 
 
95
  echo "\n\$zopim.livechat.bubble.show(true);";
96
+ } elseif (get_option('zopimBubbleEnable') == "hide") {
97
+ echo "\n\$zopim.livechat.bubble.hide(true);";
98
+ }
99
+
100
+ if (get_option('zopimUseGreetings') == "zopimUseGreetings") {
101
+ if (get_option('zopimGreetings') != "") {
102
+ $greetings = json_to_array(get_option('zopimGreetings'));
103
+ foreach ($greetings as $i => $v) {
104
+ foreach ($v as $j => $k) {
105
+ $greetings->$i->$j = str_replace("\r\n", "\\n", $greetings->$i->$j);
106
+ }
107
+ }
108
+ echo "\n\$zopim.livechat.setGreetings({
109
+ 'online': ['".addslashes($greetings->online->bar)."', '".addslashes($greetings->online->window)."'],
110
+ 'offline': ['".addslashes($greetings->offline->bar)."', '".addslashes($greetings->offline->window)."'],
111
+ 'away': ['".addslashes($greetings->away->bar)."', '".addslashes($greetings->away->window)."'] });
112
+ ";
113
+ }
114
+ }
115
+ // this need to be called last
116
+ if (get_option('zopimHideOnOffline') == "zopimHideOnOffline") {
117
+ echo "\n\$zopim.livechat.button.setHideWhenOffline(true);";
118
  }
119
  echo "</script>";
120
  }