Changeset 59 for dev/common/about.php

Show
Ignore:
Timestamp:
11/07/06 04:44:47 (14 years ago)
Author:
exi
Message:

Changed the custom shipsvalue table to show more information
Added admin option for the mailhost for post-ccs ( http://trac.eve-dev.net/ticket/9)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/about.php

    r48 r59  
    5353$qry->execute($sql); 
    5454$html .= "<table class=kb-table cellspacing=1>"; 
    55 $html .= "<tr class=kb-table-header><td width=110>Ship class</td><td>Value in ISK</td><td align=center>Indicator</td></tr>"; 
     55$html .= "<tr class=kb-table-header><td width=160>Ship class</td><td>Value in ISK</td><td>Points</td><td align=center>Indicator</td></tr>"; 
    5656while ($row = $qry->getRow()) 
    5757{ 
    5858    $shipclass = new ShipClass($row['scl_id']); 
    59     $html .= "<tr class=kb-table-row-odd><td>" . $shipclass->getName() . "</td><td align=\"right\">".number_format($shipclass->getValue()*1000000,0,',','.')."</td><td align=center><img class=ship src=\"" . $shipclass->getValueIndicator() . "\" border=\"0\"></td></tr>"; 
     59    $html .= "<tr class=kb-table-row-odd><td>".$shipclass->getName()."</td><td align=\"right\">".number_format($shipclass->getValue()*1000000,0,',','.')."</td><td align=\"right\">".number_format($shipclass->getPoints(),0,',','.')."</td><td align=center><img class=ship src=\"" . $shipclass->getValueIndicator() . "\" border=\"0\"></td></tr>"; 
    6060} 
    6161$html .= "</table>"; 
     62 
     63function getVictimShipValueIndicator($value) 
     64{ 
     65    if ($value >= 0 && $value <= 1) 
     66        $color = "gray"; 
     67    elseif ($value > 1 && $value <= 15) 
     68        $color = "blue"; 
     69    elseif ($value > 15 && $value <= 25) 
     70        $color = "green"; 
     71    elseif ($value > 25 && $value <= 40) 
     72        $color = "yellow"; 
     73    elseif ($value > 40 && $value <= 80) 
     74        $color = "red"; 
     75    elseif ($value > 80 && $value <= 250) 
     76        $color = "orange"; 
     77    elseif ($value > 250 && $value <= 7000) 
     78        $color = "purple"; 
     79 
     80    return IMG_URL . "/ships/ship-" . $color . ".gif"; 
     81} 
    6282 
    6383if ($config->getConfig('ship_values')) 
    6484{ 
    6585    $sql = 'select kbs.shp_id as id, shp.shp_name, kbs.shp_value, 
    66                  shp.shp_techlevel 
     86                 shp.shp_techlevel, scl.scl_class, scl.scl_points 
    6787                 from kb3_ships_values kbs 
    6888                 inner join kb3_ships shp on (kbs.shp_id = shp.shp_id) 
     89                 inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id) 
    6990                 order by shp.shp_name asc'; 
    7091    $html .= "<br/>Custom shipvalues which override the value from shipclasses:<br><br>"; 
     
    7293    $qry->execute($sql); 
    7394    $html .= "<table class=kb-table cellspacing=1>"; 
    74     $html .= "<tr class=kb-table-header><td width=110>Ship Name</td><td>Value in ISK</td></tr>"; 
     95    $html .= "<tr class=kb-table-header><td width=160>Ship Name</td><td>Ship Class</td><td>Points</td><td align=\"right\">Value in ISK</td></tr>"; 
    7596    while ($row = $qry->getRow()) 
    7697    { 
     
    79100            $row['shp_name'] = '<img src="'.IMG_URL.'/ships/32_32/t2.gif">'.$row['shp_name']; 
    80101        } 
    81         $html .= "<tr class=kb-table-row-odd><td>".$row['shp_name']."</td><td align=\"right\">".number_format($row['shp_value'],0,',','.')."</td></tr>"; 
     102        $html .= "<tr class=kb-table-row-odd><td>".$row['shp_name']."&nbsp;</td><td>".$row['scl_class']."&nbsp;</td><td align=\"right\">".number_format($row['scl_points'],0,',','.')."</td><td align=\"right\">&nbsp;".number_format($row['shp_value'],0,',','.')."&nbsp;<img src=\"".getVictimShipValueIndicator($row['shp_value']/1000000)."\"></td></tr>"; 
    82103    } 
    83104    $html .= "</table>";