Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Location
    /usr/local
    Posts
    2,809
    Tokens
    688

    Latest Awards:

    Default RS Highscore Help

    Literly, i coded this php highscore, someone enters a name on a diff page, and the highscore will appear on a diff page. If the user dosent have a highscore, it displays as "-1". How can i change it so insted of it appearing as "-1" is just says "-" using a if or something.

    code:

    PHP Code:
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Runescape player highscore. Player: <?php echo $_POST["name"]; ?></title>
    <style type="text/css">
    <!--
    .style1 {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 9px;
        color: #FFFFFF;
    }
    .style2 {color: #000000}
    .style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; }
    -->
    </style>
    </head>

    <body>

    <table width="345" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">
      <tr>
        <td height="30" width="75" background="images/bar1.png"><div align="center" class="style1">Skill</div></td>
        <td height="30" width="70" background="images/bar1.png"><div align="center" class="style1">Level</div></td>
        <td height="30" width="106" background="images/bar1.png"><div align="center" class="style1">Rank</div></td>
        <td height="30" width="76" background="images/bar1.png"><div align="center" class="style1">XP</div></td>
      </tr>
        <?php
        $parse
    ["config"]["username"] = $_POST["name"];
        
    $parse["config"]["skills"] = array("Overall""Attack""Defence""Strength""Hitpoints""Ranged""Prayer""Magic""Cooking""Woodcutting""Fletching""Fishing""Firemaking""Crafting""Smithing""Mining""Herblore""Agility""Thieving""Slayer""Farming""Runecrafting""Hunter""Construction""Summoning");
        
    $parse["config"]["minigames"] = array("Duel Tournament""Bounty Hunters""Bounty Hunter Rogues""Fist of Guthix""Mobilising Armies");
        
    $parse["contents"] = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=" $parse["config"]["username"]);
        
    $parse["contents"] = explode("\n"$parse["contents"]);
        foreach (
    $parse["contents"] AS $k => $v)
        {

            if (!empty(
    $v))
            {
                if ((
    count($parse["contents"]) - count($parse["config"]["minigames"]) - 1) > $k)
                {
                    
    $parse["temp"] = explode(","$v);
                    echo(
    "
      <tr>
        <td><div align=\"center\" class=\"style3\">" 
    $parse["config"]["skills"][$k] ." </div></td>
        <td><div align=\"center\" class=\"style3\">" 
    $parse["temp"][1] . "</div></td>
        <td><div align=\"center\" class=\"style3\">" 
    $parse["temp"][0] . "</div></td>
        <td><div align=\"center\" class=\"style3\">" 
    $parse["temp"][2] . "</div></td>
        "
    );
                    }
            }
        }
    ?>
      </tr>
    </table>
    </body>
    </html>
    DEMO: http://www.de-cayed.co.uk/rs/
    Last edited by Swinkid; 29-10-2009 at 12:10 AM.

  2. #2
    Join Date
    Aug 2009
    Location
    South Wales.
    Posts
    377
    Tokens
    50

    Default

    I haven't got a clue with PHP!

    But cool script


  3. #3
    Join Date
    Feb 2006
    Location
    /usr/local
    Posts
    2,809
    Tokens
    688

    Latest Awards:

    Default

    Considering thats missing half its code, thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •