wsq_app.inc.php
1.71 KB
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
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: wsq_app.inc.php 35206 2015-02-12 01:40:17Z nemohou $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$setting = C::t('common_setting')->fetch_all(array('mobilewechat'));
$setting = (array)unserialize($setting['mobilewechat']);
require_once DISCUZ_ROOT.'./source/plugin/wechat/wechat.lib.class.php';
require_once DISCUZ_ROOT.'./source/plugin/wechat/wsq.class.php';
require_once DISCUZ_ROOT.'./source/plugin/wechat/setting.class.php';
WeChatSetting::menu();
showtableheader(lang('plugin/wechat', 'wsq_viewapp_pubevent'));
echo '<tr><td style="line-height:30px" id="pubevent">'.lang('plugin/wechat', 'wsq_viewapp_na').'</td></tr>';
showtablefooter();
showtableheader(lang('plugin/wechat', 'wsq_viewapp_local'));
echo '<tr><td style="line-height:30px">'.lang('plugin/wechat', 'wsq_viewapp_local_comment').'</td></tr>';
showtablefooter();
showtableheader(lang('plugin/wechat', 'wsq_viewapp_online'));
echo '<tr><td style="line-height:30px">'.lang('plugin/wechat', 'wsq_viewapp_online_comment').'</td></tr>';
showtablefooter();
if($setting['wsq_siteid']) {
$time = TIMESTAMP;
echo <<<EOF
<script>
function pubEventCallback(re) {
if(re.errCode) {
return;
}
if(typeof re.data.event.peId != 'undefined') {
$('pubevent').innerHTML = '<h1><a href="http://mp.wsq.qq.com" target="_blank">' + re.data.event.peTitle + '</a></h1>' + re.data.event.peContent;
}
}
</script>
<script src="http://api.wsq.qq.com/publicEvent?sId={$setting[wsq_siteid]}&resType=jsonp&isAjax=1&_=$time&isDiscuz=1&callback=pubEventCallback">
</script>
EOF;
}