unset($friends[$k]); break; } } $udata['friends']=implode('|',$friends); } if(!empty($udata['blacklist']))$udata['blacklist'].='|'; $udata['blacklist'].=$tname; $sql="UPDATE $cfg[tb_members] SET friends='$udata[friends]',blacklist='$udata[blacklist]' WHERE u_id='$udata[u_id]' LIMIT 1"; RenDB_Query($sql,true); header("Location: m_fb.php?action=view"); exit(); break; case 'b_del': if(!In_Names($tname,$udata['blacklist'])) MessageBox('该用户不在黑名单中'); $blacklist=explode('|',$udata['blacklist']); foreach($blacklist as $k=>$n) if( IsSameName($n,$tname)) { unset($blacklist[$k]); break; } $udata['blacklist']=implode('|',$blacklist); $sql="UPDATE $cfg[tb_members] SET blacklist='$udata[blacklist]' WHERE u_id='$udata[u_id]' LIMIT 1"; RenDB_Query($sql,true); header("Location: m_fb.php?action=view"); exit(); break; }
SimplyBox('用户拒收您的消息'); } //存好友名单 /*if( isset( $_COOKIE['my_contacts']) ) { $my_contacts = explode(',', $_COOKIE['my_contacts']); } else $my_contacts = array(); $key = array_search( $sendto, $my_contacts); if( $key!==false ) unset( $my_contacts[$key] ); elseif( count($my_contacts) > 6 )array_pop($my_contacts); array_unshift( $my_contacts, $sendto ); setcookie( 'my_contacts', implode( ',',$my_contacts), time() + $cfg['cooktime'] ); */ if (!In_Names($sendto, $cfg['admins'])) { //检查消息是否已满 // $sql ="SELECT COUNT(*) FROM $cfg[tb_pms] WHERE sendto='$sendto' OR comefrom='$sendto' LIMIT $cfg[maxpm]"; $sql = "SELECT COUNT(*) FROM {$cfg['tb_pms']} WHERE sendto='{$sendto}' LIMIT {$cfg['maxpm']}"; $result = RenDB_Query($sql); if ($row = RenDB_Fetch_Row($result)) { if ($row[0] >= $cfg['maxpm']) { SimplyBox('对方消息已经满了'); } } } //var_dump($meminfo); //写入数据库 $sql = "INSERT INTO `{$cfg['tb_pms']}` SET "; $sql .= "sendto='{$sendto}',"; $sql .= "comefrom='{$udata['u_name']}',";
$m_website = $mdata['u_website'] == '' ? '无' : "<a href=\"{$mdata['u_website']}\" target=\"_blank\">{$mdata['u_website']}</a>"; $m_avatar = MakeBBAvatar($mdata['u_avatar']); //$m_grade= MakeBBGrade($mdata); $m_tout = GetBBTout($mdata) . '%'; $m_rate = $mdata['g_w'] + $mdata['g_d'] + $mdata['g_l'] == 0 ? 0 : round($mdata['g_w'] * 100 / ($mdata['g_w'] + $mdata['g_d'] + $mdata['g_l']), 1); $m_rate .= '%'; $mdata['reg_date'] = TimeToDate($mdata['reg_date']); $mdata['last_visit'] = TimeToDate($mdata['last_visit']); $buttons = ''; $encodename = urlencode($mdata['u_name']); if ($udata['is_member'] && !IsSameName($name, $udata['u_name'])) { $buttons .= MakeBBButton("room_new.php?byname={$encodename}", '搜索新局'); $buttons .= MakeBBButton("g_search.php?action=list&search_all_user=0&u_name={$encodename}", '搜索棋局'); $buttons .= MakeBBButton("pm_new.php?action=new1&sendto={$encodename}", '发送消息', 500, 220); $buttons .= MakeBBButton("pm_new.php?action=invite1&sendto={$encodename}", '邀请下棋', 500, 220); if (!In_Names($mdata['u_name'], $udata['friends'])) { $buttons .= MakeBBButton("m_fb.php?action=f_add&tname={$encodename}", '加为好友'); } if (!In_Names($mdata['u_name'], $udata['blacklist'])) { $buttons .= MakeBBButton("m_fb.php?action=b_add&tname={$encodename}", '加入黑名单'); } } $m_rec = "{$mdata['g_w']}胜{$mdata['g_d']}平{$mdata['g_l']}负"; if ($mdata['u_bio'] == '') { $mdata['u_bio'] = '(空)'; } else { $mdata['u_bio'] = BBCoding($mdata['u_bio']); } ShowHeader('会员信息'); eval('echo "' . LoadTemplate('m_view') . '";'); ShowFooter();
case 'sendpass1': if(!$cfg['send_email']) MessageBox('管理员关闭了系统邮件,目前不能使用此功能'); ShowHeader('<img src="./images/stan0.gif" /> 取回密码'); eval ("echo \"".LoadTemplate("sendpass_form")."\";"); ShowFooter(); break; case 'sendpass2': SetNoUseCache(); if(!$cfg['send_email']) ErrorBox( $str['act_err'] ); if( !isset($u_name,$u_email)) ErrorBox( $str['act_err'] ); if( In_Names( $u_name,$cfg['admins'])) { WriteBBLog( "试图取回管理员 {$u_name} 的密码",'wrongpass'); ErrorBox( $str['act_err'] ); } if(($code=Check_U_Email($u_email))!==true) MessageBox($code); $sql = "SELECT u_id FROM `$cfg[tb_members]` WHERE u_name='$u_name' AND u_email='$u_email' LIMIT 1"; $result = RenDB_Query($sql); if( RenDB_Num_Rows($result) != 1 ) { ErrorBox('Email 和 用户名不匹配'); }
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>"; } $gchallenge .= '</select>'; } else { $gchallenge = '-'; $gtremain = '-'; } $grules = $cfg['rules'][$gdata['rules']]; switch ($gdata['host_color']) { case 0:
function ShowHeader($location, $refresh = '', $span_ref = 3) { global $cfg, $udata, $color, $fid, $str, $nowtime; //$autorefresh=''; $autorefresh = $refresh == '' ? '' : "<meta http-equiv=\"refresh\" content=\"{$span_ref};url={$refresh}\">"; //$menus ="$cfg[rbb_name]<br />"; //$menus .='<hr /> '; //$menus ="<a href=\"index.php\">$cfg[rbb_name]</a><hr />"; $menus = ""; if ($udata['is_member']) { //用户属性 $userbar = "<img src=\"./images/stan1.gif\" />"; $userbar .= MemberLink($udata['u_name']); //$menus .=" "; $userbar .= " [<a href=\"loginout.php?action=logout&checkcode={$udata['act_check']}\">{$str['logout']}</a>]"; //$menus .='<img src="./images/logout.gif" /> <a href="g_new.php?action=new1">'.$str['logout'].'</a><br />'; //$menus .='<hr /> '; if (In_Names($udata['u_name'], $cfg['admins'])) { $userbar .= "[<a target=\"_blank\" href=\"zjcp/\">面板</a>]"; } $menus .= '<a href="g_new.php?action=new1"><img src="./images/btn/menu_new.gif" /></a><br />'; $menus .= '<a href="room_new.php"><img src="./images/btn/menu_search_new.gif" /></a><br />'; $menus .= '<a href="g_search.php?action=input"><img src="./images/btn/menu_search.gif" /></a><br />'; $menus .= '<hr /> '; $menus .= '<a href="cp_list.php"><img src="./images/btn/menu_cp.gif" /></a><br />'; $menus .= '<hr /> '; } else { $userbar = "<img src=\"./images/stan0.gif\" />Guest"; $menus .= '<a href="loginout.php?action=show"><img src="./images/btn/menu_login.gif" /></a><br /> '; if ($cfg['register_enable']) { $menus .= '<a href="m_man.php?action=reg1"><img src="./images/btn/menu_reg.gif" /></a><br /> '; } if ($cfg['send_email']) { $menus .= '<a href="m_man.php?action=sendpass1">' . $str['get_pass'] . '</a><br /> '; } $menus .= '<hr /> '; } if ($udata['is_member']) { //$mt0 = GetMicrotime(); $sql = "SELECT gid FROM {$cfg['tb_newgames']} WHERE host_name='{$udata['u_name']}' AND app_count>0 LIMIT 1"; $result = RenDB_Query($sql); $have_new_game = RenDB_Num_Rows($result); $sql = "SELECT gid FROM {$cfg['tb_games']} WHERE turn_name='{$udata['u_name']}' AND startdate<='{$nowtime}' LIMIT 1"; $result = RenDB_Query($sql); $have_turn_game = RenDB_Num_Rows($result); //echo sprintf ( "%01.3f" , GetMicrotime() - $mt0 ); //$menus .='<a href="room_mynew.php">'.$str['my_newgame'].'</a>'; $menus .= $have_new_game ? '<a href="room_mynew.php"><img src="./images/btn/menu_mynew_1.gif" /></a><br />' : '<a href="room_mynew.php"><img src="./images/btn/menu_mynew.gif" /></a><br />'; $menus .= '<a href="g_search.php?action=list&search_all_user=0&game_status=1&u_name=' . urlencode($udata['u_name']) . '">'; $menus .= $have_turn_game ? '<img src="./images/btn/menu_mygame_1.gif" /></a><br />' : '<img src="./images/btn/menu_mygame.gif" /></a><br />'; $menus .= '<a href="g_search.php?action=list&search_all_user=0&game_status=2&u_name=' . urlencode($udata['u_name']) . '"><img src="./images/btn/menu_myold.gif" /></a><br />'; //$menus .='<img src="./images/renju_old.gif" /> <a href="room_old.php?myonly=1">我的旧谱</a><br />'; $menus .= '<a href="pm_view.php">'; $menus .= $udata['have_new_pm'] ? '<img src="./images/btn/menu_pm_1.gif" /></a><br />' : '<img src="./images/btn/menu_pm.gif" /></a><br />'; $menus .= '<a href="m_fb.php?action=view"><img src="./images/btn/menu_friend.gif" /></a><br />'; $menus .= '<a href="m_man.php?action=ed1"><img src="./images/btn/menu_setting.gif" /></a><br /> '; $menus .= '<hr /> '; } $menus .= '<a href="ranking.php"><img src="./images/btn/menu_ranking.gif" /></a><br /> '; //$menus.= '<img src="./images/help.gif" /> <a href="help.php"> '.$str['help_doc'].'</a><br /> '; //有上角的按钮 $gbuttons = ''; if (defined('IN_RBB_G_VIEW')) { global $gbtns, $ginfos, $gid; foreach ($gbtns as $k => $v) { if ($v != '') { $gbuttons .= "<a href=\"{$v}\"><img src=\"./images/btn/btn_{$k}.gif\"></a>"; } //else $gbuttons.="<img src=\"./images/btn/btn_$k_gray.gif\">"; } global $gid; if ($udata['is_member'] && $have_turn_game) { $location .= " <a href=\"g_view.php?gid={$gid}&next_turn=1\"><img src=\"./images/btn/next.gif\" alt=\"Next\"></a>"; } } else { $ginfos = ''; } eval('echo "' . LoadTemplate('header') . '";'); }
require_once '../include/functions.php'; //基本函数 require_once './admin_special.php'; //连接数据库 RenDB_Connect(); if (isset($admin_log_name, $admin_log_pass)) { setcookie('admin_name', $admin_log_name); setcookie('admin_pass', $admin_log_pass); ACP_MessageBox("登陆成功"); //header('Location: index.php'); exit; } //登陆 $admin_logged = false; if (isset($_COOKIE['admin_name'], $_COOKIE['admin_pass'])) { if (In_Names($_COOKIE['admin_name'], $cfg['admins'])) { $admin_name = $_COOKIE['admin_name']; $admin_pass = md5($_COOKIE['admin_pass']); $sql = "SELECT * FROM `{$cfg['tb_members']}` WHERE u_name='{$admin_name}' AND u_pass='******' LIMIT 1"; $result = RenDB_Query($sql); if (RenDB_Num_Rows($result) == 1) { $udata = RenDB_Fetch_Array($result); if ($udata['u_name'] == $admin_name) { $admin_logged = true; $udata['fake_name'] = $udata['u_name']; } } } if (!$admin_logged) { $udata['fake_name'] = '@' . $userip; ACP_WriteLog("密码错误 用户名:'{$_COOKIE['admin_name']}'");