RULES:
- Give an example (if you are not using it live).
- Either include a download link of the folder, or a copy of the code, and links to any special fonts used in the design
- Details of anything peculiar
Code: Select all
<?php
require_once('mods/rank_mod/rank.php');
define('MFONT', 'mods/signature_generator/signatures/0ps/evesansmm.ttf');
define('MFONT_NAME', 'mods/signature_generator/signatures/0ps/nasaliza.ttf');
define('MFONT_VICTIM', 'mods/signature_generator/signatures/0ps/nasaliza.ttf');
define('MFONTSML', 'mods/signature_generator/signatures/0ps/uni05_53.ttf');
define('FSIZESML', 6);
define('FSIZE', 11);
define('FSIZE_NAME', 16);
define('FSIZE_VICTIM', 12);
$im = imagecreatefromjpeg('mods/signature_generator/signatures/0ps/base.jpg');
$red = imagecolorallocate($im, 255, 10, 10);
$orange = imagecolorallocate($im, 150, 120, 20);
$blue = imagecolorallocate($im, 0, 0, 200);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
$blood = imagecolorallocate($im, 128, 10, 10);
$grey = imagecolorallocate($im, 128, 128, 128);
$yellow = imagecolorallocate($im, 255, 255, 0);
$green = imagecolorallocate($im, 0, 255, 0);
$dkgreen = imagecolorallocate($im, 0, 128, 0);
$grey_trans = imagecolorallocatealpha($im, 50, 50, 50, 50);
$grey_transblue = imagecolorallocatealpha($im, 50, 50, 110, 60);
$grey_transbluel = imagecolorallocatealpha($im, 50, 50, 110, 100);
$name = strtoupper($pilot->getName());
$corp = $corp->getName();
//GET RANKS + RIBBONS
//-------------------
$medals=array();
$shipbadges=array();
$weaponbadges=array();
$rank = GetPilotRank($pilot->GetID(), $killpoints, $medals, $shipbadges, $weaponbadges, $base_rps,$bonus_rps,$rps);
$rank_ttl =config::getnumerical('rankmod_titles');
$klist = new KillList();
$llist = new KillList();
$llist->addVictimPilot($pilot);
$llist->getAllKills();
$list = new KillList();
$list->setOrdered(true);
$list->setPodsNoobships(true);
$list->addInvolvedPilot($pilot);
$kill = $list->getKill();
$list->getallKills();
imagefttext($im, FSIZE_NAME, 0, 51, 25, $green, MFONT_NAME, $rank_ttl[$rank]['abbr'] ." ". $name.'...', array('hdpi'=>200));
$no = $list->getCount();
$string_field = 'KILL # ';
$string_no = '[ '.$no.' ]';
$string = 'CAREER POINTS ';
$string_pts = ''.$list->getPoints();
$string_linewhite = '---- DEFEATED ------------';
// FIELD TEXT
imagettftext($im, FSIZESML, 0, 52, 37, $grey_trans, MFONTSML, $string_field);
imagettftext($im, FSIZESML, 0, 52, 36, $white, MFONTSML, $string_field);
imagettftext($im, FSIZESML, 0, 81, 36, $dkgreen, MFONTSML, $string_no);
imagettftext($im, FSIZESML, 0, 82, 35, $dkgreen, MFONTSML, $string_no);
imagettftext($im, FSIZESML, 0, 82, 37, $dkgreen, MFONTSML, $string_no);
imagettftext($im, FSIZESML, 0, 83, 36, $dkgreen, MFONTSML, $string_no);
imagettftext($im, FSIZESML, 0, 82, 36, $white, MFONTSML, $string_no);
imagettftext($im, FSIZESML, 0, 120, 37, $grey_trans, MFONTSML, $string);
imagettftext($im, FSIZESML, 0, 120, 36, $white, MFONTSML, $string);
imagettftext($im, FSIZESML, 0, 194, 36, $blue, MFONTSML, $string_pts);
imagettftext($im, FSIZESML, 0, 195, 35, $blue, MFONTSML, $string_pts);
imagettftext($im, FSIZESML, 0, 195, 38, $blue, MFONTSML, $string_pts);
imagettftext($im, FSIZESML, 0, 196, 37, $blue, MFONTSML, $string_pts);
imagettftext($im, FSIZESML, 0, 195, 36, $white, MFONTSML, $string_pts);
$losses = $llist->getCount();
imagettftext($im, FSIZESML, 0, 230, 37, $grey_trans, MFONTSML, "LOSSES: ");
imagettftext($im, FSIZESML, 0, 230, 36, $white, MFONTSML, "LOSSES: ");
imagettftext($im, FSIZESML, 0, 273, 36, $red, MFONTSML, "$losses");
imagettftext($im, FSIZESML, 0, 275, 35, $red, MFONTSML, "$losses");
imagettftext($im, FSIZESML, 0, 275, 37, $red, MFONTSML, "$losses");
imagettftext($im, FSIZESML, 0, 276, 36, $red, MFONTSML, "$losses");
imagettftext($im, FSIZESML, 0, 275, 36, $white, MFONTSML, "$losses");
imagettftext($im, FSIZESML, 0, 52, 46, $white, MFONTSML, $string_linewhite);
imagefttext($im, FSIZE_VICTIM, 0, 51, 60, $red, MFONT_VICTIM, $kill->getVictimName(), array('hdpi'=>200));
$string_corpfield = 'Member of ';
$string_corpname = ''.$kill->getVictimCorpName();
$string_shipfield = 'Ship Destroyed: ';
$string_shiplost = ''.$kill->getVictimShipName();
$string_systemfield = 'Encounter System: ';
$string_system = ''.$kill->getSolarSystemName();
imagettftext($im, FSIZESML, 0, 52, 68, $grey_trans, MFONTSML, $string_corpfield);
imagettftext($im, FSIZESML, 0, 52, 69, $white, MFONTSML, $string_corpfield);
imagettftext($im, FSIZESML, 0, 100, 68, $grey_trans, MFONTSML, $string_corpname);
imagettftext($im, FSIZESML, 0, 100, 69, $white, MFONTSML, $string_corpname);
imagettftext($im, FSIZESML, 0, 52, 78, $grey_trans, MFONTSML, $string_shipfield);
imagettftext($im, FSIZESML, 0, 52, 79, $white, MFONTSML, $string_shipfield);
imagettftext($im, FSIZESML, 0, 130, 78, $grey_trans, MFONTSML, $string_shiplost);
imagettftext($im, FSIZESML, 0, 130, 79, $white, MFONTSML, $string_shiplost);
imagettftext($im, FSIZESML, 0, 52, 88, $grey_trans, MFONTSML, $string_systemfield);
imagettftext($im, FSIZESML, 0, 52, 89, $white, MFONTSML, $string_systemfield);
imagettftext($im, FSIZESML, 0, 150, 88, $grey_trans, MFONTSML, $string_system);
imagettftext($im, FSIZESML, 0, 150, 89, $white, MFONTSML, $string_system);
// player portrait
$pid = $pilot->row_['plt_externalid'];
if (!$pid)
{
$pid = 0;
}
$img = imagecreatefromjpeg("cache/portraits/".$pid."_128.jpg");
//imagefilledrectangle($im, 318, 18, 392, 92, $greyred_trans);
imagecopyresized($im, $img, 10, 10, 60, 30, 32, 80, 32, 80);
imagedestroy($img);
//Rank pic
$rankimg = imagecreatefrompng("img/".$rank_ttl[$rank]['imglink']);
imagecopyresized($im, $rankimg, 320, 30, 0, 0, 32 , 32, 32, 32);
imagedestroy($rankimg);
?>