Yeah, ok, since I've dug into this yesterday and today, when I really have better things to do, well here it goes. 
 
I haven't look at your class because I don't run 2.7.  I'm not sure if yours reads 2.6 stats as well, I thought it didn't.   So instead, take my code and change it.
This isn't finished.  I was going to put code in for different image types, only half written, so it might look goofy and aimless and sloppy.
And because this is really simple stuff, no need to gpl it.  Just take it baby!
Code: Select all
<?php
//define some stuff here
$defaultplayername = "goggles"; //when no name is specified, use this
$server = "ARMAGOSHDARNISH in 2.6";
//$font = "slkscrb.ttf"; //full path to font name desired. 
$font = "trebuchet.ttf"; //full path to font name desired. 
// put any truetype font in the same dir/folder and use it.
$img_png = ""; // path or url to png file for background
$img_gif = "statsbackground.gif"; // path or url to gif file for background
$pathtotron = "yourpathtotrondata/";   // specify folder
//DO NOT EDIT BELOW THIS LINE
if (!$player)
$player = $defaultplayername;
// this is the class I can't release that lets me get stats.  Luckily it was a class !  It only reads 2.6 style stats that are NOT tab delimited.
require_once( "class2.armagetronstats.php" );
$s = new CArmagetronStats( $pathtotron, 100 );
// also, that 100 only takes the first 100 IIRC.  It should be upped's obviously.  
$player = $_GET['p'];
$PlayerInfo =  $s->GetPlayerInfo( $player );
//only use .gif at the moment, but it could be whatever if you change the next line appropriately.  I was going to put in some code for this.
$img_number = imagecreatefromgif($img_gif);
// define some colours
$white = imagecolorallocate($img_number,255,255,255);
$black = imagecolorallocate($img_number,0,0,0);
$grey_shade = imagecolorallocate($img_number,80,80,80);
$red = imagecolorallocate($img_number,200,0,0);
$yellow = imagecolorallocate($img_number,255,255,150);
// so here is where we pluck the stats out of the the array that used the class I can't release.  Do whatever you want to get these stats.
$rankladder = $PlayerInfo['ladder'];
$rankmatch = $PlayerInfo['rankmatches'];
$rankround = $PlayerInfo['rankrounds'];
$scoreladder = $PlayerInfo['ladderscore'];
	$scoreladder = round($scoreladder, 2); // I'm just rounding to 2 decimal places
$scorematch = $PlayerInfo['wonmatches'];
$scoreround = $PlayerInfo['wonrounds'];
// write in the stats we acquired into the image
Imagettftext($img_number, 11.5,0,60,15,$white,$font,$player);
Imagettftext($img_number, 8.5,0,60,26,$white,$font,$server);
Imagettftext($img_number, 9.5,0,215,26,$yellow,$font,"$rankladder/$scoreladder");
Imagettftext($img_number, 9.5,0,275,26,$yellow,$font,"$rankmatch/$scorematch");
Imagettftext($img_number, 9.5,0,333,26,$yellow,$font,"$rankround/$scoreround");
// send in the clowns
header("Content-type: image/png");
imagepng($img_number);
//  image destroy to prevent memory leaks
imagedestroy($img_number); 
// where are the clowns?
?>