help with a dynamic siggy?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
evilcorpse
Forum Newbie
Posts: 1
Joined: Wed Feb 27, 2008 11:14 pm

help with a dynamic siggy?

Post by evilcorpse »

I am trying to make a signature that shows stats from a game called runescape, into the picture. The direct link to the url for the information i am trying to use for the sig is http://hiscore.runescape.com/index_lite ... il++corpse.

icant figure out how to get any of the values to show in the image, and i want to be able to pick each sepearate value and place it on the image in different locations... My attempts at a script for this is here:

Code: Select all

 
 <?php
 
$cats_for_rs = 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’, ‘Summon’);
$user = “Evil__Corpse”;
$txt = file_get_contents(’http://hiscore.runescape.com/index_lite.ws?player=’.$user);
$score = array();
//explode using end of line as a delimiter
$data = explode (”\n”, $txt);
$ind = 0;
foreach ($data as $word) {
//key is a skill name
$key = $cats_for_rs[$ind];
//explode using a comma as a delimiter
$data_n = explode (”,”, $word);
$score[$key][”Rank”] = $data_n[0];
$score[$key][”Level”] = $data_n[1];
$score[$key][”Exp”] = $data_n[2];
$ind++;
}
?>
If you can show me how to get at least 1 of the inputs to show in the image i would be very grateful.
If you can perfect my code that would be even better 8)
please help?
Post Reply