root/dev/mods/rank_mod/awards.php @ 491

Revision 370, 4.1 KB (checked in by kovell, 11 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.toplist.php');
3
4$page = new Page('Awards');
5
6$month = $_GET['m'];
7$year = $_GET['y'];
8
9if ($month == '')
10    $month = kbdate('m') - 1;
11
12if ($year == '')
13    $year = kbdate('Y');
14
15if ($month == 0)
16{
17    $month = 12;
18    $year = $year - 1;
19}
20
21if ($month == 12)
22{
23    $nmonth = 1;
24    $nyear = $year + 1;
25}
26else
27{
28    $nmonth = $month + 1;
29    $nyear = $year;
30}
31if ($month == 1)
32{
33    $pmonth = 12;
34    $pyear = $year - 1;
35}
36else
37{
38    $pmonth = $month - 1;
39    $pyear = $year;
40}
41
42$monthname = kbdate("F", strtotime("2000-".$month."-2"));
43
44$html .= "<div class=block-header2>Awards for ".$monthname." ".$year."</div>";
45// main table
46$html .= "<table height=600 width=\"100%\"><tr>";
47// top killers
48$tklist = new TopKillsList();
49$tklist->setMonth($month);
50$tklist->setYear($year);
51involved::load($tklist,'kill');
52$tklist->generate();
53$tkbox = new AwardBox($tklist, "Top killers", "kills", "kills", "eagle");
54$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
55
56// top scorers
57if (config::get('kill_points'))
58{
59    $tklist = new TopScoreList();
60    $tklist->setMonth($month);
61    $tklist->setYear($year);
62    involved::load($tklist,'kill');
63    $tklist->generate();
64    $tkbox = new AwardBox($tklist, "Top scorers", "points", "points", "redcross");
65    $html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
66}
67
68// top solo killers
69$tklist = new TopSoloKillerList();
70$tklist->setMonth($month);
71$tklist->setYear($year);
72involved::load($tklist,'kill');
73$tklist->generate();
74$tkbox = new AwardBox($tklist, "Top solokillers", "solo kills", "kills", "cross");
75$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
76
77$html .= "</tr><tr>";
78
79// top damage dealers
80$tklist = new TopDamageDealerList();
81$tklist->setMonth($month);
82$tklist->setYear($year);
83involved::load($tklist,'kill');
84$tklist->generate();
85$tkbox = new AwardBox($tklist, "Top damagedealers", "kills w/ most damage", "kills", "wing1");
86$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
87
88// top final blows
89$tklist = new TopFinalBlowList();
90$tklist->setMonth($month);
91$tklist->setYear($year);
92involved::load($tklist,'kill');
93$tklist->generate();
94$tkbox = new AwardBox($tklist, "Top finalblows", "final blows", "kills", "skull");
95$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
96
97// top podkillers
98$tklist = new TopPodKillerList();
99$tklist->setMonth($month);
100$tklist->setYear($year);
101involved::load($tklist,'kill');
102$tklist->generate();
103$tkbox = new AwardBox($tklist, "Top podkillers", "podkills", "kills", "globe");
104$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
105
106$html .= "</tr><tr>";
107
108// top griefers
109$tklist = new TopGrieferList();
110$tklist->setMonth($month);
111$tklist->setYear($year);
112involved::load($tklist,'kill');
113$tklist->generate();
114$tkbox = new AwardBox($tklist, "Top griefers", "carebear kills", "kills", "star");
115$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
116
117// top capital killers
118$tklist = new TopCapitalShipKillerList();
119$tklist->setMonth($month);
120$tklist->setYear($year);
121involved::load($tklist,'kill');
122$tklist->generate();
123$tkbox = new AwardBox($tklist, "Top ISK killers", "capital shipkills", "kills", "wing2");
124$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
125
126// top losers
127$tklist = new TopLossesList();
128$tklist->setMonth($month);
129$tklist->setYear($year);
130involved::load($tklist,'loss');
131$tklist->generate();
132$tkbox = new AwardBox($tklist, "Top Losers", "ship lost", "kills", "moon");
133$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
134
135$html .= "</td></tr></table>";
136
137$menubox = new Box("Menu");
138$menubox->setIcon("menu-item.gif");
139$menubox->addOption("caption", "Navigation");
140$menubox->addOption("link", "Previous month ", "?a=awards&m=".$pmonth."&y=".$pyear);
141if (! ($month == kbdate("m") - 1 && $year == kbdate("Y")))
142    $menubox->addOption("link", "Next month", "?a=awards&m=".$nmonth."&y=".$nyear);
143$page->addContext($menubox->generate());
144
145$page->setContent($html);
146$page->generate();
147?>
Note: See TracBrowser for help on using the browser.