root/dev/common/igb_home.php @ 240

Revision 240, 2.9 KB (checked in by ralle030583, 15 years ago)

Implemented exi's involvedloader class

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();
16involved::load($kslist,'kill');
17$kslist->setWeek($week);
18$kslist->setYear($year);
19
20$llist = new KillList();
21involved::load($llist,'loss');
22$llist->setWeek($week);
23$llist->setYear($year);
24
25$summarytable = new KillSummaryTable($kslist, $llist);
26$summarytable->setBreak(5);
27
28if ($week == 1)
29{
30    $pyear = kbdate("Y") - 1;
31    $pweek = 52;
32}
33else
34{
35    $pyear = kbdate("Y");
36    $pweek = $week - 1;
37}
38/*
39if ($page->killboard_->hasCampaigns(true))
40{
41    $html .= "<div class=kb-campaigns-header>Active campaigns</div>";
42    $list = new ContractList();
43    $list->setActive("yes");
44    $list->setCampaigns(true);
45    $table = new ContractListTable($list);
46    $html .= $table->generate();
47}
48
49if ($page->killboard_->hasContracts(true))
50{
51    $html .= "<div class=kb-campaigns-header>Active contracts</div>";
52    $list = new ContractList();
53    $list->setActive("yes");
54    $list->setCampaigns(false);
55    $table = new ContractListTable($list);
56    $html .= $table->generate();
57}*/
58
59$html .= "<div class=kb-kills-header>20 most recent kills</div>";
60
61
62$klist = new KillList();
63$klist->setOrdered(true);
64involved::load($klist,'kill');
65
66// boards with low killcount could not display 20 kills with those limits
67//$klist->setStartWeek($week - 1);
68//$klist->setYear($year);
69$klist->setLimit(20);
70
71if ($_GET['scl_id'])
72    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
73else
74    $klist->setPodsNoobShips(false);
75
76$table = new KillListTable($klist);
77$table->setLimit(20);
78$html .= $table->generate();
79
80$page->setContent($html);
81$menubox = new box("Menu");
82$menubox->setIcon("menu-item.gif");
83$menubox->addOption("caption","Navigation");
84$menubox->addOption("link","Previous week", "?a=kills&w=" . $pweek . "&y=" . $pyear);
85$page->addContext($menubox->generate());
86
87$tklist = new TopKillsList();
88$tklist->setWeek($week);
89$tklist->setYear($year);
90involved::load($tklist,'kill');
91
92$tklist->generate();
93$tkbox = new AwardBox($tklist, "Top killers", "kills in week " . $week, "kills", "eagle");
94$page->addContext($tkbox->generate());
95
96if (config::get('kill_points'))
97{
98    $tklist = new TopScoreList();
99    $tklist->setWeek($week);
100    $tklist->setYear($year);
101    involved::load($tklist,'kill');
102
103    $tklist->generate();
104    $tkbox = new AwardBox($tklist, "Top scorers", "points in week " . $week, "points", "redcross");
105    $page->addContext($tkbox->generate());
106}
107
108$page->generate();
109?>
Note: See TracBrowser for help on using the browser.