if ($pmnum == $cfg['maxpm']) { $endid = $pmdata['pmid']; } if ($pmnum > $cfg['maxpm'] && !$pmdata['isnew']) { continue; } $pmnew = $pmdata['isnew'] ? HLTxt('*') : ''; //$ignore=''; $reply = $outbox ? ' ' : MakeBBButton("pm_new.php?&action=new1&sendto={$pmdata['comefrom']}", '回复', 550, 250); /* $ignore= ( !In_Names( $pmdata['comefrom'], $udata['blacklist'] )) ? MakeBBButton( "m_man.php?&action=add&name={$pmdata['comefrom']}", '拒收') : '' ; */ if ($pmdata['u_stand'] == 4) { $pmfrom = $outbox ? 'To:' . MemberLink($pmdata['sendto']) : ''; $pmfrom .= ' (' . HLTxt('系统消息') . ')'; $message = BBCoding($pmdata['message'], true); } else { $pmfrom = $outbox ? 'To:' . MemberLink($pmdata['sendto']) : 'From:' . MemberLink($pmdata['comefrom']); $message = BBCoding($pmdata['message'], false); } //if( $pmnum > $cfg['maxpm'] ) // $message = "<del>$message</del>"; eval("\$pmlist .= \"{$pm_cell} \";"); } /* if( $pmnum > $cfg['maxpm'] ) { $sql ="DELETE FROM {$cfg['tb_pms']} WHERE sendto='{$udata['u_name']}' AND pmid<'{$endid}'"; RenDB_Query($sql,true) ; }*/
//未开始的 $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 { $sty = ''; } } $gchallenge .= "<option {$sty} value=\"{$v['0']}\">{$v['0']}({$v['1']}) {$v[2]}% </option>";
function MakePageBar($url, $itemcount, $itemperpage, $page) { $ret = array('pagebar' => '', 'antrow' => 0, 'start' => 0); if ($itemcount <= 0) { //$ret['start'] = 0; //$ret['antrow'] = 0; $ret['pagebar'] = ' '; return $ret; } $lastpage = intval(($itemcount - 1) / $itemperpage) + 1; if ($page < 0 || $page >= $lastpage) { $page = $lastpage; $ret['antrow'] = $itemcount % $itemperpage; if ($ret['antrow'] == 0) { $ret['antrow'] = $itemperpage; } } else { $ret['antrow'] = $itemperpage; } $ret['start'] = ($page - 1) * $itemperpage; if ($lastpage > 1) { //$ret['pagebar'] = ''; $code = '$ret[\'pagebar\'] .="<a href=\\"' . $url . '&page={$i}\\">{$i}</a>.";'; for ($i = 1; $i <= $lastpage; $i++) { if ($i <= 5 || abs($i - $page) < 2 || $i > $lastpage - 1) { $cdotcount = 0; if ($page != $i) { eval($code); } else { $ret['pagebar'] .= HLTxt($i) . '.'; } } elseif ($cdotcount < 3) { $ret['pagebar'] .= '.'; $cdotcount++; } } } if ($ret['pagebar'] == '') { $ret['pagebar'] = ' '; } return $ret; }
} } } $challenger = $inapp ? '(joined)' : MakeBBButton("JavaScript:JoinGame('{$gdata['gid']}')", 'join'); } else { $challenger = "-"; } $gtimelimit = Time2HMS($gdata['add_time']); if ($gdata['step_time']) { $gtimelimit .= '<br />' . Time2HMS($gdata['step_time']); } if ($gdata['host_color'] >= 1) { $gblack = $host; $gwhite = $challenger; if ($gdata['host_color'] > 1) { $gblack = HLTxt('*') . $gblack; } } else { $gblack = $challenger; $gwhite = $host; } eval("\$glist .= \"{$game_cell}\";"); $gnum++; } } if ($gnum == 0) { $glist = "<tr bgcolor=\"{$color['cell']}\"><td colspan=\"7\">(Empty)</td></tr>"; } ShowHeader('<img src="./images/renju_new.gif" /> 查找新桌'); eval('echo "' . LoadTemplate('room_new') . '";'); ShowFooter();
case 8: $gtremain = '黑超时'; } $gtstep = ''; } else { if ($turnside == $myside) { $ginfo = HLTxt('该你走'); $gtremain = '剩时: ' . Time2HMS($timeinfo[0]) . HLTxt(' *'); $gtstep = $gdata['step_time'] ? '本步: ' . Time2HMS($timeinfo[1]) . HLTxt(' *') : ''; } else { $ginfo = '该对手走<br />'; if ($undos[!$myside] > 0) { $ginfo .= HLTxt('悔? '); } if ($draws[!$myside] > 0) { $ginfo .= HLTxt('和? '); } $gtremain = '剩时: ' . Time2HMS($times[$myside]); $gtstep = ''; } } $shownum++; eval("\$glist .= \"{$game_cell} \";"); } } if ($shownum == 0) { $glist = "<tr bgcolor=\"{$color['cell']}\"><td colspan=\"8\">(空)</td></tr>"; } ShowHeader('<img src="./images/renju.gif" /> 我的棋局'); eval('echo "' . LoadTemplate('room_my') . '";'); ShowFooter();
} } } $gblack = '<a href="m_view.php?&name=' . urlencode($gdata['b_name']) . "\">{$gblack}</a>"; $gwhite = '<a href="m_view.php?&name=' . urlencode($gdata['w_name']) . "\">{$gwhite}</a>"; if ($gturn == '') { $gturn = '-'; } else { $gturn = '<a href="m_view.php?&name=' . urlencode($gdata['turn_name']) . "\">{$gturn}</a>"; } if ($turnside != -1) { if ($undos[!$myside]) { $gturn .= HLTxt('(悔)'); } if ($draws[!$myside]) { $gturn .= HLTxt('(和)', 1); } } $gopening = $gdata['rules'] <= 1 ? $openingname[$gdata['opening']] : '-'; eval("\$glist .= \"{$game_cell} \";"); $gnum++; } } if ($gnum == 0) { $glist = "<tr bgcolor=\"{$color['cell']}\"><td colspan=\"8\">没找到</td></tr>"; } //echo sprintf ( "%01.3f" , GetMicrotime() - $mt0 ); ShowHeader('<img src="./images/renju.gif" /> 搜索棋局'); eval('echo "' . LoadTemplate('g_search_result') . '";'); ShowFooter(); }
break; case 4: $order = 'g_w DESC'; $lks[4] = HLTxt('Win'); break; case 5: $order = 'g_d DESC'; $lks[5] = HLTxt('Draw'); break; case 6: $order = 'g_l DESC'; $lks[6] = HLTxt('Lost'); break; default: $order = 'points DESC'; $lks[0] = HLTxt('Pts'); break; } $sql = "SELECT * FROM `{$cfg['tb_players']}` WHERE group_id='{$group_id}' ORDER BY {$order}"; $result = RenDB_Query($sql); $pllist = ''; $plnum = 0; if (RenDB_Num_Rows($result) > 0) { $pl_cell = LoadTemplate('player_cell'); while ($pldata = RenDB_Fetch_Array($result)) { $plnum++; $u_name = MemberLink($pldata['u_name']); eval("\$pllist.=\"{$pl_cell}\";"); } } else { $pllist = "<tr bgcolor=\"{$color['cell']}\"><td clospan=\"5\">({$str['empty']})</td></tr>";
//$m_time_step=; $m_time_step = $gdata['step_time'] ? '本步: ' . Time2HMS($timeinfo[1]) . HLTxt('*') : ''; } else { $m_time = '剩时: ' . Time2HMS($times[$side]); //$m_time_step=$gdata['step_time']?"单步: $gsteptime":'单步: N/A' ; $m_time_step = ''; } eval("\$panel .= \"{$mtemp}\";"); } $panel .= "<table width=\"100%\" border=0 cellspacing=0 cellpadding=5 ><tr><td>"; if ($gdata['cp_name']) { $panel .= "<a href=\"cp_view.php?cp_id={$gdata['cp_id']}\">" . HLTxt($gdata['cp_name']) . '</a><br />'; } if ($myside != -1 && !$gdata['status'] && !$nostart) { if ($ismyturn) { $panel .= HLTxt('轮到你走'); } else { $panel .= '轮到对手'; } if ($undos[1 - $myside] != 0 && empty($gdata['cp_name'])) { $panel .= "<br />对手提出回到第{$undos[1 - $myside]}手(前)"; $panel .= "[<a href=\"JavaScript:ConfirmUndo2('{$undos[1 - $myside]}')\">同意</a>]"; } if ($draws[1 - $myside] == 1) { $panel .= '<br />对手提出和棋'; } if ($undos[$myside] != 0) { $panel .= "<br />你提出回到第{$undos[$myside]}手(前)"; } if ($draws[$myside] == 1) { $panel .= '<br />你提出和棋';
// break; //case 4: //// $order='posts DESC'; // $lks[4] =HLTxt('贴子数'); // break; case 5: $order = 'IF(g_w+g_d+g_l=0,0,g_w*100/(g_w+g_d+g_l)) DESC'; $lks[5] = HLTxt('胜率'); break; case 6: $order = 'u_name ASC'; $lks[6] = HLTxt('用户名'); break; default: $order = 'g_w+g_d+g_l=0,skill DESC'; $lks[0] = HLTxt('积分'); break; } //上榜人数 $sql = "SELECT COUNT(*) FROM {$cfg['tb_members']}"; $result = RenDB_Query($sql); $row = RenDB_Fetch_Row($result); $pageinfo = MakePageBar("ranking.php?orderby={$orderby}", $row[0], $cfg['mperpage'], $page); $sql = "SELECT * FROM {$cfg['tb_members']} ORDER BY {$order} LIMIT {$pageinfo['start']},{$cfg['mperpage']}"; $result = RenDB_Query($sql); $mlist = ''; $mnum = 0; if (RenDB_Num_Rows($result) > 0) { $member_cell = LoadTemplate('m_cell'); while ($mdata = RenDB_Fetch_Array($result)) { $morder = $pageinfo['start'] + $mnum + 1;
$berg += $v1['points']; $points += 1; $uid1 = HLTxt($uid1); $g_w++; } else { $g_l++; } break; case 1: case 4: case 6: case 8: if (!$isblack) { $berg += $v1['points']; $points += 1; $uid1 = HLTxt($uid1); $g_w++; } else { $g_l++; } break; } $uid1 = '<b>' . $uid1 . '</b>'; } else { $ptsm += 1; $ptse += 0.5; } //if($games!='')$games.='|'; $games .= "<br /><a href=\"g_view.php?gid={$gdata['gid']}\">({$uid1})</a>"; } $pts += $points;
case 'ed1': if (!isset($u_name)) { ACP_MessageBox($str['act_err']); } $u_name = trim($u_name); $sql = "SELECT * FROM `{$cfg['tb_members']}` WHERE u_name='{$u_name}' LIMIT 1"; $result = RenDB_Query($sql); if (!($mdata = RenDB_Fetch_Array($result))) { ACP_MessageBox('该用户不存在'); } if (IN_Names($u_name, $cfg['admins'])) { $m_stan = '管理员'; } else { $m_stan = ''; } $m_stan = HLTxt($m_stan); if (empty($mdata['u_avatar'])) { $mdata['u_avatar'] = 'default.gif'; } if (strpos($mdata['u_avatar'], '/', 0) === false) { $avatar_url = "../images/avatar/{$mdata['u_avatar']}"; } else { $avatar_url = $mdata['u_avatar']; } $check_show_email = $mdata['show_email'] ? 'checked' : ''; //$qq_options=''; //foreach(explode('|',$cfg['qq_types']) as $k=>$v) //{ // $qq_options.= $k==$mdata['qq_type'] ? "<option selected value=\"$k\">$v</option>" : "<option value=\"$k\">$v</option>"; //} $check_gender = array('', '', '');