示例#1
0
     }
     showavatar($t['playerID']);
 }
 if ($CFG_ENABLE_SUBRANKING) {
     $subrank = "";
     $p2 = mysql_query("select * from medals where playerID='{$t['playerID']}'");
     while ($row2 = mysql_fetch_array($p2)) {
         $subrank .= "<img alt='" . $row2[medal] . "' src='images/rank/{$row2['medal']}.gif'>";
     }
     echo "<br><br>{$subrank}";
 }
 $status = $t['playerID'] == 500 ? $status = "Administrator<br>" : "";
 $status44 = $t['playerID'] == 500 ? "Chess-Trainer<br>" : "";
 echo "<br>" . $status . $status44;
 $player = $t['playerID'];
 $stats_user = getStatsUser($player, 1);
 $vitorias = $stats_user[0];
 $derrotas = $stats_user[1];
 $empates = $stats_user[2];
 $ativos = $stats_user[3];
 $total = $vitorias + $derrotas + $empates;
 echo "<br>Points: {$total}";
 if ($total < 10) {
     $status12 = "Chess Novice";
 } elseif ($total >= 10 and $total <= 50) {
     $status12 = "Chess Junior";
 } elseif ($total >= 51 and $total <= 100) {
     $status12 = "Chess Member";
 } elseif ($total >= 101 and $total <= 200) {
     $status12 = "Chess Fan";
 } elseif ($total >= 201 and $total <= 300) {
                    /* Check if newuser playing newuser */
                    //if (getRating($_SESSION['playerID']) == 0 && getRating($_POST['opponent']) == 0){
                        //displayError("New Users are not allowed to play eachother!", "newuserchallenge.php");
                        //}
                    /* Check if the number of games don´t reached 5*/
                    if (getRating($_SESSION['playerID']) == 0){
                        $stats = getStatsUser($_SESSION['playerID'],0);
                        $total = $stats[3]+$stats[4];

                        if ($total >= 10){
                            $ngames = 1;
                            displayError("You are still in the trial and initiation process. <br>You have reached the limit of 10 games or have sent out the maximum of 10 invitations. <br> If you wish to send out different invitations <br>please cancel your current invitaitons.", "newuserchallenge.php");
                        }
                    }
                    if (getRating($_POST['opponent']) == 0){
                        $stats = getStatsUser($_POST['opponent'],0);
                        $total = $stats[3]+$stats[4];
                        if ($total >= 10){
                            $ngames = 1;
                            displayError("This opponent is in the trial and initiation  <br>process and has reached the 10 game limit!", "newuserchallenge.php");
                        }
                    }

            }


            if ($ngames == 0)
            {
                if (!minimum_version("4.2.0"))
                    init_srand();
    function getPV($player){
        $stats = getStatsUser($player,1);
            $vitorias = $stats[0];
            $derrotas = $stats[1];
            $empates = $stats[2];
            $ativos = $stats[3];
            $total = $vitorias+$derrotas+$empates;

        if ($total>0)
            return round($vitorias/$total*100,2);
        else
            return 0;
    }

    <table border="1" width="100%">
	<tr><th colspan=3><?php 
echo $MSG_LANG["statistics"];
?>
</th>
	</tr>
<?
    $player = $_GET['cod'];
	$gender["m"] = $MSG_LANG["male"];
	$gender["f"] = $MSG_LANG["female"];


        $stats_user = getStatsUser($player,1);
		$stats_user2= getStatsUser($player,0);
		$vitorias = $stats_user[0]+$stats_user2[0];
        $derrotas = $stats_user[1]+$stats_user2[1];
        $empates = $stats_user[2]+$stats_user2[2];
        $ativos = $stats_user[3]+$stats_user2[3];
        $invites = $stats_user[4]+$stats_users2[4];
		$total = $vitorias+$derrotas+$empates;
		$botlimit = $ativos+$invites;

        $p = mysql_query("SELECT * from players where playerID='".$_GET['cod']."'");
        $row = mysql_fetch_array($p);
		$t2 = mysql_query("select * from team_members where fk_player='".$_GET['cod']."' and level>'0'");
		$rt = mysql_fetch_array($t2);
		$rt2= mysql_query("SELECT name from team WHERE teamID='$rt[fk_team]'");
		$rtn = mysql_fetch_array($rt2);
		$teamName =$rtn['name'];