Example #1
0
// corp
$box = imagettfbbox(10, 0, MPATH . 'GUNSHIP2.TTF', $corp->getName());
$width = $box[4];
imagettftext($im, 10, 0, 319 - $width, 71, $black, MPATH . 'GUNSHIP2.TTF', $corp->getName());
imagettftext($im, 10, 0, 318 - $width, 70, $red, MPATH . 'GUNSHIP2.TTF', $corp->getName());
// player
$box = imagettfbbox(16, 0, MPATH . 'GUNSHIP2.TTF', $name);
$width = $box[4];
imagettftext($im, 16, 0, 319 - $width, 91, $black, MPATH . 'GUNSHIP2.TTF', $name);
imagettftext($im, 16, 0, 318 - $width, 90, $red, MPATH . 'GUNSHIP2.TTF', $name);
// time, victim, victim corp and ship killed
imagettftext($im, 11, 0, 39, 16, $black, MPATH . 'spaceage.ttf', $kill->getTimeStamp());
imagettftext($im, 11, 0, 38, 15, $white, MPATH . 'spaceage.ttf', $kill->getTimeStamp());
imagettftext($im, 11, 0, 39, 26, $black, MPATH . 'spaceage.ttf', $kill->getVictimName());
imagettftext($im, 11, 0, 38, 25, $white, MPATH . 'spaceage.ttf', $kill->getVictimName());
imagettftext($im, 11, 0, 39, 36, $black, MPATH . 'spaceage.ttf', $kill->getVictimCorpName());
imagettftext($im, 11, 0, 38, 35, $white, MPATH . 'spaceage.ttf', $kill->getVictimCorpName());
imagettftext($im, 11, 0, 6, 46, $black, MPATH . 'spaceage.ttf', $kill->getVictimShipName());
imagettftext($im, 11, 0, 5, 45, $white, MPATH . 'spaceage.ttf', $kill->getVictimShipName());
// ship
$sid = $kill->getVictimShipExternalID();
$img = shipImage::get($sid);
imagecopyresampled($im, $img, 5, 5, 0, 0, 30, 30, 64, 64);
// player portrait
if (!$pid) {
    $pid = 0;
}
$img = imagecreatefromjpeg(Pilot::getPortraitPath(256, $pid));
imagefilledrectangle($im, 318, 18, 392, 92, $greyred_trans);
imagecopyresampled($im, $img, 320, 20, 0, 0, 70, 70, 256, 256);
imagedestroy($img);
Example #2
0
// check for cached version
if (file_exists(CacheHandler::exists("{$plt_ext_id}_sig_{$id}.jpg", 'img'))) {
    // cache files for 120 minutes
    if (time() - CacheHandler::age("{$plt_ext_id}_sig_{$id}.jpg", 'img') < 120 * 60 || lastKill($plt_id) > 120 * 60) {
        if (isset($_SERVER['HTTP_IF_NONE_MATCH']) || isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
            header($_SERVER["SERVER_PROTOCOL"] . " 304 Not Modified");
            die;
        } else {
            header('Content-Type: image/jpeg');
            readfile(CacheHandler::get("{$plt_ext_id}_sig_{$id}.jpg", 'img'));
            die;
        }
    }
}
$pid = $pilot->getExternalID();
$cachePath = $pilot->getPortraitPath(256);
$thumb = new thumb($pid, 256);
if (!$thumb->isCached()) {
    $thumb->genCache();
}
// check template
if (!is_dir(dirname(__FILE__) . '/signatures/' . $sig_name)) {
    errorPic('Template not found.');
}
// let the template do the work, we just output $im
require dirname(__FILE__) . '/signatures/' . $sig_name . '/' . $sig_name . '.php';
if (headers_sent()) {
    trigger_error('An error occured. Headers have already been sent.<br/>', E_USER_ERROR);
}
if (ob_get_contents()) {
    trigger_error('An error occured. Content has already been sent.<br/>', E_USER_ERROR);