root/dev/common/igb_home.php @ 233

Revision 233, 3.5 KB (checked in by ralle030583, 15 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.corp.php');
4require_once('common/includes/class.alliance.php');
5require_once('common/includes/class.killlist.php');
6require_once('common/includes/class.killlisttable.php');
7require_once('common/includes/class.contract.php');
8require_once('common/includes/class.toplist.php');
9
10$week = kbdate('W');
11$year = kbdate('Y');
12
13$page = new Page('Week '.$week);
14
15$kslist = new KillList();
16if (CORP_ID)
17    $kslist->addInvolvedCorp(new Corporation(CORP_ID));
18if (ALLIANCE_ID)
19    $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
20
21$kslist->setWeek($week);
22$kslist->setYear($year);
23
24$llist = new KillList();
25if (CORP_ID)
26    $llist->addVictimCorp(new Corporation(CORP_ID));
27if (ALLIANCE_ID)
28    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID));
29
30$llist->setWeek($week);
31$llist->setYear($year);
32
33$summarytable = new KillSummaryTable($kslist, $llist);
34$summarytable->setBreak(5);
35
36if ($week == 1)
37{
38    $pyear = kbdate("Y") - 1;
39    $pweek = 52;
40}
41else
42{
43    $pyear = kbdate("Y");
44    $pweek = $week - 1;
45}
46/*
47if ($page->killboard_->hasCampaigns(true))
48{
49    $html .= "<div class=kb-campaigns-header>Active campaigns</div>";
50    $list = new ContractList();
51    $list->setActive("yes");
52    $list->setCampaigns(true);
53    $table = new ContractListTable($list);
54    $html .= $table->generate();
55}
56
57if ($page->killboard_->hasContracts(true))
58{
59    $html .= "<div class=kb-campaigns-header>Active contracts</div>";
60    $list = new ContractList();
61    $list->setActive("yes");
62    $list->setCampaigns(false);
63    $table = new ContractListTable($list);
64    $html .= $table->generate();
65}*/
66
67$html .= "<div class=kb-kills-header>20 most recent kills</div>";
68
69
70$klist = new KillList();
71$klist->setOrdered(true);
72if (CORP_ID)
73    $klist->addInvolvedCorp(new Corporation(CORP_ID));
74if (ALLIANCE_ID)
75    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
76
77// boards with low killcount could not display 20 kills with those limits
78//$klist->setStartWeek($week - 1);
79//$klist->setYear($year);
80$klist->setLimit(20);
81
82if ($_GET['scl_id'])
83    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
84else
85    $klist->setPodsNoobShips(false);
86
87$table = new KillListTable($klist);
88$table->setLimit(20);
89$html .= $table->generate();
90
91$page->setContent($html);
92$menubox = new box("Menu");
93$menubox->setIcon("menu-item.gif");
94$menubox->addOption("caption","Navigation");
95$menubox->addOption("link","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.