root/dev/mods/example_mod/home.php @ 233

Revision 233, 3.5 KB (checked in by ralle030583, 14 years ago)

- changed summarytable format to 5 rows each cause of cap. industrial
- bugfix in autoupgrade of navigation table (Kills were linked to Home :-/)
- added chk_cap_industrial to autoupgrade
- added Capital Industrial to sql install files

Line 
1<?php
2require_once("common/includes/class.killsummarytable.php");
3require_once("common/includes/class.box.php");
4require_once("common/includes/class.corp.php");
5require_once("common/includes/class.alliance.php");
6require_once("common/includes/class.killlist.php");
7require_once("common/includes/class.killlisttable.php");
8require_once("common/includes/class.contract.php");
9require_once("common/includes/class.graph.php");
10require_once("common/includes/class.toplist.php");
11
12$week = date("W");
13$year = date("Y");
14
15$page = new Page("omgwtfpwnd!!!1");
16
17$kslist = new KillList();
18if (CORP_ID)
19    $kslist->addInvolvedCorp(new Corporation(CORP_ID));
20if (ALLIANCE_ID)
21    $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
22
23$kslist->setWeek($week);
24$kslist->setYear($year);
25
26$llist = new KillList();
27if (CORP_ID)
28    $llist->addVictimCorp(new Corporation(CORP_ID));
29if (ALLIANCE_ID)
30    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID));
31
32$llist->setWeek($week);
33$llist->setYear($year);
34
35$summarytable = new KillSummaryTable($kslist, $llist);
36$summarytable->setBreak(5);
37//$html .= $summarytable->generate();
38
39if ($week == 1)
40{
41    $pyear = date("Y") - 1;
42    $pweek = 52;
43}
44else
45{
46    $pyear = date("Y");
47    $pweek = $week - 1;
48}
49
50if ($page->killboard_->hasCampaigns(true))
51{
52    $html .= "<div class=kb-campaigns-header>Active campaigns</div>";
53    $list = new ContractList();
54    $list->setActive("yes");
55    $list->setCampaigns(true);
56    $table = new ContractListTable($list);
57    $html .= $table->generate();
58}
59
60if ($page->killboard_->hasContracts(true))
61{
62    $html .= "<div class=kb-campaigns-header>Active contracts</div>";
63    $list = new ContractList();
64    $list->setActive("yes");
65    $list->setCampaigns(false);
66    $table = new ContractListTable($list);
67    $html .= $table->generate();
68}
69
70$html .= "<div class=kb-kills-header>20 most recent pwns</div>";
71
72$klist = new KillList();
73$klist->setOrdered(true);
74if (CORP_ID)
75    $klist->addInvolvedCorp(new Corporation(CORP_ID));
76if (ALLIANCE_ID)
77    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
78
79// boards with low killcount could not display 20 kills with those limits
80//$klist->setStartWeek($week - 1);
81//$klist->setYear($year);
82
83if ($_GET['scl_id'])
84    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
85else
86    $klist->setPodsNoobShips(false);
87
88$table = new KillListTable($klist);
89$table->setLimit(20);
90$html .= $table->generate();
91
92$page->setContent($html);
93$menubox = new MenuBox();
94$menubox->addCaption("Navigation");
95$menubox->addOption("Previous week", "?a=kills&w=" . $pweek . "&y=" . $pyear);
96$page->addContext($menubox->generate());
97
98$tklist = new TopKillsList();
99$tklist->setWeek($week);
100$tklist->setYear($year);
101if (CORP_ID)
102    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
103if (ALLIANCE_ID)
104    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
105
106$tklist->generate();
107$tkbox = new AwardBox($tklist, "Top killers", "kills in week " . $week, "kills", "eagle");
108$page->addContext($tkbox->generate());
109
110if (config::get('kill_points'))
111{
112    $tklist = new TopScoreList();
113    $tklist->setWeek($week);
114    $tklist->setYear($year);
115    if (CORP_ID)
116        $tklist->addInvolvedCorp(new Corporation(CORP_ID));
117    if (ALLIANCE_ID)
118        $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
119
120    $tklist->generate();
121    $tkbox = new AwardBox($tklist, "Top scorers", "points in week " . $week, "points", "redcross");
122    $page->addContext($tkbox->generate());
123}
124
125$page->generate();
126?>
Note: See TracBrowser for help on using the browser.