root/dev/common/about.php @ 79

Revision 79, 6.2 KB (checked in by knifee, 16 years ago)

Update to show some more stats, from derosian.

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>The Killboard</div>";
9$html .= KB_TITLE . " killboard, created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances.<br><p>Developed by the <a href=\"http://www.eve-dev.net/\">EVE-Dev</a> group.<br><p>Based on the 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 .= "This killboard currently contains: <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 .= "In order to make your charater portrait visable on the killboard, please take the time to visit the killboard using the ingame browser and choose the option: 'Update portrait'.<br><br>";
32$html .= "When prompted to trust the site choose YES, at this point the killboard will obtain your character ID and record it within the database.<br><br>";
33
34$html .= "<div class=block-header2>Kills & Real kills</div>";
35$html .= "'Kills' -    The count of all kills by an entity. <br>'Real kills' - This is the count of recorded kills minus any pod, shuttle and noobship kills. <br><p> The 'Real kills' value is used throughout all award and statistic pages.<br><br>";
36
37$html .= "<div class=block-header2>Kill points</div>";
38$html .= "Administrator option.<br><br>";
39$html .= "If enabled, every kill is assigned a point value. Based on the shiptype destroyed, and the number and types of ships involved in the kill, the number of points indicates the difficulty of the kill... As a result, a gank will get a lot less points awarded than a kill in a small engagement.<br><br>";
40
41$html .= "<div class=block-header2>Efficiency</div>";
42$html .= "Each shipclass has an ISK value assigned. These are 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. ";
43$html .= "Any modules that may have been fitted, contained within the destroyed cargo or confiscated are not included within this value.<br><br>";
44$html .= "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>";
45
46$html .= "<div class=block-header2>Ship values</div>";
47$html .= "The shipclasses and average ISK value are as follows:<br><br>";
48$sql = "select scl_id
49            from kb3_ship_classes
50           where scl_class not in ( 'Drone', 'Unknown' )
51          order by scl_value";
52
53$qry = new DBQuery();
54$qry->execute($sql);
55$html .= "<table class=kb-table cellspacing=1>";
56$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>";
57while ($row = $qry->getRow())
58{
59    $shipclass = new ShipClass($row['scl_id']);
60    $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>";
61}
62$html .= "</table>";
63
64function getVictimShipValueIndicator($value)
65{
66    if ($value >= 0 && $value <= 1)
67        $color = "gray";
68    elseif ($value > 1 && $value <= 15)
69        $color = "blue";
70    elseif ($value > 15 && $value <= 25)
71        $color = "green";
72    elseif ($value > 25 && $value <= 40)
73        $color = "yellow";
74    elseif ($value > 40 && $value <= 80)
75        $color = "red";
76    elseif ($value > 80 && $value <= 250)
77        $color = "orange";
78    elseif ($value > 250 && $value <= 7000)
79        $color = "purple";
80
81    return IMG_URL . "/ships/ship-" . $color . ".gif";
82}
83
84if ($config->getConfig('ship_values'))
85{
86    $sql = 'select kbs.shp_id as id, shp.shp_name, kbs.shp_value,
87                 shp.shp_techlevel, scl.scl_class, scl.scl_points
88                 from kb3_ships_values kbs
89                 inner join kb3_ships shp on (kbs.shp_id = shp.shp_id)
90                 inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id)
91                 order by shp.shp_name asc';
92    $html .= "<br/>Custom shipvalues which override the value from shipclasses:<br><br>";
93    $qry = new DBQuery();
94    $qry->execute($sql);
95    $html .= "<table class=kb-table cellspacing=1>";
96    $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>";
97    while ($row = $qry->getRow())
98    {
99        if ($row['shp_techlevel'] == 2)
100        {
101            $row['shp_name'] = '<img src="'.IMG_URL.'/ships/32_32/t2.gif">'.$row['shp_name'];
102        }
103        $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>";
104    }
105    $html .= "</table>";
106}
107
108$page->setContent($html);
109$page->generate();
110?>
Note: See TracBrowser for help on using the browser.