root/dev/common/about.php @ 59

Revision 59, 5.9 KB (checked in by exi, 14 years ago)

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)

Line 
1<?php
2require_once("db.php");
3require_once("class.page.php");
4require_once("class.ship.php");
5
6$page = new Page("About");
7
8$html .= "<div class=block-header2>Killboard</div>";
9$html .= KB_TITLE . ", a killboard for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances.<br><p>Based on EVE-Killboard created by <a href=\"mailto:rig0r@eve-killboard.net\">rig0r</a>. All EVE graphics used are &copy; <a href=\"http://www.ccpgames.com/\">CCP</a>.<br><br>";
10
11$qry = new DBQuery();
12$qry->execute("select count(*) as cnt from kb3_kills");
13$row = $qry->getRow();
14$kills = $row['cnt'];
15$qry->execute("select sum(itd_quantity) as cnt from kb3_items_destroyed");
16$row = $qry->getRow();
17$items = $row['cnt'];
18$qry->execute("select count(*) as cnt from kb3_pilots");
19$row = $qry->getRow();
20$pilots = $row['cnt'];
21$qry->execute("select count(*) as cnt from kb3_corps");
22$row = $qry->getRow();
23$corps = $row['cnt'];
24$qry->execute("select count(*) as cnt from kb3_alliances");
25$row = $qry->getRow();
26$alliances = $row['cnt'];
27// $html .= "<div class=block-header2>Killboard stats</div>";
28$html .= "The eve-killboard.net database currently stores <b>" . number_format($kills, 0, ',', '.') . "</b> killmails, <b>" . number_format($items, 0, ',', '.') . "</b> destroyed items, <b>" . number_format($pilots, 0, ',', '.') . "</b> pilots, <b>" . number_format($corps, 0, ',', '.') . "</b> corporations and <b>" . number_format($alliances, 0, ',', '.') . "</b> alliances.<br><br>";
29
30$html .= "<div class=block-header2>Portraits</div>";
31$html .= "If you would like your ingame character portrait to show up on the killboard, please visit the killboard using the ingame browser and select the 'Update portrait' option presented.<br>";
32$html .= "After trusting the site (press Yes when prompted), your character ID will be grabbed and recorded in the database.<br><br>";
33
34$html .= "<div class=block-header2>Kills & Real kills</div>";
35$html .= "Real kills are all recorded kills minus pod, shuttle and noobship kills. This value is used throughout all award and statistic pages you see on the killboard.<br><br>";
36
37$html .= "<div class=block-header2>Kill points</div>";
38$html .= "If enabled, every kill gets a certain amount of points assigned. The number of points says something about the difficulty of the kill. It is based on the shiptype destroyed, and the number and types of ships involved in the kill. As a result, a gank will get a lot less points awarded than a kill in a small engagement.<br><br>";
39
40$html .= "<div class=block-header2>Efficiency</div>";
41$html .= "Every shipclass has a value in ISK assigned. This is based on the average amount of ISK that would have been lost if  the ship was destroyed, taking current average market prices, insurance costs and insurance payouts into account. ";
42$html .= "Any modules that might have been fitted or cargo that might have been destroyed or confiscated is not included.<br><br>";
43$html .= "The efficiency is calculated as the ratio of damage done in ISK versus the damage received in ISK. This comes down to <i>damagedone / (damagedone + damagereceived ) * 100</i>.<br><br>";
44
45$html .= "<div class=block-header2>Ship values</div>";
46$html .= "The shipclasses and average ISK value are as follows:<br><br>";
47$sql = "select scl_id
48            from kb3_ship_classes
49           where scl_class not in ( 'Drone', 'Unknown' )
50          order by scl_value";
51
52$qry = new DBQuery();
53$qry->execute($sql);
54$html .= "<table class=kb-table cellspacing=1>";
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>";
56while ($row = $qry->getRow())
57{
58    $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=\"right\">".number_format($shipclass->getPoints(),0,',','.')."</td><td align=center><img class=ship src=\"" . $shipclass->getValueIndicator() . "\" border=\"0\"></td></tr>";
60}
61$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}
82
83if ($config->getConfig('ship_values'))
84{
85    $sql = 'select kbs.shp_id as id, shp.shp_name, kbs.shp_value,
86                 shp.shp_techlevel, scl.scl_class, scl.scl_points
87                 from kb3_ships_values kbs
88                 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)
90                 order by shp.shp_name asc';
91    $html .= "<br/>Custom shipvalues which override the value from shipclasses:<br><br>";
92    $qry = new DBQuery();
93    $qry->execute($sql);
94    $html .= "<table class=kb-table cellspacing=1>";
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>";
96    while ($row = $qry->getRow())
97    {
98        if ($row['shp_techlevel'] == 2)
99        {
100            $row['shp_name'] = '<img src="'.IMG_URL.'/ships/32_32/t2.gif">'.$row['shp_name'];
101        }
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>";
103    }
104    $html .= "</table>";
105}
106
107$page->setContent($html);
108$page->generate();
109?>
Note: See TracBrowser for help on using the browser.