PDA

View Full Version : [Pension] PHP 'Get Habbo Figure' Script



Plucked
07-04-2012, 02:59 PM
Yeah, so there is probably something like this around but I just wanted to see if I was able to do it myself via php - as it turns out, i can.

Basically, it generates your Habbo avatar/player/character as an image - all via php.

Live demo:
http://loduz.in/HabboFigure.php?habbo=pension
url: http://loduz.in/HabboFigure.php?habbo=pension

PHP Code:

<?php
######################################
## PHP 'Show Habbo Figure' Script ##
## Created by Pension (Robbie) ##
######################################

header("Content-type: image/png");
$habbo = $_GET['habbo'];
$char = 'http://www.habbo.com/habbo-imaging/avatarimage?user='. $habbo .'&action=std&direction=2&head_direction=3&gesture=sml&size=l&img_format=png';
$char2 = imagecreatefrompng($char);
imagealphablending($char2, true); // setting alpha blending on
imagesavealpha($char2, true); // save alphablending setting (important)
imagepng($char2);
imagedestroy($char2);
?>If any php expert has a better/cleaner way to do this, i'd be glad to know how (legit) - as i want the quickest/best possible way of doing this.

Rate/Slate please :)

Want to hide these adverts? Register an account for free!