Changeset 244
- Timestamp:
- 10/20/07 17:11:00 (15 years ago)
- Location:
- branch/rev3
- Files:
-
- 14 added
- 2 removed
- 12 modified
Legend:
- Unmodified
- Added
- Removed
-
branch/rev3/common/about.php
r207 r244 22 22 // Please leave the information on the next line as is so that other people can easily find the EVE-Dev website. 23 23 // Remember to share any modifications to the EVE-Dev Killboard. 24 $html .= "This is the EVE Development Network Killboard running version ".KB_VERSION." rev ".SVN_REV.", created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances. Based on the EVE-Killboard created by <a href=\"mailto:rig0r@eve-killboard.net\">rig0r,</a>it is now developed and maintained by the <a href=\"http://www.eve-dev.net/\">EVE-Dev</a> group.<br/>"24 $html .= "This is the EVE Development Network Killboard running version ".KB_VERSION." rev ".SVN_REV.", created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances. Based on the EVE-Killboard created by rig0r, it is now developed and maintained by the <a href=\"http://www.eve-dev.net/\">EVE-Dev</a> group.<br/>" 25 25 ."All EVE graphics and data used are property of <a href=\"http://www.ccpgames.com/\">CCP</a>.<br/><br/>"; 26 26 $html .= '<a href="http://www.eve-dev.net/" target="_blank"><img src="http://www.eve-dev.net/e107_images/evedev_button.png" border="0"/></a><br/><br/>'; -
branch/rev3/common/admin/admin_mapoptions.php
r213 r244 1 1 <?php 2 require_once('common/includes/class.contract.php');3 2 require_once('common/includes/class.http.php'); 4 3 require_once('common/admin/admin_menu.php'); … … 12 11 config::checkCheckbox('map_map_showlines'); 13 12 config::checkCheckbox('map_reg_showlines'); 13 config::checkCheckbox('map_region_cache'); 14 14 config::checkCheckbox('map_con_showlines'); 15 15 config::checkCheckbox('map_con_shownames'); … … 76 76 77 77 $options[1]['name'] = 'Constellation Options'; 78 $options[1]['option'][] = array('descr' => 'Cache const maps', 'name' => 'map_region_cache'); 78 79 $options[1]['option'][] = array('descr' => 'Show Lines', 'name' => 'map_reg_showlines'); 79 80 $options[1]['option'][] = array('descr' => 'Paint Security', 'name' => 'map_reg_security'); -
branch/rev3/common/corp_detail.php
r239 r244 24 24 $html .= "<table class=kb-table width=\"100%\" border=\"0\" cellspacing=1><tr class=kb-table-row-even><td rowspan=8 width=128 align=center bgcolor=black>"; 25 25 26 if (file_exists("img/corps/".$corp->getID().".jpg") )26 if (file_exists("img/corps/".$corp->getID().".jpg") || file_exists("img/corps/".$corp->getUnique().".jpg")) 27 27 { 28 28 $html .= "<img src=\"".$corp->getPortraitURL(128)."\" border=\"0\"></td>"; … … 30 30 else 31 31 { 32 $html .= "<img src=\"" . IMG_URL ."/campaign-big.gif\" border=\"0\"></td>";32 $html .= "<img src=\"".IMG_URL."/campaign-big.gif\" border=\"0\"></td>"; 33 33 } 34 34 -
branch/rev3/common/includes/class.corp.php
r190 r244 1 1 <?php 2 require_once("db.php"); 3 require_once("class.alliance.php"); 2 require_once('class.alliance.php'); 4 3 5 4 class Corporation … … 20 19 } 21 20 21 function getUnique() 22 { 23 return preg_replace('/[^a-z0-9]/', '', strtolower($this->getName())); 24 } 25 22 26 function getPortraitURL($size = 64) 23 27 { 24 return '?a=thumb&type=corp&id='.$this->id_.'&size='.$size; 28 if ($this->isNPCCorp() || file_exists('img/corps/'.$this->getUnique().'.jpg')) 29 { 30 return '?a=thumb&type=corp&id='.$this->getUnique().'&size='.$size; 31 } 32 return '?a=thumb&type=corp&id='.$this->id_.'&size='.$size; 25 33 } 26 34 -
branch/rev3/common/includes/class.kill.php
r243 r244 15 15 $this->involvedparties_ = array(); 16 16 $this->destroyeditems_ = array(); 17 $this->droppeditems_ = array(); 18 } 19 20 function set($var, $value) 21 { 22 $this->$var = $value; 17 23 } 18 24 … … 324 330 fbplt.plt_name as fbplt_name, 325 331 fbcrp.crp_name as fbcrp_name, 326 fbali.all_name as fbali_name 332 fbali.all_name as fbali_name, 333 kll_dmgtaken 327 334 from kb3_kills kll, kb3_pilots plt, kb3_corps crp, 328 335 kb3_alliances ali, kb3_alliances fbali, kb3_corps fbcrp, … … 366 373 $this->plt_ext_ = $row['plt_externalid']; 367 374 $this->fbplt_ext_ = $row['fbplt_externalid']; 375 $this->VictimDamageTaken = $row['kll_dmgtaken']; 368 376 369 377 // involved 370 378 $sql = "select ind_plt_id, ind_crp_id, ind_all_id, ind_sec_status, 371 ind_shp_id, ind_wep_id 379 ind_shp_id, ind_wep_id, ind_dmgdone 372 380 from kb3_inv_detail 373 381 where ind_kll_id = ".$this->getID()." … … 383 391 new Ship($row['ind_shp_id']), 384 392 new Item($row['ind_wep_id'])); 393 $involved->dmgdone_ = $row['ind_dmgdone']; 385 394 array_push($this->involvedparties_, $involved); 386 395 } … … 413 422 array_push($this->destroyeditems_, $destroyed); 414 423 } 424 425 if (DB_USE_CCP) 426 { 427 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 428 itd_itl_id, itl_location 429 from kb3_items_dropped itd 430 left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 431 where itd.itd_kll_id = ".$this->getID()." 432 group by itd_itm_id, itd_itl_id 433 order by itd.itd_itl_id"; 434 $qry->execute($sql); 435 while ($row = $qry->getRow()) 436 { 437 $destroyed = new DroppedItem(new Item($row['itd_itm_id']), 438 $row['itd_quantity'], 439 $row['itl_location']); 440 array_push($this->droppeditems_, $destroyed); 441 } 442 } 415 443 } 416 444 } … … 676 704 { 677 705 $qid = $id; 706 } 707 if (!$this->dmgtaken) 708 { 709 $this->dmgtaken = 0; 678 710 } 679 711 … … 684 716 ".$this->victimcorpid_.", ".$this->victimship_->getID().", 685 717 ".$this->solarsystem_->getID().", ".$this->getFBAllianceID().", 686 ".$this->getFBCorpID().", ".$this->getFBPilotID().", ".$this->calculateKillPoints()." )";718 ".$this->getFBCorpID().", ".$this->getFBPilotID().", ".$this->calculateKillPoints().", ".$this->dmgtaken." )"; 687 719 $qry->execute($sql); 688 720 … … 711 743 } 712 744 745 if (!$inv->dmgdone_) 746 { 747 $inv->dmgdone_ = 0; 748 } 749 713 750 $sql = "insert into kb3_inv_detail 714 751 values ( ".$this->getID().", ".$inv->getPilotID().", '".$inv->getSecStatus()."', " 715 752 .$inv->getAllianceID().", ".$inv->getCorpID().", ".$ship->getID().", " 716 .$weapon->getID().", ".$order++." 753 .$weapon->getID().", ".$order++.", ".$inv->dmgdone_.")"; 717 754 $qry->execute($sql) or die($qry->getErrorMsg()); 718 755 … … 747 784 748 785 $sql = "insert into kb3_items_destroyed 786 values ( ".$this->getID().", ".$item->getID().", ".$dest->getQuantity().", " 787 .$loc_id." )"; 788 $qry->execute($sql); 789 } 790 791 // dropped 792 foreach ($this->droppeditems_ as $dest) 793 { 794 $item = $dest->getItem(); 795 $loc_id = $dest->getLocationID(); 796 if (!is_numeric($this->getID()) || !is_numeric($item->getID()) || !is_numeric($dest->getQuantity()) || !is_numeric($loc_id)) 797 { 798 trigger_error('error with dropped item.', E_USER_WARNING); 799 var_dump($dest);exit; 800 continue; 801 } 802 803 $sql = "insert into kb3_items_dropped 749 804 values ( ".$this->getID().", ".$item->getID().", ".$dest->getQuantity().", " 750 805 .$loc_id." )"; … … 771 826 $qry->execute("delete from kb3_inv_plt where inp_kll_id = ".$this->id_); 772 827 $qry->execute("delete from kb3_items_destroyed where itd_kll_id = ".$this->id_); 828 $qry->execute("delete from kb3_items_dropped where itd_kll_id = ".$this->id_); 773 829 if ($delcomments) 774 830 { … … 785 841 { 786 842 array_push($this->destroyeditems_, $destroyed); 843 } 844 845 function addDroppedItem($dropped) 846 { 847 array_push($this->droppeditems_, $dropped); 787 848 } 788 849 } … … 851 912 } 852 913 914 function getFormatttedValue() 915 { 916 if (!isset($this->value)) 917 { 918 $this->getValue(); 919 } 920 if ($this->value > 0) 921 { 922 $value = $this->value * $this->getQuantity(); 923 // Value Manipulation for prettyness. 924 if (strlen($value) > 6) // Is this value in the millions? 925 { 926 $formatted = round($value / 1000000, 2); 927 $formatted = number_format($formatted, 2); 928 $formatted = $formatted." M"; 929 } 930 elseif (strlen($value) > 3) // 1000's ? 931 { 932 $formatted = round($value / 1000, 2); 933 934 $formatted = number_format($formatted, 2); 935 $formatted = $formatted." K"; 936 } 937 else 938 { 939 $formatted = number_format($value, 2); 940 $formatted = $formatted." isk"; 941 } 942 } 943 else 944 { 945 $formatted = "0 isk"; 946 } 947 return $formatted; 948 } 949 853 950 function getValue() 854 951 { 952 if ($this->value) 953 { 954 return $this->value; 955 } 855 956 if (DB_USE_CCP) 856 957 { 958 $this->value = 0; 857 959 $qry = new DBQuery(); 858 960 $qry->execute("select basePrice, price from kb3_invtypes left join kb3_item_price using (typeID) where typeID='".$this->item_->getID()."'"); … … 861 963 if ($row['price']) 862 964 { 863 return$row['price'];965 $this->value = $row['price']; 864 966 } 865 return $row['basePrice']; 866 } 867 return 0; 967 else 968 { 969 $this->value = $row['basePrice']; 970 } 971 } 972 return $this->value; 868 973 } 869 974 … … 899 1004 } 900 1005 } 1006 1007 class DroppedItem extends DestroyedItem 1008 { 1009 function DroppedItem($item, $quantity, $location) 1010 { 1011 $this->item_ = $item; 1012 $this->quantity_ = $quantity; 1013 $this->location_ = $location; 1014 } 1015 } 901 1016 ?> -
branch/rev3/common/includes/class.map.php
r212 r244 139 139 and sjp.sjp_from = sys.sys_eve_id'; 140 140 141 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->regionid_.'_'.$this->imgwidth_.'.png';142 $cached = false;143 144 141 if ($this->mode_ == "map") 145 142 { 146 if (file_exists($regioncache)) 147 { 148 header("Content-type: image/png"); 149 readfile($regioncache); 150 return; 151 } 143 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->regionid_.'_'.$this->imgwidth_.'.png'; 152 144 $caption = $this->regname_; 153 145 } 154 155 if ($this->mode_ == "region")156 {146 elseif ($this->mode_ == "region") 147 { 148 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->conid_.'_'.$this->imgwidth_.'.png'; 157 149 $sql .= " and reg.reg_id = ".$this->regionid_; 158 150 $caption = $this->conname_; 159 151 } 160 161 if ($this->mode_ == "cons") 162 { 152 elseif ($this->mode_ == "cons") 153 { 154 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->systemid_.'_'.$this->imgwidth_.'.png'; 155 163 156 $sql .= " and con.con_id = ".$this->conid_; 164 157 $caption = $this->sysname_." (".roundsec($this->syssec_).")"; 165 158 } 166 167 if (!$cached) 159 if (file_exists($regioncache)) 160 { 161 header("Content-type: image/png"); 162 readfile($regioncache); 163 return; 164 } 165 166 if (true) 168 167 { 169 168 $qry = new DBQuery(); … … 357 356 358 357 imagestring($img, 1, 2, 2, $title, $captioncolor); 359 // imagettftext ( $img, 6, 0, 360 // 5, 361 // 10, 362 // $captioncolor, 363 // "../fonts/04B_03__.TTF", 364 // $title ); 365 if ($this->mode_ == "map" && !$cached) 358 if ($this->mode_ == "map") 359 { 360 imagepng($img, $regioncache); 361 } 362 // optionally cache constellation maps 363 elseif ($this->mode_ == 'region' && config::get('map_region_cache')) 364 { 365 imagepng($img, $regioncache); 366 } 367 // cache everything if we are reinforced 368 elseif (config::get('is_reinforced')) 366 369 { 367 370 imagepng($img, $regioncache); -
branch/rev3/common/includes/class.parser.php
r232 r244 96 96 { 97 97 $this->error('No security found.'); 98 } 99 $dmgtaken = false; 100 if (preg_match("/Damage Taken: (.*)/", $header, $matches)) 101 { 102 $dmgtaken = trim($matches[1]); 103 $this->dmgtaken = $dmgtaken; 98 104 } 99 105 … … 142 148 $kill->setVictimShip($ship); 143 149 $kill->setSolarSystem($system); 150 if ($dmgtaken) 151 { 152 $kill->set('dmgtaken', $dmgtaken); 153 } 144 154 145 155 if (ALLIANCE_ID != 0 && $alliance->getID() == ALLIANCE_ID) … … 206 216 $isname = "Unknown"; 207 217 $iwname = $pmatches[1]; 218 if ($dmgtaken) 219 { 220 preg_match("/Damage Done: (.*)/", $involved[++$i], $matches); 221 $idmgdone = $matches[1]; 222 } 208 223 209 224 if (!strlen($icname) && !strlen($iwname)) … … 252 267 $iwname = $matches[1]; 253 268 $i += 6; 269 if ($dmgtaken) 270 { 271 preg_match("/Damage Done: (.*)/", $involved[$i++], $matches); 272 $idmgdone = $matches[1]; 273 } 254 274 255 275 $ialliance = new Alliance(); … … 344 364 $iparty = new InvolvedParty($ipilot->getID(), $icorp->getID(), 345 365 $ialliance->getID(), $secstatus, $iship, $iweapon); 366 if ($dmgtaken) 367 { 368 $iparty->dmgdone_ = $idmgdone; 369 } 346 370 $kill->addInvolvedParty($iparty); 347 371 … … 359 383 if ($destroyedpos > 0) 360 384 { 361 $destroyed = explode("\n", trim(substr($this->killmail_, 362 strpos($this->killmail_, "Destroyed items:") + 16, 363 strlen($this->killmail_) - (strpos($this->killmail_, "Destroyed items:") + 16)))); 364 365 $i = 0; 366 $num = count($destroyed); 367 while ($i < $num) 368 { 369 $destroyed[$i] = trim($destroyed[$i]); 370 if ($destroyed[$i] == "") 371 { 372 $i++; 373 continue; 374 } 375 376 if ($destroyed[$i] == "Empty.") 377 { 378 $container = false; 379 $i++; 380 continue; 381 } 382 383 $qtypos = 0; 384 $locpos = 0; 385 $itemname = ""; 386 $quantity = ""; 387 $location = ""; 388 389 $qtypos = strpos($destroyed[$i], ", Qty: "); 390 $locpos = strrpos($destroyed[$i], "("); 391 392 if ($container && $locpos != false) 393 { 394 $container = false; 395 } 396 if (strpos($destroyed[$i], "Container")) 397 { 398 $container = true; 399 } 400 if ($qtypos <= 0 && !$locpos) 401 { 402 $itemlen = strlen($destroyed[$i]); 403 if ($container) $location = "Cargo"; 404 } 405 if ($qtypos > 0 && !$locpos) 406 { 407 $itemlen = $qtypos; 408 $qtylen = strlen($destroyed[$i]) - $qtypos; 409 if ($container) $location = "Cargo"; 410 } 411 if ($locpos > 0 && $qtypos <= 0) 412 { 413 $itemlen = $locpos - 1; 414 $qtylen = 0; 415 $loclen = strlen($destroyed[$i]) - $locpos - 2; 416 if (!$locpos) $container = false; 417 } 418 if ($locpos > 0 && $qtypos > 0) 419 { 420 $itemlen = $qtypos; 421 $qtylen = $locpos - $qtypos - 7; 422 $loclen = strlen($destroyed[$i]) - $locpos - 2; 423 if (!$locpos) $container = false; 424 } 425 426 $itemname = substr($destroyed[$i], 0, $itemlen); 427 if ($qtypos) $quantity = substr($destroyed[$i], $qtypos + 6, $qtylen); 428 if ($locpos) $location = substr($destroyed[$i], $locpos + 1, $loclen); 429 430 if ($quantity == "") 431 { 432 $quantity = 1; 433 } 434 435 $item = new Item(); 436 $item->lookup(trim($itemname)); 437 if (!$item->getID()) 438 { 439 $this->error('Item not found.', trim($itemname)); 440 } 441 $ditem = new DestroyedItem($item, $quantity, $location); 385 $endpos = strlen($this->killmail_) - $destroyedpos + 16; 386 if ($dmgtaken) 387 { 388 $endpos = strpos($this->killmail_, "Dropped items:") - $destroyedpos - 16; 389 } 390 391 $destroyed = explode("\n", trim(substr($this->killmail_, $destroyedpos + 16, $endpos))); 392 #var_dump($destroyed); exit; 393 $destroyed_items = $this->scanForItems($destroyed); 394 foreach ($destroyed_items as $item) 395 { 396 $ditem = new DestroyedItem($item['item'], $item['quantity'], $item['location']); 442 397 $kill->addDestroyedItem($ditem); 443 444 $i++; 445 } 446 } 398 } 399 } 400 if ($dmgtaken) 401 { 402 $startpos = strpos($this->killmail_, "Dropped items:"); 403 $endpos = strlen($this->killmail_) - $startpos + 16; 404 405 $dropped = explode("\n", trim(substr($this->killmail_, $startpos + 16, $endpos))); 406 #var_dump($dropped); exit; 407 408 $dropped_items = $this->scanForItems($dropped); 409 foreach ($dropped_items as $item) 410 { 411 $ditem = new DroppedItem($item['item'], $item['quantity'], $item['location']); 412 $kill->addDroppedItem($ditem); 413 } 414 } 415 447 416 448 417 if (!$authorized) … … 462 431 463 432 return $id; 433 } 434 435 function scanForItems($destroyed) 436 { 437 $i = 0; 438 $num = count($destroyed); 439 while ($i < $num) 440 { 441 $destroyed[$i] = trim($destroyed[$i]); 442 if ($destroyed[$i] == "") 443 { 444 $i++; 445 continue; 446 } 447 448 if ($destroyed[$i] == "Empty.") 449 { 450 $container = false; 451 $i++; 452 continue; 453 } 454 455 $qtypos = 0; 456 $locpos = 0; 457 $itemname = ""; 458 $quantity = ""; 459 $location = ""; 460 461 $qtypos = strpos($destroyed[$i], ", Qty: "); 462 $locpos = strrpos($destroyed[$i], "("); 463 464 if ($container && $locpos != false) 465 { 466 $container = false; 467 } 468 if (strpos($destroyed[$i], "Container")) 469 { 470 $container = true; 471 } 472 if ($qtypos <= 0 && !$locpos) 473 { 474 $itemlen = strlen($destroyed[$i]); 475 if ($container) $location = "Cargo"; 476 } 477 if ($qtypos > 0 && !$locpos) 478 { 479 $itemlen = $qtypos; 480 $qtylen = strlen($destroyed[$i]) - $qtypos; 481 if ($container) $location = "Cargo"; 482 } 483 if ($locpos > 0 && $qtypos <= 0) 484 { 485 $itemlen = $locpos - 1; 486 $qtylen = 0; 487 $loclen = strlen($destroyed[$i]) - $locpos - 2; 488 if (!$locpos) $container = false; 489 } 490 if ($locpos > 0 && $qtypos > 0) 491 { 492 $itemlen = $qtypos; 493 $qtylen = $locpos - $qtypos - 7; 494 $loclen = strlen($destroyed[$i]) - $locpos - 2; 495 if (!$locpos) $container = false; 496 } 497 498 $itemname = substr($destroyed[$i], 0, $itemlen); 499 if ($qtypos) $quantity = substr($destroyed[$i], $qtypos + 6, $qtylen); 500 if ($locpos) $location = substr($destroyed[$i], $locpos + 1, $loclen); 501 502 if ($quantity == "") 503 { 504 $quantity = 1; 505 } 506 507 $item = new Item(); 508 $item->lookup(trim($itemname)); 509 if (!$item->getID()) 510 { 511 $this->error('Item not found.', trim($itemname)); 512 } 513 if ($location == 'In Container') 514 { 515 $location = 'Cargo'; 516 } 517 518 $items[] = array('item' => $item, 'quantity' => $quantity, 'location' => $location); 519 $i++; 520 } 521 522 return $items; 464 523 } 465 524 -
branch/rev3/common/includes/class.pilot.php
r192 r244 1 1 <?php 2 require_once("db.php"); 3 require_once("class.corp.php"); 4 require_once("class.item.php"); 2 require_once('class.corp.php'); 3 require_once('class.item.php'); 5 4 6 5 class Pilot -
branch/rev3/common/includes/class.thumb.php
r238 r244 49 49 { 50 50 case 'corp': 51 $this->_id = intval($this->_id);51 $this->_id = preg_replace('/[^a-z0-9]/', '', $this->_id); 52 52 break; 53 53 case 'alliance': -
branch/rev3/common/includes/globals.php
r243 r244 13 13 14 14 // add new corporations here once you've added the logo to img/corps/ 15 $corp_npc = array("Guristas", 'Serpentis Corporation'); 15 $corp_npc = array('Guristas', 'Serpentis Corporation', 'Sansha\'s Nation', 'CONCORD', 16 'Mordus Legion', 'Blood Raider', 'Archangels', 'Guardian Angels'); 16 17 17 18 function shorten($shorten, $by = 22) -
branch/rev3/common/kill_detail.php
r243 r244 49 49 $smarty->assign('VictimAllianceURL', "?a=alliance_detail&all_id=".$kill->getVictimAllianceID()); 50 50 $smarty->assign('VictimAllianceName', $kill->getVictimAllianceName()); 51 $smarty->assign('VictimDamageTaken', $kill->VictimDamageTaken); 51 52 52 53 // involved … … 70 71 $involved[$i]['ShipName'] = $ship->getName(); 71 72 $involved[$i]['ShipID'] = $ship->externalid_; 73 $involved[$i]['damageDone'] = $inv->dmgdone_; 72 74 73 75 if ($pilot->getID() == $kill->getFBPilotID()) … … 143 145 { 144 146 $dest_array = array(); 145 $dest_array[1] = array('img' => 'fitted_-_high_slot.jpg', 'text' => 'Fitted - High slot', 'items' => array()); 146 $dest_array[2] = array('img' => 'fitted_-_medium_slot.jpg', 'text' => 'Fitted - Mid slot', 'items' => array()); 147 $dest_array[3] = array('img' => 'fitted_-_low_slot.jpg', 'text' => 'Fitted - Low slot', 'items' => array()); 148 $dest_array[6] = array('img' => 'drone_bay.jpg', 'text' => 'Drone bay', 'items' => array()); 149 $dest_array[4] = array('img' => 'cargo.jpg', 'text' => 'Cargo Bay', 'items' => array()); 147 $dest_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 148 $dest_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 149 $dest_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 150 $dest_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 151 $dest_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 152 $dest_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 150 153 151 154 foreach($kill->destroyeditems_ as $destroyed) … … 155 158 { 156 159 $value = $destroyed->getValue(); 157 $value_single = $value; 158 if ($value > 0) 159 { 160 $value = $destroyed->getValue() * $destroyed->getQuantity(); 161 $TotalValue = $TotalValue + $value; 162 // Value Manipulation for prettyness. 163 if (strlen($value) > 1) // 1000's ? 164 { 165 $Formatted = number_format($value, 2); 166 $Formatted = $Formatted." isk"; 167 } 168 169 if (strlen($value) > 3) // 1000's ? 170 { 171 $Formatted = round($value / 1000, 2); 172 173 $Formatted = number_format($Formatted, 2); 174 $Formatted = $Formatted." K"; 175 } 176 177 if (strlen($value) > 6) // Is this value in the millions? 178 { 179 $Formatted = round($value / 1000000, 2); 180 $Formatted = number_format($Formatted, 2); 181 $Formatted = $Formatted." M"; 182 } 183 } 184 else 185 { 186 $value = 0; 187 $Formatted = "0 isk"; 188 } 160 $TotalValue += $value*$destroyed->getQuantity(); 161 $formatted = $destroyed->getFormatttedValue(); 189 162 } 190 $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $Formatted, 'single_unit' => $value_single, 'itemID' => $item->getID()); 163 $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 164 } 165 } 166 167 if (count($kill->droppeditems_) > 0) 168 { 169 $drop_array = array(); 170 $drop_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 171 $drop_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 172 $drop_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 173 $drop_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 174 $drop_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 175 $drop_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 176 177 foreach($kill->droppeditems_ as $dropped) 178 { 179 $item = $dropped->getItem(); 180 if (config::get('item_values')) 181 { 182 $value = $dropped->getValue(); 183 $dropvalue += $value*$dropped->getQuantity(); 184 $formatted = $dropped->getFormatttedValue(); 185 } 186 $drop_array[$dropped->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 191 187 } 192 188 } … … 201 197 $TotalLoss = number_format($TotalValue + $ShipValue, 2); 202 198 $ShipValue = number_format($ShipValue, 2); 199 $dropvalue = number_format($dropvalue, 2); 203 200 204 201 $smarty->assign_by_ref('destroyed', $dest_array); 202 $smarty->assign_by_ref('dropped', $drop_array); 205 203 $smarty->assign('ItemValue', $Formatted); 204 $smarty->assign('DropValue', $dropvalue); 206 205 $smarty->assign('ShipValue', $ShipValue); 207 206 $smarty->assign('TotalLoss', $TotalLoss); -
branch/rev3/templates/kill_detail.tpl
r243 r244 4 4 <td width=360 align=left valign=top><table class=kb-table width=360 cellpadding=0 cellspacing=1 border=0> 5 5 <tr class= {cycle name=ccl}> 6 <td rowspan= 3width="64"><img src="{$VictimPortrait}" border="0" width="64" heigth="64"></td>6 <td rowspan=4 width="64"><img src="{$VictimPortrait}" border="0" width="64" heigth="64"></td> 7 7 <td class=kb-table-cell width=64><b>Victim:</b></td> 8 8 <td class=kb-table-cell><b><a href="{$VictimURL}">{$VictimName}</a></b></td> … … 15 15 <td class=kb-table-cell width=64><b>Alliance:</b></td> 16 16 <td class=kb-table-cell><b><a href="{$VictimAllianceURL}">{$VictimAllianceName}</a></b></td> 17 </tr> 18 <tr class={cycle name=ccl}> 19 <td class=kb-table-cell width=64><b>Damage taken:</b></td> 20 <td class=kb-table-cell><b>{$VictimDamageTaken}</b></td> 17 21 </tr> 18 22 </table> … … 36 40 <tr class={cycle name=ccl}> 37 41 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">{if $i.weaponID}<a href="?a=invtype&id={$i.weaponID}">{$i.weaponName}</a>{else}{$i.weaponName}{/if}</td> 42 </tr> 43 <tr class={cycle name=ccl}> 44 <td colspan=2 class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">Damage done:</td><td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">{$i.damageDone}</td> 38 45 </tr> 39 46 {/foreach} … … 60 67 <div class="block-header">Ship details</div> 61 68 <table class="kb-table" width="360" border="0" cellspacing="1"> 62 {foreach from=$destroyed item=slot }69 {foreach from=$destroyed item=slot key=slotindex} 63 70 {* set to true to show empty slots *} 64 {if $slot.items }71 {if $slot.items or $dropped.slotindex.items} 65 72 <tr class="kb-table-row-even"> 66 73 <td class="item-icon" width="32"><img src="{$img_url}/{$slot.img}" alt="{$slot.text}" border="0"></td> … … 72 79 {foreach from=$slot.items item=i} 73 80 <tr class="kb-table-row-odd"> 74 <td class="item-icon" width="32" height="34" valign="top"> {$i.Icon}</td>75 <td class="kb-table-cell"> <a href="?a=invtype&id={$i.itemID}">{$i.Name}</a></td>81 <td class="item-icon" width="32" height="34" valign="top"><a href="?a=invtype&id={$i.itemID}">{$i.Icon}</a></td> 82 <td class="kb-table-cell">{$i.Name}</td> 76 83 <td width="30" align="center">{$i.Quantity}</td> 77 84 {if $config->get('item_values')} … … 97 104 </tr> 98 105 {/foreach} 106 {foreach from=$dropped.$slotindex.items item=i} 107 <tr class="kb-table-row-odd" style="background-color: green;"> 108 <td style="border: 1px solid green;" width="32" height="34" valign="top"><a href="?a=invtype&id={$i.itemID}">{$i.Icon}</a></td> 109 <td class="kb-table-cell">{$i.Name}</td> 110 <td width="30" align="center">{$i.Quantity}</td> 111 {if $config->get('item_values')} 112 <td align="center">{$i.Value}</td> 113 {/if} 114 </tr> 115 {if $admin and $config->get('item_values')} 116 <tr class="kb-table-row-even"> 117 <form method="post" action=""> 118 <td height="34" colspan="3" valign="top"> 119 <div align="right"> 120 Current single Item Value: 121 <input name="IID" value="{$i.itemID}" type="hidden"> 122 <input name="{$i.itemID}" type="text" class="comment-button" value="{$i.single_unit}" size="6"> 123 </div> 124 <td height="34" valign="top"><input type="submit" name="submit" value="Update" class="comment-button"></td> 125 </form> 126 </tr> 127 {/if} 128 {/foreach} 99 129 {/if} 100 130 {/foreach} … … 103 133 <td colspan="3"><div align="right"><strong>Total Module Loss:</strong></div></td> 104 134 <td align="right">{$ItemValue}</td> 135 </tr> 136 <tr class={cycle name=ccl}> 137 <td colspan="3"><div align="right"><strong>Total Module Drop:</strong></div></td> 138 <td align="right">{$DropValue}</td> 105 139 </tr> 106 140 <tr class={cycle name=ccl}>