forked from Anankke/SSPanel-UIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlive_chat.tpl
107 lines (103 loc) · 3.63 KB
/
live_chat.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{if $public_setting['live_chat'] == 'tawk'}
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var id = "{$public_setting['tawk_id']}";
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/' + id + '/default';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
{/if}
{if $public_setting['live_chat'] == 'crisp'}
<script type="text/javascript"> window.$crisp = [];
window.CRISP_WEBSITE_ID = "{$public_setting["crisp_id"]}";
(function () {
d = document;
s = d.createElement("script");
s.src = "https://client.crisp.chat/l.js";
s.async = 1;
d.getElementsByTagName("head")[0].appendChild(s);
})();
$crisp.push(["safe", true])
$crisp.push(["set","user:nickname", "{$user->user_name}"],
["set","user:email","{$user->email}"],
["set", "session:data",
[[
["user_id","{$user->id}"],
["user_class","{$user->class}"],
["reg_email","{$user->email}"],
["last_use_time","{$user->lastSsTime()}"],
["expire_in","{$user->expire_in}"],
["class_expire_time","{$user->class_expire}"],
["available_traffic","{$user->unusedTraffic()}"],
["balance","{$user->money}"]
]]
]);
</script>
{/if}
{if $public_setting['live_chat'] == 'livechat'}
<script>
window.__lc = window.__lc || { };
window.__lc.license = "{$public_setting['livechat_id']}";
window.__lc.params = [
{ name: '用户编号', value: '{$user->id}' },
{ name: '用户类别', value: '{$user->class}' },
{ name: '注册邮箱', value: '{$user->email}' },
{ name: '上次使用', value: '{$user->lastSsTime()}' },
{ name: '到期时间', value: '{$user->expire_in}' },
{ name: '等级时间', value: '{$user->class_expire}' },
{ name: '剩余流量', value: '{$user->unusedTraffic()}' },
{ name: '账户余额', value: '{$user->money}' }
];
(function(n, t, c) {
function i(n) {
return e._h ? e._h.apply(null, n) : e._q.push(n)
}
var e = {
_q: [],
_h: null,
_v: "2.0",
on: function() {
i(["on", c.call(arguments)])
},
once: function() {
i(["once", c.call(arguments)])
},
off: function() {
i(["off", c.call(arguments)])
},
get: function() {
if (!e._h) throw new Error("[LiveChatWidget] You can't use getters before load.");
return i(["get", c.call(arguments)])
},
call: function() {
i(["call", c.call(arguments)])
},
init: function() {
var n = t.createElement("script");
n.async = !0,
n.type = "text/javascript",
n.src = "https://cdn.livechatinc.com/tracking.js",
t.head.appendChild(n)
}
}; ! n.__lc.asyncInit && e.init(),
n.LiveChatWidget = n.LiveChatWidget || e
} (window, document, [].slice))
</script>
{/if}
{if $public_setting['live_chat'] == 'mylivechat'}
<script type="text/javascript">
(() => {
var hccid = "{$public_setting['mylivechat_id']}";
var nt = document.createElement("script");
nt.async = true;
nt.src = "https://mylivechat.com/chatinline.aspx?hccid=" + hccid;
var ct = document.getElementsByTagName("script")[0];
ct.parentNode.insertBefore(nt, ct);
})();
</script>
{/if}