root/dev/common/alliance_thumb.php @ 134

Revision 134, 0.8 KB (checked in by exi, 14 years ago)

Added standings-management.
Changed installer step 3 to only use POST data now.
Character portraits should now look a bit better.
Changed all smarty template requests to use a wrapper function.
Modified standard page for IGB.
Added php compat file to reduce minimal needed version to 4.0.9.

Line 
1<?php
2require_once("db.php");
3
4$id = preg_replace('/[^a-zA-Z0-9]/', '', $_GET['id']);
5$size = $_GET['size'];
6
7$portrait = "cache/corps/all".$id."_".$size.".png";
8
9if (file_exists($portrait))
10{
11    header("Content-Type: image/png");
12    readfile($portrait);
13}
14else
15{
16    if (!file_exists("img/alliances/".$id.".png"))
17    {
18        $id = 'default';
19    }
20    $img = imagecreatefrompng("img/alliances/".$id.".png");
21    if ($img)
22    {
23        $newimg = imagecreatetruecolor($size, $size);
24        $oldx = imagesx($img);
25        $oldy = imagesy($img);
26        imagecopyresampled($newimg, $img, 0, 0, 0, 0, $size, $size, $oldx, $oldy);
27        imagepng($newimg, $portrait);
28        header("Content-Type: image/png");
29        readfile($portrait);
30    }
31}
32?>
Note: See TracBrowser for help on using the browser.