| 490 | if ($set == 'prermr') |
| 491 | { |
| 492 | $search = array('Corporation:','Destroyed Type:','Solar System:', 'System Security Level:', 'Security Status:', 'Ship Type:', 'Weapon Type:', '(Fitted - Medium slot)', '(Fitted - Low slot)', '(Fitted - High slot)'); |
| 493 | $replace = array('Corp:','Destroyed:', 'System:', 'Security:', 'Security:', 'Ship:', 'Weapon:', '', '', ''); |
| 494 | $this->killmail_ = str_replace($search, $replace, $this->killmail_); |
| 495 | $position = strpos($this->killmail_, 'Destroyed items:'); |
| 496 | if ($position !== false) |
| 497 | { |
| 498 | $destroyed = explode("\n", strstr($this->killmail_, 'Destroyed items:')); |
| 499 | $i = 0; |
| 500 | $num = count($destroyed); |
| 501 | while ($i < $num) |
| 502 | { |
| 503 | $destroyed[$i] = trim($destroyed[$i]); |
| 504 | |
| 505 | $itempos = strpos($destroyed[$i], 'Type: '); |
| 506 | if ($itempos !== false) |
| 507 | { |
| 508 | $destroyed[$i] = substr($destroyed[$i], $itempos+6); |
| 509 | if (isset($destroyed[$i+1])) |
| 510 | { |
| 511 | $quantitypos = strstr($destroyed[$i+1], 'Quantity: '); |
| 512 | if ($quantitypos !== false) |
| 513 | { |
| 514 | $qty = ', Qty: '.substr($destroyed[$i+1], $quantitypos+10); |
| 515 | $pos = strpos($destroyed[$i], '('); |
| 516 | if ($pos !== false) |
| 517 | { |
| 518 | $destroyed[$i] = trim(substr($destroyed[$i], 0, $pos)).$qty.' '.substr($destroyed[$i], $pos); |
| 519 | } |
| 520 | else |
| 521 | { |
| 522 | $destroyed[$i] .= $qty; |
| 523 | } |
| 524 | unset($destroyed[$i+1]); |
| 525 | $i++; |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | else |
| 530 | { |
| 531 | unset($destroyed[$i]); |
| 532 | } |
| 533 | $i++; |
| 534 | } |
| 535 | $this->killmail_ = substr($this->killmail_, 0, $position).'Destroyed items: '."\n\n\n".join("\n", $destroyed)."\n"; |
| 536 | } |
| 537 | } |