root/dev/common/corpportrait.php @ 134

Revision 134, 0.7 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 = $_GET['id'];
5$size = $_GET['size'];
6
7$portrait = "cache/corps/".$id."_".$size.".jpg";
8
9if (file_exists($portrait))
10{
11    header("Content-Type: image/jpeg");
12    readfile($portrait);
13}
14else
15{
16    if (!file_exists("img/corps/".$id.".jpg"))
17    {
18        $id = 0;
19    }
20    $img = imagecreatefromjpeg("img/corps/".$id.".jpg");
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        imagejpeg($newimg, $portrait, 95);
28        header("Content-Type: image/jpeg");
29        readfile($portrait);
30    }
31}
32?>
Note: See TracBrowser for help on using the browser.