Custom Xbox Gamertag PHP scripts: experts wanted to vet my code!

Soldato
Joined
16 Nov 2003
Posts
9,682
Location
On the pale blue dot
A lot of people here have Xbox Live signatures, and I want one too, but I wanted it to be a little more unique! So to exercise my PHP madskillz I went about creating some scripts in PHP to do it. The source of the scripts (please don't mind the mad formatting, its a work in progress) here:

http://www.sidtheturtle.co.uk/gamercard/src/

The current output (looks a lot like the current sigs, but is customisable) looks like this:

[Image removed while I work out the bugs]

The script gamercard_get.php goes through the Xbox Live .card file available on the net and searches for the relevant information. The gamercard.php file runs functions found in functions.php to present this info in image form based on variables set in variables.php. I've tried to design it to be as fully customisable as possible from a user point of view. I'm quite pleased with it, but could do with your help. Problems:

1. Its slow. Calls to GD take time. To render the signature takes between 10 and 30 seconds.
2. I can't get transparency to work. For the gamer rating stars, I want the grey to be transparent, but not cause transparency elsewhere that grey is used. I don't understand how to create alpha channels in GD without resorting to using PNG files.

Any ideas how to speed it up and get transparency to work? Also what are your general feelings on the methodology, security holes etc?
 
Last edited:
Host is going mad atm. I've been on at them as they keep messing around.

I put .src on the end so you can grab them though. I'll rename them something that won't confuse the host :D
 
Its an idea, however in the end I was going to clean it up for 'public consumption'. Like how you have 'want a rotating sig, throw this code into a website and poof, you're done'.

Unless of course I have a function that checks if any of the information has been changed (gamerscore, recent games etc.) and if so, updates the image.
 
Thanks for the advice so far guys. I've got it working quite nicely now, it will only update when some of the data changes, for example when I unlock an achievement and my GamerScore goes up. Might add a timeout function as well so that it only goes off to the xbox site if the image is older than an hour, to prevent a zillion calls to the site if my sig is in a popular thread! That and fix the transparency, clean it up and its good to go methinks.
 
Back
Top Bottom