Jump to content

Recommended Posts

I need help building a PHP High Scores system. I've looked all over the net and the only ones I can find are for flash based high scores system. I need to build one for Battlefield 2142 stats so that I can list my clan members on a chart showing peoples scores on each stat and listing them in order of best score to lowest.

 

Could anyone show me how to go about doing this? Thanks!

Link to comment
https://forums.phpfreaks.com/topic/73080-php-high-scores-system/
Share on other sites

Here is a little head start for you.

<?PHP

$clanid = "2140";

$xml = simplexml_load_file('http://bf2142tracker.com/livefeed/xml_clanprofile.php?clanid=' . $clanid);

echo'
<table border="1">
  <tr>
    <th colspan="8" scope="col">Battle Feild 2142 Clan Stats</th>
  </tr>
  <tr>
    <td><div align="center">#</div></td>
    <td><div align="center">Playename</div></td>
    <td><div align="center">Country</div></td>
    <td><div align="center">Wins</div></td>
    <td><div align="center">Losses</div></td>
    <td><div align="center">Kills</div></td>
    <td><div align="center">Deaths</div></td>
    <td><div align="center">Status</div></td>
  </tr>';
foreach ($xml->PLAYERLIST->PLAYER as $Player) {
$rank = $Player->PLAYERRANK;
$name = $Player->PLAYERNAME;
$profile = $Player->PLAYERSTATSURL;
$flag = $Player->PLAYERCOUNTRY;
$wins = $Player->PLAYERWINS;
$loss = $Player->PLAYERLOSS;
$kills = $Player->PLAYERKILLS;
$deaths = $Player->PLAYERDEATHS;
$status1 = $Player->PLAYERSTATUS;

if ($status1 == 1) {
$status = online;
}else{
$status = offline;
}

if ($flag == "-") {
$flag = "unknown";
}

echo'
  <tr>
    <td><img src="http://bf2142tracker.com/Images/bf2142_rankimages/ranksmall_' . $rank . '.gif"></td>
    <td><a href="' . $profile . '" target="_blank">' . $name . '</a></td>
    <td><img src="http://bf2142tracker.com/Images/CountryIcons/' . $flag . '.gif"></td>
    <td>' . $wins . '</td>
    <td>' . $loss . '</td>
    <td>' . $kills . '</td>
    <td>' . $deaths . '</td>
    <td><img src="http://bf2142tracker.com/Images/bf_user_' . $status . '.gif"></td>
  </tr>';
}
echo'
</table>
';
?>

 

That will out put http://1337gamerz.recoding.net/2142stats/2142.php

I think its is to sorting via global score but something is wrong with the xml feed that is making all global scores 0 :S

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.