Moo
Full Member
Posts: 395 Reputation: 19
Joined: Jun 2004
|
O.P. RE: PHP Images... I can't make one. :(
Why wont this work?
code: <?
$handle = fopen("http://www.bungie.net/Stats/PlayerStats.aspx?player=guyguyme2003", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
$match = InsideTags('<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">','</div></div>',$contents); // uses a regular expression and gets the stuff inbetween those two points and returns it
$rumble_pit = $match[1][0];
$team_skirmish = $match[1][1];
$head_to_head = $match[1][2];
$big_team_battle = $match[1][3];
$team_slayer = $match[1][4];
function InsideTags($tag1,$tag2,$html){ //function to grab text inbetween two points
$tag2 = str_replace('/', "\/" ,$tag2);
preg_match_all("/$tag1(.*)$tag2/i", $html, $match);
return $match;
}
header("Content-type: image/png");
$im = @imagecreatefromjpg("http://guillaumelforum.theglassprison.net/halo2/Halo%202%20Stats_files/stats1.jpg");
$text_color = imagecolorallocate($im, 0, 0, 0);
$line = 10;
imagestring($im, 12, 5, $line, $rumble_pit, $text_color);
$line = $line + 15;
imagestring($im, 12, 5, $line, $team_skirmish, $text_color);
$line = $line + 15;
imagestring($im, 12, 5, $line, $head_to_head, $text_color);
$line = $line + 15;
imagestring($im, 12, 5, $line, $big_team_battle, $text_color);
$line = $line + 15;
imagestring($im, 12, 5, $line, $team_slayer, $text_color);
imagepng($im);
imagedestroy($im);
?>
|
|