default: if (isset($touser) && check_name($touser)) { if ($touser == $_username) { mobile_msg($L['chat_msg_self'], '?action=index'); } $MG['chat'] or mobile_msg($L['chat_msg_no_rights']); $user = userinfo($touser); $user or mobile_msg($L['chat_msg_user'], '?action=index'); if ($user['black']) { $black = explode(' ', $user['black']); if (in_array($_username, $black)) { mobile_msg($L['chat_msg_refuse'], '?action=index'); } } $online = online($user['userid']); $chatid = get_chat_id($_username, $touser); $chat_id = $chatid; $head_name = lang($L['chat_with'], array($user['username'])); $head_title = $head_name . $DT['seo_delimiter'] . $head_title; $forward = is_url($forward) ? addslashes(dhtmlspecialchars($forward)) : ''; if (strpos($forward, $MOD['linkurl']) !== false) { $forward = ''; } $chat = $db->get_one("SELECT * FROM {$table} WHERE chatid='{$chatid}'"); if ($chat) { $db->query("UPDATE {$table} SET forward='{$forward}' WHERE chatid='{$chatid}'"); } else { $db->query("INSERT INTO {$table} (chatid,fromuser,touser,tgettime,forward) VALUES ('{$chat_id}','{$_username}','{$touser}','0','{$forward}')"); } $type = 1; } else {
dalert('您所在的会员组没有权限发起对话', 'grade.php'); } $user = userinfo($touser); $user or dalert('会员不存在', 'chat.php'); if ($user['black']) { $black = explode(' ', $user['black']); if (in_array($chatuser, $black)) { dalert('对方拒绝与您对话', 'chat.php'); } if (!$_username && in_array('Guest', $black)) { dalert('对方拒绝与您对话', 'chat.php'); } } $chat_fromuser = $chatuser; $chat_touser = $touser; $chat_id = $chatid = get_chat_id($chat_fromuser, $chat_touser); $online = online($user['userid']); $user['type'] = 'member'; $type = 1; if (!$_userid && !is_file(get_chat_file($chatid))) { $type = 4; } $head_title = '与【' . $user['company'] . '】对话中'; $chat = $db->get_one("SELECT * FROM {$table} WHERE chatid='{$chatid}'"); $chat_status = 3; if ($chat) { //对话已经存在 if ($chat['touser'] == $_username) { //当前为接收人 if ($DT_TIME - $chat['freadtime'] > $MOD['chat_poll'] * 3) { //发起对话人已经断开