root/dev/common/home.php @ 233

Revision 233, 3.8 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$html .= $summarytable->generate();
36
37if ($week == 1)
38{
39    $pyear = kbdate("Y") - 1;
40    $pweek = 52;
41}
42else
43{
44    $pyear = kbdate("Y");
45    $pweek = $week - 1;
46}
47
48if ($page->killboard_->hasCampaigns(true))
49{
50    $html .= "<div class=kb-campaigns-header>Active campaigns</div>";
51    $list = new ContractList();
52    $list->setActive("yes");
53    $list->setCampaigns(true);
54    $table = new ContractListTable($list);
55    $html .= $table->generate();
56}
57
58if ($page->killboard_->hasContracts(true))
59{
60    $html .= "<div class=kb-campaigns-header>Active contracts</div>";
61    $list = new ContractList();
62    $list->setActive("yes");
63    $list->setCampaigns(false);
64    $table = new ContractListTable($list);
65    $html .= $table->generate();
66}
67
68// bad hax0ring, we really need mod callback stuff
69if (strpos(config::get('mods_active'), 'rss_feed') !== false)
70{
71    $html .= "<div class=kb-kills-header><a href=\"?a=rss\"><img src=\"mods/rss_feed/rss_icon.png\" alt=\"RSS-Feed\" border=\"0\"></a>&nbsp;20 most recent kills</div>";
72}
73else
74{
75    $html .= "<div class=kb-kills-header>20 most recent kills</div>";
76}
77
78$klist = new KillList();
79$klist->setOrdered(true);
80if (CORP_ID)
81    $klist->addInvolvedCorp(new Corporation(CORP_ID));
82if (ALLIANCE_ID)
83    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
84
85// boards with low killcount could not display 20 kills with those limits
86//$klist->setStartWeek($week - 1);
87//$klist->setYear($year);
88$klist->setLimit(20);
89
90if ($_GET['scl_id'])
91    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
92else
93    $klist->setPodsNoobShips(false);
94
95$table = new KillListTable($klist);
96$table->setLimit(20);
97$html .= $table->generate();
98
99$page->setContent($html);
100$menubox = new box("Menu");
101$menubox->setIcon("menu-item.gif");
102$menubox->addOption("caption","Navigation");
103$menubox->addOption("link","Previous week", "?a=kills&w=" . $pweek . "&y=" . $pyear);
104$page->addContext($menubox->generate());
105
106$tklist = new TopKillsList();
107$tklist->setWeek($week);
108$tklist->setYear($year);
109if (CORP_ID)
110    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
111if (ALLIANCE_ID)
112    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
113
114$tklist->generate();
115$tkbox = new AwardBox($tklist, "Top killers", "kills in week " . $week, "kills", "eagle");
116$page->addContext($tkbox->generate());
117
118if (config::get('kill_points'))
119{
120    $tklist = new TopScoreList();
121    $tklist->setWeek($week);
122    $tklist->setYear($year);
123    if (CORP_ID)
124        $tklist->addInvolvedCorp(new Corporation(CORP_ID));
125    if (ALLIANCE_ID)
126        $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
127
128    $tklist->generate();
129    $tkbox = new AwardBox($tklist, "Top scorers", "points in week " . $week, "points", "redcross");
130    $page->addContext($tkbox->generate());
131}
132
133$page->generate();
134?>
Note: See TracBrowser for help on using the browser.