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.