function online_get($k) { global $g_online_data, $sid; if (empty($g_online_data)) { $online = online_read($sid); if (empty($online)) { $online = online_save(TRUE); } $g_online_data = $online['data'] ? xn_json_decode($online['data']) : array(); } return array_value($g_online_data, $k, NULL); }
function message($code, $message) { global $db, $cache, $starttime, $conf, $browser, $ajax, $uid, $gid, $user, $header, $forumlist, $forumlist_show, $fid; // 防止 message 本身出现错误死循环 static $called = FALSE; $called ? exit("code: {$code}, message: {$message}") : ($called = TRUE); if ($ajax) { echo xn_json_encode(array('code' => $code, 'message' => $message)); runtime_save(); online_save(); } else { $header['title'] = '提示信息'; include "./mobile/view/message.htm"; } exit; }
$gid = $user['gid']; $user['token'] = user_token_set($uid, $gid, $user['password'], $user['avatar'], $user['username'], 'bbs'); // 更新在线 online_list_cache_delete(); online_unset('create_email'); online_unset('create_verifycode'); message(0, $user); } // 退出 } elseif ($action == 'logout') { $user = user_guest(); user_token_clean(); $uid = 0; $gid = 0; // 更新在线 online_save(TRUE); online_list_cache_delete(); message(0, jump('退出成功', './', 1)); // 获取当前用户的信息 } elseif ($action == 'read') { $user = user_read($uid); $agreelist = myagree_find_by_uid($uid); empty($user) and $user = user_guest(); user_ajax_info($user); message(0, $user); // 用户发表的喜欢 } elseif ($action == 'agree') { $_uid = param(2, 0); $_user = user_read($_uid); $page = param(3, 1); $pagesize = 10;