Well, it’s been a while sense I last updated this… works being done on HE and some of my other projects. School’s almost over (one more day). Anyway, I recently created a sig generator for a game I play called Frag.Ops. A nice community member (known as Diesel_Fuel_Only) created a stats site for all the servers. It runs UTStatsDB with no modifications (other than images). I wanted to create sigs for the site, the only problem was he wouldn’t give me access to his MySQL databases because he’s kind-of a duche. Anyway, the work around was the parse the site directly, and build the sigs. He now made his own (that suck balls) so I decided to release the code I used to parse the site, as well as generate the images.
I split it into two classes. One to parse the site, and one to build the image. The image class is a php GD interface. The UTStatsDB parser is a different class. You enter the ID of the player you want, and the URL of the site pages, and it gathers some data about the player. A download link to the classes will be at the bottom of this post. First, heres and example of how to use them:
$thisID = 7;
$statObj = new statsParser($thisID, ‘http://www.fostats.com/fostats/playerstats.php?player=’, ‘http://www.fostats.com/fostats/index.php?stats=players’);
// Check stats
$mRank = $statObj->playerMissionRank;
if ($statObj->playerMissionRank == 0)
$mRank = ‘N/A’;
$wRank = $statObj->playerWarRank;
if ($statObj->playerWarRank == 0)
$wRank = ‘N/A’;
// Build Array
$text[0] = ‘Player: ‘ . $statObj->playerName;
$text[1] = ‘Total Kills: ‘ . $statObj->playerKills;
$text[2] = ‘Total Deaths: ‘ . $statObj->playerDeaths . ‘ KDR: ‘ . round($statObj->playerKills / $statObj->playerDeaths, 2);
$text[3] = ‘Mission Rank: ‘ . $mRank . ‘ War Rank: ‘ . $wRank;
$text[4] = ‘Overall Rank: ‘ . $statObj->playerOverallRank;
$totalText = 5;
// Make the image
$imageSys = new imgEditor(‘bgimg.png’, ”);
$imageSys->setFont(‘main.ttf’);
$imageSys->setSize(12);
$color[0] = 255;
$color[1] = 255;
$color[2] = 255;
$shade[0] = 150;
$shade[1] = 150;
$shade[2] = 150;
for ($iLoop2 = 0; $iLoop2 < $totalText; $iLoop2++)
$imageSys->addShadowText($text[$iLoop2], 5, 19 + (20 * $iLoop2), $color, $shade, 1);
$imageSys->outputToFile($thisID . ‘.png’, ‘./built_sigs/’);
This work is licensed under the Creative Commons Attribution-NoDerivs 3.0 United States. If you wish to use my work for the public (generate sigs/images for the public/more people than just yourself you must include “Generated using classes by Matt Razza” in the image you generate (or page if it’s just a stats page)). If it’s just for you, it’s not needed.
Download: Here
See the classes, and example code in action: 