include ‘System/Header.php’;
/* Database */
$con = mysql_connect(“localhost”,“BLEEP”,“BLEEP”) or die(mysql_error());
mysql_select_db(“BLEEP”) or die(mysql_error());
$ID = mysql_real_escape_string(strip_tags(stripslashes($_GET[‘ID’])));
$getUser = mysql_query(“SELECT * FROM Users WHERE ID=’”.$ID."’");
$gU = mysql_fetch_object($getUser);
$gUU = mysql_num_rows($getUser);
$now = time();
if (!$ID) {
exit(“Please specify an ID!”);
}
if ($gUU < 1) {
echo “This user does not exist!”;
exit;
}
//Get Users Stuff
$Avatar = $gU->Body;
$Hat = $gU->Hat;
$Hair = $gU->Hair;
$Face = $gU->Face;
$Accessory = $gU->Accessory;
$Background = $gU->Background;
class StackImage
{
private $image;
private $width;
private $height;
public function __construct($Path)
{
if(!isset($Path) || !file_exists($Path))
return;
$this->image = imagecreatefrompng($Path);
imagesavealpha($this->image, true);
imagealphablending($this->image, true);
$this->width = imagesx($this->image);
$this->height = imagesy($this->image);
}
public function AddLayer($Path)
{
if(!isset($Path) || !file_exists($Path))
return;
$new = imagecreatefrompng($Path);
imagesavealpha($new, true);
imagealphablending($new, true);
imagecopy($this->image, $new, 0, 0, 0, 0, imagesx($new), imagesy($new));
}
public function Output($type = “image/png”)
{
header(“Content-Type: {$type}”);
imagepng($this->image);
imagedestroy($this->image);
}
public function GetWidth()
{
return $this->width;
}
public function GetHeight()
{
return $this->height;
}
}
$Image = new StackImage("/System/Items/".$Background."");
$Image->AddLayer(“System/Images/Avatar.png”);
$Image->AddLayer(“System/Items/”.$Face."");
$Image->AddLayer(“System/Items/”.$Accessory."");
$Image->AddLayer(“System/Items/”.$Hair."");
$Image->AddLayer(“System/Items/”.$Hat."");
$Image->Output();
include “System/Footer.php”;
This is the character creation mechanism on my site but whenever it is executed I just get a blank image. Please Help!