root/dev/common/kills.php @ 149

Revision 149, 3.1 KB (checked in by exi, 14 years ago)

Changed custom ship values to also display unknown types.
Changed comment class to allow html code insertion.
Added pullout of externalids on killlists.
Fixed next week link.
Small change to the sql-inserter to remove the ';'.
Fixed the double http-link on rss feeds.
Fixed VictimAllianceURL on kill_details.
Fixed wrong links on standings page.

Line 
1<?php
2require_once("class.page.php");
3require_once("class.box.php");
4require_once("class.corp.php");
5require_once("class.alliance.php");
6require_once("class.killlist.php");
7require_once("class.ship.php");
8require_once("class.killlisttable.php");
9require_once("class.killsummarytable.php");
10require_once("class.toplist.php");
11
12$week = $_GET['w'];
13$year = $_GET['y'];
14
15if ($week == "")
16    $week = date("W");
17
18if ($year == "")
19    $year = date("Y");
20
21if ($week == 52)
22{
23    $nweek = 1;
24    $nyear = $year + 1;
25    $pyear = $year - 1;
26}
27else
28{
29    $nweek = $week + 1;
30    $nyear = $year;
31}
32if ($week == 1)
33{
34    $pweek = 52;
35    $pyear = $year - 1;
36}
37else
38{
39    $pweek = $week - 1;
40    $pyear = $year;
41}
42
43$page = new Page("Kills - Week ".$week);
44
45$kslist = new KillList();
46$kslist->setWeek($week);
47$kslist->setYear($year);
48if (CORP_ID)
49    $kslist->addInvolvedCorp(new Corporation(CORP_ID));
50if (ALLIANCE_ID)
51    $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
52
53$llist = new KillList();
54$llist->setWeek($week);
55$llist->setYear($year);
56if (CORP_ID)
57    $llist->addVictimCorp(new Corporation(CORP_ID));
58if (ALLIANCE_ID)
59    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID));
60
61$summarytable = new KillSummaryTable($kslist, $llist);
62$summarytable->setBreak(6);
63$html .= $summarytable->generate();
64
65$klist = new KillList();
66$klist->setOrdered(true);
67$klist->setWeek($week);
68$klist->setYear($year);
69if (CORP_ID)
70    $klist->addInvolvedCorp(new Corporation(CORP_ID));
71if (ALLIANCE_ID)
72    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
73if ($_GET['scl_id'])
74    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
75else
76    $klist->setPodsNoobShips(false);
77
78$table = new KillListTable($klist);
79$html .= $table->generate();
80
81$page->setContent($html);
82$menubox = new box("Menu");
83$menubox->setIcon("menu-item.gif");
84$menubox->addOption("caption", "Navigation");
85$menubox->addOption("link", "Previous week ", "?a=kills&w=".$pweek."&y=".$pyear);
86if ($week != date("W"))
87{
88    $menubox->addOption('link', "Next week", "?a=kills&w=".$nweek."&y=".$nyear);
89}
90$page->addContext($menubox->generate());
91
92$tklist = new TopKillsList();
93$tklist->setWeek($week);
94$tklist->setYear($year);
95if (CORP_ID)
96    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
97if (ALLIANCE_ID)
98    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
99
100$tklist->generate();
101$tkbox = new AwardBox($tklist, "Top killers", "kills in week ".$week, "kills", "eagle");
102$page->addContext($tkbox->generate());
103
104$killboard = $page->killboard_;
105$config = $killboard->getConfig();
106if ($config->getKillPoints())
107{
108    $tklist = new TopScoreList();
109    $tklist->setWeek($week);
110    $tklist->setYear($year);
111    if (CORP_ID)
112        $tklist->addInvolvedCorp(new Corporation(CORP_ID));
113    if (ALLIANCE_ID)
114        $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
115
116    $tklist->generate();
117    $tkbox = new AwardBox($tklist, "Top scorers", "points in week ".$week, "points", "redcross");
118    $page->addContext($tkbox->generate());
119}
120
121$page->generate();
122?>
Note: See TracBrowser for help on using the browser.