Jump to content

rswildy

Members
  • Posts

    98
  • Joined

  • Last visited

rswildy's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. rswildy

    Hiscore help

    that all works fine but when skill is found it will show link however if its not found(they aren't ranked), It wont show link. I want it to show link no matter what, How could i do that?EDIT: Oh haha it does, My bad it was an error i made.
  2. rswildy

    Hiscore help

    Thankyou, Now im wondering if you go to http://www.runescape.com, You see how it says there is currently {number} people playing. How would i go about making that show on my php file.
  3. rswildy

    Hiscore help

    I understand that but i mean i don't want to change the output of ALL the skills, I wish to change them all so you can click the skill and it will take you to a link (diffrent for each one), Any ideas?
  4. rswildy

    Hiscore help

    Hi, Now if i change the name of the skill it won't work because its getting the source from runescape.com so if i wanted to make say the "Attack" go to a page called attack.php or wanted to change the font to red / bold or something how could that be done, If you altar the name on the $skill_list it wont work you will just get an extra tab onto the hiscore list. For example if you put <b> </b> tags on Overall then it will show up twice on the hiscore list the bold version will just say -- and wont retrieve any details the normal version will apear as normal (unedited). <?phpif (isset($_GET['name'])){ $skill_list = array("Overall", "Attack", "Defence", "Strength", "Hitpoints", "Ranged", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecraft", "Hunter", "Construction"); $contents = ""; $handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=".urlencode($_GET['name']),"r"); if($handle) { while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); } echo "<table cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr>"; echo "<td style=\"border-bottom: 1px solid black;\">Skill</td>"; echo "<td style=\"border-bottom: 1px solid black;\">Rank</td>"; echo "<td style=\"border-bottom: 1px solid black;\">Level</td>"; echo "<td style=\"border-bottom: 1px solid black;\">XP</td>"; echo "</tr>"; $bg = false; $found_skills = array(); $skills = parse($contents); foreach ($skills as $info) { if ($bg) echo "<tr style=\"background: #333333;\">"; else echo "<tr>"; echo "<td>{$info['skill']}</td>"; echo "<td>{$info['rank']}</td>"; echo "<td>{$info['level']}</td>"; echo "<td>{$info['xp']}</td>"; echo "</tr>"; $found_skills[] = $info['skill']; $bg = !$bg; } $missing_skills = array_diff($skill_list, $found_skills); foreach($missing_skills as $skill) { if ($bg) echo "<tr style=\"background: #333333;\">"; else echo "<tr>"; echo "<td>{$skill}</td>"; echo "<td>--</td>"; echo "<td>--</td>"; echo "<td>--</td>"; echo "</tr>"; $bg = !$bg; } echo "</table>";}function parse($contents){ $matches = array(); $pattern = "@<tr>\\s<td.*><a.*>\\s([^<]+)\\s</a></td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s</tr>@imsU"; $nr_matches = preg_match_all($pattern, $contents, $matches); $retval = array(); $i = 0; for ($i = 0; $i < count($matches[1]); $i++) { $retval[$i]['skill'] = $matches[1][$i]; $retval[$i]['rank'] = $matches[2][$i]; $retval[$i]['level'] = $matches[3][$i]; $retval[$i]['xp'] = $matches[4][$i]; } return $retval;}?> Thanks, Rswildy.
  5. Just checked it out, Nothing pops up in Firefox or IE but if you mean the text that apears under the image then its working fine.
  6. Still not fixed, Could anyone help?
  7. + Is gone, Its a variable i guess.
  8. Hi. <?php$contents = "";$handle = fopen("http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=". urlencode($_GET['username']),"r");if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle);}function parse($skill_name){ global $contents; $matches = array(); $pattern = "@<tr>\\s<td.*><img.*></td>\\s<td.*><a.*>\\s" . $skill_name . "\\s</a></td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s<td.*>([0-9,\\s]*)</td>\\s</tr>@imsU"; $match_found = preg_match($pattern, $contents, $matches); $retval = array(); if ($match_found && $matches[1] != "") $retval['rank'] = $matches[1]; else $retval['rank'] = "--"; if ($match_found && $matches[2] != "") $retval['level'] = $matches[2]; else $retval['level'] = "--"; if ($match_found && $matches[3] != "") $retval['xp'] = $matches[3]; else $retval['xp'] = "--"; return $retval;}$target_lvl = $_GET['target_lvl'] * 150 + $Woodcutting['xp'];$Woodcutting = parse("Woodcutting");echo "Rank: " . $Woodcutting['rank'] . "<br>";echo "Level: " . $Woodcutting['level'] . "<br>";echo "XP: " . $Woodcutting['xp'] . "<br>";echo "You need to cut " . $Woodcutting['level'] . " Yew trees. " . "<br />";echo "If you cut " . $_GET['target_lvl'] . " Yew trees you will have a total of " . $target_lvl. "xp." . "<br />";?> The output of this code is everything shows fine except: $target_lvl = $_GET['target_lvl'] * 150 + $Woodcutting['xp']; The problem with this line is the + $woodcutting['xp'] i think its because the numbers on the main code ['xp'] are formatted with commas' If someone could make it work then i would be happy.Thanks, Rswildy.
  9. rswildy

    td height

    I don't think that can be done however you can make it so that you can see 1 table on left side then right side could be visible with extra table under but no border i think, Never really crossed my mind to try that. you can always try making 2 X 2 table then removing 1 of the tables from inside so its 2 on 1 side and 1 on the other.
  10. rswildy

    td height

    Hi, Could you explain it a little clearer or maybe add an example?Thanks, Rswildy.
  11. rswildy

    IE Bug?

    Looks exactly the same in both Firefox and IE for me, I'm not sure i see the problem.
  12. As far as i know there isn't a code for vertical lines, I would try using a graphical image or a very thin table.http://www.webmastercourse.com/web-design-...ine-divider.htmThats a vertical line they are just using a thin table, Thats the closest you will get i think, Feel free to let me know if im wrong.
  13. Found a basic way should work :S <a href="java script: history.go(-1)">Back</a> Try that, If it doesn't work i don't know what to reccomend.
  14. rswildy

    PHP script

    Thanks for pointing that out my friend.I've pretty much re-written the code to make it easier to read
×
×
  • Create New...