Changeset 293

Show
Ignore:
Timestamp:
12/19/07 14:57:52 (13 years ago)
Author:
ralle030583
Message:

- fix for not showing dropped items when nothing

else was destroyed in killmail

Location:
dev
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dev/common/includes/globals.php

    r292 r293  
    11<?php 
    22// current subversion revision 
    3 preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 292 $', $match); 
     3preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 293 $', $match); 
    44define('SVN_REV', $match[1]); 
    55 
  • dev/common/kill_detail.php

    r292 r293  
    167167$smarty->assign('VictimShipImg', $ship->getImage(64)); 
    168168 
     169// preparing slot layout 
     170 
     171    $slot_array = array(); 
     172    $slot_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 
     173    $slot_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 
     174    $slot_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 
     175    $slot_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 
     176    $slot_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 
     177    $slot_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 
     178 
    169179// ship fitting 
    170180if (count($kill->destroyeditems_) > 0) 
    171181{ 
    172182    $dest_array = array(); 
    173     $dest_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 
    174     $dest_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 
    175     $dest_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 
    176     $dest_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 
    177     $dest_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 
    178     $dest_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 
    179  
    180183    foreach($kill->destroyeditems_ as $destroyed) 
    181184    { 
     
    187190            $formatted = $destroyed->getFormatttedValue(); 
    188191        } 
    189         $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $destroyed->getLocationID()); 
     192        $dest_array[$destroyed->getLocationID()][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $destroyed->getLocationID()); 
    190193    } 
    191194} 
     
    194197{ 
    195198    $drop_array = array(); 
    196     $drop_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 
    197     $drop_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 
    198     $drop_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 
    199     $drop_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 
    200     $drop_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 
    201     $drop_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 
    202  
    203199    foreach($kill->droppeditems_ as $dropped) 
    204200    { 
     
    210206            $formatted = $dropped->getFormatttedValue(); 
    211207        } 
    212         $drop_array[$dropped->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $dropped->getLocationID()); 
     208        $drop_array[$dropped->getLocationID()][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $dropped->getLocationID()); 
    213209    } 
    214210} 
     
    229225$dropvalue = number_format($dropvalue, 2); 
    230226 
    231  
    232227$smarty->assign_by_ref('destroyed', $dest_array); 
    233228$smarty->assign_by_ref('dropped', $drop_array); 
     229$smarty->assign_by_ref('slots', $slot_array); 
    234230$smarty->assign('ItemValue', $Formatted); 
    235231$smarty->assign('DropValue', $dropvalue); 
  • dev/templates/kill_detail.tpl

    r292 r293  
    6363            <div class="block-header">Ship details</div> 
    6464            <table class="kb-table" width="360" border="0" cellspacing="1"> 
    65 {foreach from=$destroyed item=slot key=slotindex} 
     65{foreach from=$slots item=slot key=slotindex} 
    6666{* set to true to show empty slots *} 
    67 {if $slot.items or $dropped.$slotindex.items} 
     67{if $destroyed.$slotindex or $dropped.$slotindex} 
    6868                <tr class="kb-table-row-even"> 
    6969                    <td class="item-icon" width="32"><img width="32" height="32" src="{$img_url}/{$slot.img}" alt="{$slot.text}" border="0"></td> 
     
    7373    {/if} 
    7474                </tr> 
    75     {foreach from=$slot.items item=i} 
     75    {foreach from=$destroyed.$slotindex item=i} 
    7676                <tr class="kb-table-row-odd"> 
    7777                    <td class="item-icon" width="32" height="34" valign="top"><a href="?a=invtype&id={$i.itemID}">{$i.Icon}</a></td> 
     
    111111                    </tr> 
    112112        {/if} 
    113     {foreachelse} 
    114                 <tr class="kb-table-row-odd"> 
    115                     <td colspan="4" valign="top">No Items lost</td> 
    116                 </tr> 
    117113    {/foreach} 
    118     {foreach from=$dropped.$slotindex.items item=i} 
     114    {foreach from=$dropped.$slotindex item=i} 
    119115                <tr class="kb-table-row-odd" style="background-color: green;"> 
    120116                    <td style="border: 1px solid green;" width="32" height="34" valign="top"><a href="?a=invtype&id={$i.itemID}">{$i.Icon}</a></td>