$page = 1; } $page = intval($page); $ngblock = ''; //未开始的 $sql = "SELECT * FROM {$cfg['tb_newgames']} WHERE host_name='{$udata['u_name']}' LIMIT {$cfg['maxnewgame']}"; //$sql = "SELECT * FROM {$cfg['tb_newgames']} WHERE host_name='{$udata['u_name']}'"; $result = RenDB_Query($sql); $nglist = ''; $gnum = 0; if (RenDB_Num_Rows($result) > 0) { $game_cell = LoadTemplate('g_cell_mynew'); while ($gdata = RenDB_Fetch_Array($result)) { if ($gdata['app_count'] > 0) { //超时检测 $gtremain = GetNewGameTimeOutInfo(); if ($gtremain == 0) { continue; } $gtremain = Time2HMS($gtremain) . HLTxt('*'); $applist = explode('|', $gdata['app_list']); //array_shift( $applist ); $gchallenge = "<select name=\"tarname\" onChange=\"document.mn_{$gnum}.submit()\"><option>====== ({$gdata['app_count']}) ======</option>"; foreach ($applist as $k => $v) { $v = explode(',', $v); if (In_Names($v[0], $udata['friends'])) { $sty = 'style="background:#9999ff"'; } else { if (In_Names($v[0], $udata['blacklist'])) { $sty = 'style="background:#999999"'; } else {
} if (!$udata['is_member']) { ErrorBox($str['act_noguest']); } //读棋局 $gid = intval($gid); $sql = "SELECT ng.*,m.u_name,m.skill,m.g_w,m.g_d,m.g_l,m.g_to FROM `{$cfg['tb_newgames']}` AS ng LEFT JOIN `{$cfg['tb_members']}` AS m ON m.u_name=ng.host_name WHERE gid='{$gid}' LIMIT 1"; $result = RenDB_Query($sql); if (RenDB_Num_Rows($result) < 1) { MessageBox('操作失败,棋局可能已开始或被删除'); } $gdata = RenDB_Fetch_Array($result); //超时检测 if ($gdata['app_count'] > 0) { require_once './include/g_func.php'; if (GetNewGameTimeOutInfo() == 0) { MessageBox('本局因超时被删除'); } } //分离申请列表 if ($gdata['app_count'] > 0) { $applist = explode('|', $gdata['app_list']); foreach ($applist as $k => $v) { $applist[$k] = explode(',', $v); } } else { $applist = array(); } switch ($action) { case 'join': if (IsSameName($gdata['host_name'], $udata['u_name'])) {