if ($order2 == "ASC") $order2inv = "DESC"; else $order2inv = "ASC"; if ($order=="firstName") $order="substring(firstName,0,5)"; $tempo2 = time()-1209600; //if ($computer == "1") //$tmpQuery="SELECT * FROM players WHERE engine='1' AND ativo='1' and rating>0 ORDER BY rating,substring(firstName,0,5)"; if ($newuser == "1") $tmpQuery="SELECT firstName,pais,rating,playerID,lastUpdate FROM players WHERE lastUpdate>='$tempo2' and ativo='1' and playerID <> ".$_SESSION['playerID']." and rating=0 ORDER BY substring(firstName,0,5)"; else if ($slevel == "1") $tmpQuery="SELECT firstName,pais,rating,playerID,lastUpdate FROM players WHERE lastUpdate>='$tempo2' and engine='0' AND firstName like '$letra%' and rating<=".getXPmax($level)." AND rating >= ".getXPmin($level)." AND playerID <>".$_SESSION['playerID']." AND ativo='1' ORDER BY rating"; else if ($ponline == "1"){ $tempo = time()-300; $tmpQuery = "SELECT firstName,pais,rating,playerID,lastUpdate FROM players WHERE lastUpdate>='$tempo' AND engine='0' and playerID <> ".$_SESSION['playerID']." AND ativo='1' ORDER BY $order"; }else if ($order == "rating" || $order == "pais") $tmpQuery="SELECT firstName,pais,rating,playerID,lastUpdate FROM players WHERE lastUpdate>='$tempo2' and engine='0' AND playerID <> ".$_SESSION['playerID']." AND ativo='1' and pais !='' ORDER BY $order $order2"; else if (isset($_GET['cod'])) $tmpQuery="SELECT firstName,pais,rating,playerID,lastUpdate FROM players WHERE lastUpdate>='$tempo2' and playerID=".$_GET['cod']; else $tmpQuery="SELECT firstName,pais,rating,playerID,lastUpdate FROM players WHERE lastUpdate>='$tempo2' and engine='0' AND firstName like '$letra%' and playerID <> ".$_SESSION['playerID']." AND ativo='1' ORDER BY $order"; if ($order == "substring(firstName,0,5)" && $ponline != "1") for ($l=65; $l<=90; $l++) echo "<a href='".$_SERVER['PHP_SELF']."?ponline=$ponline&order=$order&letra=".chr($l)."'>[".chr($l)."]</a> "; else{
} elseif ($row['DisplayBot'] == 1 && $botlimit>=10) { echo "<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["challengethisplayer"]."</td><td style='text-align:left'>I have reached my 10 active game limit!</td></td></tr>"; } elseif (getRating($row['playerID']) == 0 && !$isme) { echo "<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["challengethisplayer"]."</td><td style='text-align:left'><input type='button' style='font-size:11' value='$MSG_LANG[challengethisplayer]' onClick=\"javascript:newuserchallenge(".$row['playerID'].")\"> </td></td></tr>"; } elseif (!$isme) { echo "<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["challengethisplayer"]."</td><td style='text-align:left'><input type='button' style='font-size:11' value='$MSG_LANG[challengethisplayer]' onClick=\"javascript:challenge(".$row['playerID'].")\"> </td></td></tr>"; } echo "<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["level"]."</td><td style='text-align:left'>".$nivel."</td></tr>"; echo "<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["rating"]."/".$MSG_LANG["max"]."</td><td style='text-align:left'>$row[rating]/$row[rating_max] (<B>".$MSG_LANG["nextlevel"].":</b> ".getXPmax($nivel).")</td></tr>"; if (!$isme){ $xpw = getXPW(getRating($_SESSION['playerID']),$row['rating'],getPV($_SESSION['playerID'])); $xpl = getXPL($row['rating'],getRating($_SESSION['playerID']),getPV($_GET['cod'])); echo "<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["challengerate"]."</td><td style='text-align:left'>$dificuldade (<i>".$MSG_LANG["ifwin"].": +$xpw ".$MSG_LANG["iflose"].": -$xpl</i>)</td></tr>"; echo "<tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["lastseen"]."</td><td style='text-align:left' width=50%>".date("d/m/y H:i",$row[lastUpdate])."</td></tr>"; } echo "<tr><td nowrap width='20%' style='text-align:left'><B>".$MSG_LANG["finishedgames"]."</td><td style='text-align:left'>$total</td></tr> <tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["victories"]."</td><td style='text-align:left'>$vitorias ($PV%)</td></tr> <tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["defeats"]."</td><td style='text-align:left'>$derrotas</td></tr> <tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["draw"]."</td><td style='text-align:left'>$empates</td></tr> <tr><td width='20%' style='text-align:left'><B>".$MSG_LANG["activegames"]."</td><td style='text-align:left'><a href=games_user.php?cod=$player>$ativos games</a></td></tr>"; if (mysql_num_rows($t2) >0)