root/dev/common/awards.php @ 195

Revision 190, 4.8 KB (checked in by exi, 15 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

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