return true; }), new ModulePage("starter", function ($path) { $CurrentUser = User::GetCurrent(); if ($path[0] == "packs") { $pack_id = $path[1]; $pack = MarketStarterPack::GetByID($pack_id); if ($path[2] == "images") { if ($path[3] == "thumbnail.png") { $filenames = array("images/avatar/base.png"); $items = $pack->GetItems(); foreach ($items as $item) { foreach ($item->Images as $image) { $filenames[] = "images/avatar/items/" . $image->ID . ".png"; } } $image = imagelayerfiles($filenames); imagesavealpha($image, true); imagealphablending($image, true); header('Content-Type: image/png'); imagepng($image); return; } } } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (!is_numeric($_POST["starterpack_id"])) { $page = new ErrorPage(); $page->Message = "The Starter Pack could not be applied. <code>starterpack_id</code> must be a number."; $page->ReturnButtonURL = "~/market/starter"; $page->ReturnButtonText = "Return to Starter Packs"; $page->Render();
} $item_image_resampled = imagecreatetruecolor($item_image_width, $item_image_height); imagemaketransparent($item_image_resampled); imagecopyresampled($item_image_resampled, $item_image, $image_left, $image_top, 0, 0, $image_width, $image_height, $item_image_width, $item_image_height); $item_images[] = $item_image_resampled; } $final_image = imagelayerimages($item_images); header('Content-Type: image/png'); imagepng($final_image); return; case "item.png": $array = array(); foreach ($item->Images as $image) { $array[] = "images/avatar/items/" . $image->ID . ".png"; } $image = imagelayerfiles($array); header('Content-Type: image/png'); imagepng($image); return; } return; } System::Redirect("~/market/items/" . $path[0]); return; } require "Detail.inc.php"; return; } else { require "Browse.inc.php"; return; }