root/dev/common/losses.php @ 149

Revision 149, 2.8 KB (checked in by exi, 16 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.killlisttable.php");
8require_once("class.killsummarytable.php");
9require_once("class.toplist.php");
10
11$week = $_GET['w'];
12$year = $_GET['y'];
13
14if ($week == "")
15    $week = date("W");
16
17if ($year == "")
18    $year = date("Y");
19
20if ($week == 52)
21{
22    $nweek = 1;
23    $nyear = $year + 1;
24}
25else
26{
27    $nweek = $week + 1;
28    $nyear = $year;
29}
30if ($week == "1")
31{
32    $pweek = 52;
33    $pyear = $year - 1;
34}
35else
36{
37    $pweek = $week - 1;
38    $pyear = $year;
39}
40
41$page = new Page("Losses - Week ".$week);
42
43$klist = new KillList();
44$klist->setWeek($week);
45$klist->setYear($year);
46if (CORP_ID)
47    $klist->addInvolvedCorp(new Corporation(CORP_ID));
48if (ALLIANCE_ID)
49    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
50
51$lslist = new KillList();
52$lslist->setWeek($week);
53$lslist->setYear($year);
54if (CORP_ID)
55    $lslist->addVictimCorp(new Corporation(CORP_ID));
56if (ALLIANCE_ID)
57    $lslist->addVictimAlliance(new Alliance(ALLIANCE_ID));
58
59$summarytable = new KillSummaryTable($klist, $lslist);
60$summarytable->setBreak(6);
61$html .= $summarytable->generate();
62// $html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>";
63// if ( $week != date( "W" ) )
64// $html .= "[<a href=\"?a=losses&w=".$nweek."&y=".$nyear."\"><<</a>]";
65// $html .= "</td><td class=weeknav align=right>[<a href=\"?a=losses&w=".$pweek."&y=".$pyear."\">>></a>]</td></tr></table>";
66$llist = new KillList();
67$llist->setOrdered(true);
68$llist->setWeek($week);
69$llist->setYear($year);
70if (CORP_ID)
71    $llist->addVictimCorp(new Corporation(CORP_ID));
72if (ALLIANCE_ID)
73    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID));
74if ($_GET['scl_id'])
75    $llist->addVictimShipClass(new ShipClass($_GET['scl_id']));
76else
77    $llist->setPodsNoobShips(false);
78
79$table = new KillListTable($llist);
80$html .= $table->generate();
81
82$menubox = new box("Menu");
83$menubox->setIcon("menu-item.gif");
84$menubox->addOption("caption", "Navigation");
85$menubox->addOption("link", "Previous week", "?a=losses&w=".$pweek."&y=".$pyear);
86if ($week != date("W"))
87{
88    $menubox->addOption("link", "Next week", "?a=losses&w=".$nweek."&y=".$nyear);
89}
90$page->addContext($menubox->generate());
91
92$tllist = new TopLossesList();
93$tllist->setWeek($week);
94$tllist->setYear($year);
95if (CORP_ID)
96    $tllist->addVictimCorp(new Corporation(CORP_ID));
97if (ALLIANCE_ID)
98    $tllist->addVictimAlliance(new Alliance(ALLIANCE_ID));
99
100$tllist->generate();
101$tlbox = new AwardBox($tllist, "Top losers", "losses in week ".$week, "losses", "moon");
102$page->addContext($tlbox->generate());
103
104$page->setContent($html);
105$page->generate();
106?>
Note: See TracBrowser for help on using the browser.