Esempio n. 1
0
					$this_name='<b>'.$this_name.'</b>';
					break;
				}
			$f_list.=$this_name."[<a href=\"m_fb.php?action=f_del&tname=$n\">删</a>] ";
		}
	}
	else $f_list='(空)';

	if(!empty($udata['blacklist']))
	{
		$blacklist=explode('|',$udata['blacklist']);
		asort($blacklist);
		$b_list='';
		foreach($blacklist as $n)
		{
			$this_name=MemberLink($n);
			foreach($onlines as $n2)
				if(IsSameName($n,$n2))
				{
					$this_name='<b>'.$this_name.'</b>';
					break;
				}
			$b_list.=$this_name."[<a href=\"m_fb.php?action=b_del&tname=$n\">删</a>] ";
		}
	}
	else $b_list='(空)';

	$addbox="<input type=text size=20 maxlength=12 name=\"tname\"> <input type=\"submit\" value=\"添加\">";
	$add_box_f=strlen($udata['friends']) >= $cfg['max_friends']?'您的好友列表已满': $addbox;
	$add_box_b=strlen($udata['blacklist']) >= $cfg['max_blacklist']?'您的黑名单已满': $addbox;
	ShowHeader('<img src="./images/profile.gif" /> 我的好友');
Esempio n. 2
0
 //$nowtime = time();
 while ($gdata = RenDB_Fetch_Array($result)) {
     if ($gdata['app_count'] > 0) {
         $gtremain = GetNewGameTimeOutInfo();
         if ($gtremain == 0) {
             continue;
         }
         $gtremain = Time2HMS($gtremain) . HLTxt('*');
     } else {
         $gtremain = '-';
     }
     $grules = $cfg['rules'][$gdata['rules']];
     $applist = explode('|', $gdata['app_list']);
     //$host = explode(',',$applist[0]);
     $tout = GetBBTout($gdata);
     $host = MemberLink($gdata['u_name']) . "({$gdata['skill']}) <b>{$tout}%</b>";
     if (IsSameName($gdata['host_name'], $udata['u_name']) || $gdata['u_ip'] == $userip) {
         $challenger = "-";
     } elseif ($gdata['app_count'] >= $cfg['maxapply']) {
         $challenger = "(满)";
     } elseif ($mytout <= $gdata['tout_max'] && ($gdata['skill_range'] == -1 || $udata['skill'] >= $gdata['skill'] - $gdata['skill_range'] && $udata['skill'] <= $gdata['skill'] + $gdata['skill_range'])) {
         $inapp = false;
         if ($gdata['app_count'] > 0) {
             foreach ($applist as $k => $v) {
                 $v = explode(',', $v);
                 if (IsSameName($v[0], $udata['u_name'])) {
                     $inapp = true;
                 }
             }
         }
         $challenger = $inapp ? '(joined)' : MakeBBButton("JavaScript:JoinGame('{$gdata['gid']}')", 'join');
Esempio n. 3
0
        if ($pmnum > $cfg['maxpm'] && !$pmdata['isnew']) {
            continue;
        }
        $pmnew = $pmdata['isnew'] ? HLTxt('*') : '';
        //$ignore='';
        $reply = $outbox ? '&nbsp;' : 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) ;
    	}*/
}
if ($pmnum == 0) {
    $pmlist = "<tr bgcolor=\"{$color['cell']}\"><td>(空)</td></tr>";
Esempio n. 4
0
 if (!$gdata['status']) {
     $timeinfo = GetTimeOutInfo();
 }
 //if( $timeinfo === true )continue;
 $gidtxt = $gdata['cp_id'] ? HLTxt($gdata['gid']) : $gdata['gid'];
 $grules = $gdata['rules'] == 1 ? 'RIF' : 'Sakata';
 if (IsSameName($gdata['b_name'], $udata['u_name'])) {
     $gcolor = '<img src="./images/black.gif" alt="黑">';
     $gopp = MemberLink($gdata['w_name']);
 } else {
     $gcolor = '<img src="./images/white.gif" alt="白">';
     $gopp = MemberLink($gdata['b_name']);
 }
 $gblack = MemberLink($gdata['b_name']);
 //if( $gdata['w_name'] !='')
 $gwhite = MemberLink($gdata['w_name']);
 $gmcount = $mcount;
 //$bgcolor = $color[ $gnum % 2 ];
 $glink = "<a href=\"g_view.php?gid={$gdata['gid']}\">查看</a>";
 if ($gdata['startdate'] > $nowtime) {
     $ginfo = '还未开始';
     $gtremain = '开始时间: ' . TimeToDate($gdata['startdate']);
     $gtstep = '';
 } elseif ($gdata['status']) {
     $ginfo = '已经结束';
     switch ($gdata['status']) {
         case 1:
             $gtremain = '黑禁手';
             break;
         case 2:
             $gtremain = '和棋';
Esempio n. 5
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') . '";');
}
Esempio n. 6
0
    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>";
}
//echo sprintf ( "%01.3f" , GetMicrotime() - $mt0 );
ShowHeader($str['cp_view']);
eval('echo "' . LoadTemplate('group_view') . '";');
ShowFooter();
Esempio n. 7
0
for ($side = 1; $side >= 0; $side--) {
    //$et= $turnside==$side ? '_f':'';
    if ($mems[$side]['online']) {
        $m_sideimg = "<img src=\"./images/stan1.gif\">";
    } else {
        $m_sideimg = "<img src=\"./images/stan0.gif\">";
    }
    //	$m_sideimg= "<img src=\"./images/{$cursideimg}{$et}.gif\">"
    //	:"<img src=\"./images/white{$et}.gif\">";
    if (empty($mems[$side]['u_name'])) {
        $m_avatar = MakeBBAvatar('');
        $m_name = $names[$side] . ' (' . HLTxt('Guest') . ')';
        $m_grade = 'N/A';
    } else {
        $m_avatar = MakeBBAvatar($mems[$side]['u_avatar']);
        $m_name = MemberLink($names[$side]) . '(' . $mems[$side]['skill'] . ')';
    }
    if ($gdata['status']) {
        $m_time = '';
        $m_time_step = '';
    } elseif ($turnside == $side) {
        $m_time = '剩时: ' . Time2HMS($timeinfo[0]) . HLTxt('*');
        //if( $timeinfo[1] <= 0 )
        //	$m_time= $m_time.HLTxt(' *');
        //$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 = '';
    }
Esempio n. 8
0
        $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;
        $mname = MemberLink($mdata['u_name']);
        $mgrade = $mdata['skill'];
        $mrate = $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);
        $mrate .= '%';
        $minfo = "{$mdata['g_w']}胜{$mdata['g_d']}平{$mdata['g_l']}负";
        $mregtime = TimeToDate($mdata['reg_date']);
        eval("\$mlist .= \"{$member_cell}\";");
        $mnum++;
    }
} else {
    $glist = "<tr><td colspan=\"7\">(空)</td></tr>";
}
ShowHeader('<img src="./images/ranking.gif" /> 用户排名');
eval('echo "' . LoadTemplate("ranking") . '";');
ShowFooter();
Esempio n. 9
0
//当前在线列表
$sql = "SELECT * FROM {$cfg['tb_onlines']} WHERE o_time>{$o_deadline}";
$result = RenDB_Query($sql);
$onlcount = RenDB_Num_Rows($result);
$onlines = '';
$first = true;
$guestcount = 0;
while ($row = RenDB_Fetch_Array($result)) {
    if ($row['u_stand'] == 0) {
        $guestcount++;
        continue;
    }
    if (!$first) {
        $onlines .= ', ';
    }
    $onlines .= MemberLink($row['fake_name']);
    $first = false;
}
if ($guestcount > 0) {
    if (!$first) {
        $onlines .= ', ';
    }
    $onlines .= "Guest x {$guestcount}</td>";
}
//删除旧的在线记录
$sql = "DELETE FROM {$cfg['tb_onlines']} WHERE o_time<={$o_deadline} OR o_time>'" . time() . "'";
RenDB_Query($sql, true);
//在线纪录
require_once './cache/onlinerec.php';
if ($onlcount > $maxonline[0]) {
    $maxonline[0] = $onlcount;
Esempio n. 10
0
 $buf .= "<td width=\"30\"><a href=\"group_view.php?group_id={$gpdata['group_id']}&orderby=2\">PtsM</a></td>";
 $buf .= "<td width=\"30\"><a href=\"group_view.php?group_id={$gpdata['group_id']}&orderby=3\">PtsE</a></td>";
 $buf .= "<td width=\"30\">Pl</td>";
 $buf .= "</tr>";
 foreach ($players as $k => $v) {
     $uid = $k + 1;
     $g_w = 0;
     $g_d = 0;
     $g_l = 0;
     $pts = 0;
     $berg = 0;
     $ptsm = $v['points'];
     $ptse = $v['points'];
     $pl = 1;
     $buf .= "<tr align=\"center\"><td>{$uid}</td>";
     $buf .= '<td>' . MemberLink($v['u_name']) . '</td>';
     foreach ($players as $k1 => $v1) {
         if ($v == $v1) {
             $buf .= "<td>-</td>";
         } else {
             if ($v1['points'] > $v['points']) {
                 $pl++;
             }
             $sql = "SELECT * FROM `{$cfg['tb_games']}` WHERE group_id='{$gpdata['group_id']}' AND (w_name='{$v['u_name']}' AND b_name='{$v1['u_name']}' OR b_name='{$v['u_name']}' AND w_name='{$v1['u_name']}') ORDER BY gid LIMIT 2";
             $result3 = RenDB_Query($sql);
             $points = 0;
             $games = '';
             while ($gdata = RenDB_Fetch_Array($result3)) {
                 $uid1 = $k1 + 1;
                 if ($gdata['status']) {
                     $isblack = IsSameName($gdata['b_name'], $v['u_name']);