forked from zicongxie/zhaotaoci.cc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
weixin.inc.php
27 lines (27 loc) · 1004 Bytes
/
weixin.inc.php
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
<?php
defined('IN_DESTOON') or exit('Access Denied');
login();
$EXT['weixin'] or dheader('./');
$WX = cache_read('weixin.php');
require DT_ROOT.'/module/'.$module.'/common.inc.php';
require DT_ROOT.'/include/post.func.php';
$W = $db->get_one("SELECT * FROM {$DT_PRE}weixin_user WHERE username='$_username'");
switch($action) {
case 'push':
$W or message();
$push = $W['push'] ? 0 : 1;
$db->query("UPDATE {$DT_PRE}weixin_user SET push=$push WHERE itemid=$W[itemid]");
dmsg($push ? $L['weixin_push_open'] : $L['weixin_push_close'], '?action=index');
break;
default:
if($W) {
$W['headimgurl'] or $W['headimgurl'] = DT_PATH.'api/weixin/image/headimg.jpg';
$sign = ($W['credittime'] && timetodate($W['credittime'], 3) == timetodate($DT_TIME, 3)) ? 1 : 0;
$timeout = $DT_TIME - $W['visittime'] > 172800 ? 1 : 0;
}
$auth = encrypt($_username.md5(DT_IP.$_SERVER['HTTP_USER_AGENT']), DT_KEY.'WXQR');
$head_title = $L['weixin_title'];
break;
}
include template('weixin', $module);
?>