root/dev/common/awards.php @ 239

Revision 239, 4.7 KB (checked in by ralle030583, 15 years ago)

possible fix for problems with top navigation
and not shown entries for campaigns and contract cause
of probs with killboard::hasCampaign() / hasContract()

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);
51if (CORP_ID)
52    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
53if (ALLIANCE_ID)
54    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
55
56$tklist->generate();
57$tkbox = new AwardBox($tklist, "Top killers", "kills", "kills", "eagle");
58$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
59// top scorers
60if (config::get('kill_points'))
61{
62    $tklist = new TopScoreList();
63    $tklist->setMonth($month);
64    $tklist->setYear($year);
65    if (CORP_ID)
66        $tklist->addInvolvedCorp(new Corporation(CORP_ID));
67    if (ALLIANCE_ID)
68        $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
69
70    $tklist->generate();
71    $tkbox = new AwardBox($tklist, "Top scorers", "points", "points", "redcross");
72    $html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
73}
74// top solo killers
75$tklist = new TopSoloKillerList();
76$tklist->setMonth($month);
77$tklist->setYear($year);
78if (CORP_ID)
79    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
80if (ALLIANCE_ID)
81    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
82
83$tklist->generate();
84$tkbox = new AwardBox($tklist, "Top solokillers", "solo kills", "kills", "cross");
85$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
86// top damage dealers
87$tklist = new TopDamageDealerList();
88$tklist->setMonth($month);
89$tklist->setYear($year);
90if (CORP_ID)
91    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
92if (ALLIANCE_ID)
93    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
94
95$tklist->generate();
96$tkbox = new AwardBox($tklist, "Top damagedealers", "kills w/ most damage", "kills", "wing1");
97$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
98
99$html .= "</tr><tr>";
100// top final blows
101$tklist = new TopFinalBlowList();
102$tklist->setMonth($month);
103$tklist->setYear($year);
104if (CORP_ID)
105    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
106if (ALLIANCE_ID)
107    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
108
109$tklist->generate();
110$tkbox = new AwardBox($tklist, "Top finalblows", "final blows", "kills", "skull");
111$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
112// top podkillers
113$tklist = new TopPodKillerList();
114$tklist->setMonth($month);
115$tklist->setYear($year);
116if (CORP_ID)
117    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
118if (ALLIANCE_ID)
119    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
120
121$tklist->generate();
122$tkbox = new AwardBox($tklist, "Top podkillers", "podkills", "kills", "globe");
123$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
124// top griefers
125$tklist = new TopGrieferList();
126$tklist->setMonth($month);
127$tklist->setYear($year);
128if (CORP_ID)
129    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
130if (ALLIANCE_ID)
131    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
132
133$tklist->generate();
134$tkbox = new AwardBox($tklist, "Top griefers", "carebear kills", "kills", "star");
135$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
136// top capital killers
137$tklist = new TopCapitalShipKillerList();
138$tklist->setMonth($month);
139$tklist->setYear($year);
140if (CORP_ID)
141    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
142if (ALLIANCE_ID)
143    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
144
145$tklist->generate();
146$tkbox = new AwardBox($tklist, "Top ISK killers", "capital shipkills", "kills", "wing2");
147$html .= "<td valign=top align=center>".$tkbox->generate()."</td>";
148
149$html .= "</td></tr></table>";
150
151$menubox = new Box("Menu");
152$menubox->setIcon("menu-item.gif");
153$menubox->addOption("caption", "Navigation");
154$menubox->addOption("link", "Previous month ", "?a=awards&m=".$pmonth."&y=".$pyear);
155if (! ($month == kbdate("m") - 1 && $year == kbdate("Y")))
156    $menubox->addOption("link", "Next month", "?a=awards&m=".$nmonth."&y=".$nyear);
157$page->addContext($menubox->generate());
158
159$page->setContent($html);
160$page->generate();
161?>
Note: See TracBrowser for help on using the browser.