root/dev/common/about.php @ 370

Revision 370, 6.3 KB (checked in by kovell, 13 years ago)

- SQL queries optimised for speed and error protection.
- feed syndication optimised
- front page includes optional clock and optional kill/loss display
- mysqli support added
- transaction protection of kills added where supported (mysqli and InnoDB)
- summary tables and contracts show total destroyed value instead of ship value
- html errors reduced
- related kill calculation improved
- query caching errors reduced
- minor bugfixes
- Smarty 2.6.25 added
- apoc fitting mod added and modded
- code optimisations
- code comments added (doxygen format)
- conflicting mods are now identified

Line 
1<?php
2require_once('common/includes/class.ship.php');
3
4$page = new Page('About');
5
6// i store the names here for an easy edit
7$developer = array('exi (Lead Developer)',
8        'Beansman (Developer)',
9        'Ralle030583 (Developer)',
10        'Hon Kovell (Developer)');
11
12$contributor = array('JaredC01',
13        'liquidism',
14        'Mitchman',
15        'Coni',
16        'FriedRoadKill',
17        'bunjiboys',
18        'Karbowiak',
19        'EDG');
20sort($contributor);
21
22$html .= '<div class=block-header2>The Killboard</div>';
23
24// Please leave the information on the next line as is so that other people can easily find the EVE-Dev website.
25// Remember to share any modifications to the EVE-Dev Killboard.
26$html .= "This is the EVE Development Network Killboard running version ".KB_VERSION." ".KB_RELEASE." rev ".SVN_REV.", created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances. Based on the EVE-Killboard created by rig0r, it is now developed and maintained by the <a href=\"http://www.eve-dev.net/\">EVE-Dev</a> group.<br/>"
27        ."All EVE graphics and data used are property of <a href=\"http://www.ccpgames.com/\">CCP</a>.<br/><br/>";
28$html .= '<a href="http://www.eve-dev.net/" target="_blank"><img src="http://www.eve-dev.net/logo.png" border="0"/></a><br/><br/>';
29
30$html .= '<b>Staff:</b><br/>';
31$html .= join(', ', $developer);
32$html .= '<br/><br/><b>Contributors:</b><br/>';
33$html .= join(', ', $contributor);
34$html .= '<br/><br/>';
35
36$qry = new DBQuery();
37$qry->execute("select count(*) as cnt from kb3_kills");
38$row = $qry->getRow();
39$kills = $row['cnt'];
40$qry->execute("select sum(itd_quantity) as cnt from kb3_items_destroyed");
41$row = $qry->getRow();
42$items = $row['cnt'];
43$qry->execute("select count(*) as cnt from kb3_pilots");
44$row = $qry->getRow();
45$pilots = $row['cnt'];
46$qry->execute("select count(*) as cnt from kb3_corps");
47$row = $qry->getRow();
48$corps = $row['cnt'];
49$qry->execute("select count(*) as cnt from kb3_alliances");
50$row = $qry->getRow();
51$alliances = $row['cnt'];
52
53// $html .= "<div class=block-header2>Killboard stats</div>";
54$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>";
55
56$html .= "<div class=block-header2>Kills & Real kills</div>";
57$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>";
58
59$html .= "<div class=block-header2>Kill points</div>";
60$html .= "Administrator option.<br><br>";
61$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>";
62
63$html .= "<div class=block-header2>Efficiency</div>";
64$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. ";
65$html .= "Any modules that may have been fitted, contained within the destroyed cargo or confiscated are not included within this value.<br><br>";
66$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>";
67
68$html .= "<div class=block-header2>Ship values</div>";
69$html .= "The shipclasses and average ISK value are as follows:<br><br>";
70$sql = "select scl_id
71            from kb3_ship_classes
72           where scl_class not in ( 'Drone', 'Unknown' )
73          order by scl_value";
74
75$qry = new DBQuery();
76$qry->execute($sql);
77$html .= "<table class=kb-table cellspacing=1>";
78$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>";
79while ($row = $qry->getRow())
80{
81        $shipclass = new ShipClass($row['scl_id']);
82        $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>";
83}
84$html .= "</table>";
85
86function getVictimShipValueIndicator($value)
87{
88        if ($value >= 0 && $value <= 1)
89                $color = "gray";
90        elseif ($value > 1 && $value <= 15)
91                $color = "blue";
92        elseif ($value > 15 && $value <= 25)
93                $color = "green";
94        elseif ($value > 25 && $value <= 40)
95                $color = "yellow";
96        elseif ($value > 40 && $value <= 80)
97                $color = "red";
98        elseif ($value > 80 && $value <= 250)
99                $color = "orange";
100        elseif ($value > 250 && $value)
101                $color = "purple";
102
103        return IMG_URL . "/ships/ship-" . $color . ".gif";
104}
105
106if (config::get('ship_values'))
107{
108        $sql = 'select kbs.shp_id as id, shp.shp_name, kbs.shp_value,
109                 shp.shp_techlevel, scl.scl_class, scl.scl_points
110                 from kb3_ships_values kbs
111                 inner join kb3_ships shp on (kbs.shp_id = shp.shp_id)
112                 inner join kb3_ship_classes scl on (shp.shp_class = scl.scl_id)
113                 order by shp.shp_name asc';
114        $html .= "<br/>Custom shipvalues which override the value from shipclasses:<br><br>";
115        $qry = new DBQuery();
116        $qry->execute($sql);
117        $html .= "<table class=kb-table cellspacing=1>";
118        $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>";
119        while ($row = $qry->getRow())
120        {
121                if ($row['shp_techlevel'] == 2)
122                {
123                        $row['shp_name'] = '<img src="'.IMG_URL.'/items/32_32/t2.gif">'.$row['shp_name'];
124                }
125                $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>";
126        }
127        $html .= "</table>";
128}
129
130$page->setContent($html);
131$page->generate();
132?>
Note: See TracBrowser for help on using the browser.