Exemplo n.º 1
0
    function getDifficult($first,$second){
    GLOBAL $MSG_LANG;

        $hislevel = getPlayerLevel($second);
        $mylevel = getPlayerLevel($first);
        $diff = $mylevel - $hislevel;

        if ($diff <= -4)
            $dificuldade = $MSG_LANG["impossible"];
        else if ($diff <= -2)
            $dificuldade = $MSG_LANG["verydifficult"];
        else if ($diff >= 2)
            $dificuldade = $MSG_LANG["veryeasy"];
        else if($diff == 1)
            $dificuldade= $MSG_LANG["easy"];
        else if($diff == -1)
            $dificuldade = $MSG_LANG["difficult"];
        else if($diff == 0)
            $dificuldade = $MSG_LANG["normal"];


        return $dificuldade;
    }
                    <td width=50% style='text-align:left'>".$tmpPlayer['firstName']."</td>
                    <td width=15%>".$tmpPlayer['pais']."</td>
                    <td width=10%><strong><font color=red>$MSG_LANG[newuser]</strong></font></td>
                    <td width=10%>".getPlayerLevel($tmpPlayer['playerID'])."</td>";

                    else
                    echo "<tr>
                    <td width=5%><img src='images/$img.gif' alt='$img'></td>
                    <td width=5%>
                    <input type='button' style='font-size:11' value='$MSG_LANG[invite]' onClick=\"javascript:challenge(".$tmpPlayer['playerID'].")\">                 </td>
                    <td width=5%>
                    <input type='button' style='font-size:11' value='$MSG_LANG[sendmessage]' onClick=\"javascript:MessagePlayer(".$tmpPlayer['playerID'].")\">                 </td>
                    <td width=50% style='text-align:left'>".$tmpPlayer['firstName']."</td>
                    <td width=15%>".$tmpPlayer['pais']."</td>
                    <td width=10%>".$tmpPlayer['rating']."</td>
                    <td width=10%>".getPlayerLevel($tmpPlayer['playerID'])."</td>";
                    //<td width=10% style='text-align:right'>".getPV($tmpPlayer['playerID'])."%</td>
                    echo "<td width=5%><input style='font-size:11' type=button value='".$MSG_LANG["details"]."' onClick=\"window.location='stats_user.php?cod=".$tmpPlayer['playerID']."'\")>
                    </td>
                    </tr>\n";


        }

    ?>
</table>
<BR>


<?
    /* if game is marked playerInvited and the invite is from the current player */
Exemplo n.º 3
0
        $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'];

        $nivel = getPlayerLevel($_GET['cod']);
        $PV = getPV($_GET['cod']);

        $mylevel = getPlayerLevel($_SESSION['playerID']);
        $dificuldade = getDifficult($_SESSION['playerID'],$_GET['cod']);

		if ($row['playerID'] == $_SESSION['playerID'])
		    $isme=1;
		else $isme=0;

		echo "
		<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["name"]."</td><td style='text-align:left' width=50%>$row[firstName]</td><td valign='center' rowspan='17' width=30%>";
		show_avatar($row['playerID']);
		echo "</td></tr>";
		echo "
		<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["bio"]."</td><td style='text-align:left' width=50%>$row[bio]</td>";
		echo "
		<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["localization"]."</td><td style='text-align:left' width=50%>$row[cidade], $row[uf] - $row[pais]</td></tr>
		<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["gender"]."</td><td style='text-align:left' width=50%>".$gender[$row[sexo]]."</td></tr>