예제 #1
0
 $game_cell = LoadTemplate('g_cell_new');
 //$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;
                 }
             }
         }
예제 #2
0
    default:
        $m_gender = '保密';
}
$m_from = $mdata['u_from'] == '' ? '----' : $mdata['u_from'];
//$cfg['qq_types']=explode('|',$cfg['qq_types']);
//$m_qq_type=isset($cfg['qq_types'][$mdata['qq_type']]) ? $cfg['qq_types'][$mdata['qq_type']] :'腾讯QQ';
if ($mdata['u_qq'] != '') {
    $m_qq = $mdata['u_qq'];
} else {
    $m_qq = '----';
}
$m_email = $mdata['show_email'] ? "<a href=\"mailto:{$mdata['u_email']}\">{$mdata['u_email']}</a>" : '保密';
$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'])) {
예제 #3
0
 if (IsSameName($gdata['host_name'], $udata['u_name'])) {
     MessageBox('不能和自己对局');
 }
 if ($userip == $gdata['u_ip']) {
     MessageBox('IP 限制,你不能加入这一局');
 }
 //if( $gdata['status'] != 0 || $gdata['w_name']!='' )  MessageBox( '白棋的位置已经有人了' );
 foreach ($applist as $k => $v) {
     if (IsSameName($v[0], $udata['u_name'])) {
         MessageBox('你已经在等待队列中了');
     }
 }
 if ($gdata['app_count'] >= $cfg['maxapply']) {
     MessageBox('这一桌已经满人了');
 }
 $mytout = GetBBTout($udata);
 //积分和掉线率
 if ($gdata['skill_range'] != -1 && ($udata['skill'] < $gdata['skill'] - $gdata['skill_range'] || $udata['skill'] > $gdata['skill'] + $gdata['skill_range'])) {
     MessageBox('您的积分不符合桌主要求');
 }
 if ($mytout > $gdata['tout_max']) {
     MessageBox('您的掉线率不符合桌主要求');
 }
 if ($gdata['app_list'] != '') {
     $gdata['app_list'] .= '|';
 }
 $gdata['app_list'] .= "{$udata['u_name']},{$udata['skill']},{$mytout}";
 if ($gdata['app_count'] == 0) {
     $gdata['l_time'] = $nowtime;
 }
 $gdata['app_count']++;