root/dev/common/igb_home.php @ 195

Revision 190, 3.5 KB (checked in by exi, 15 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

Line 
1<?php
2require_once('common/includes/class.page.php');
3require_once('common/includes/class.killsummarytable.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.toplist.php');
10
11$week = kbdate('W');
12$year = kbdate('Y');
13
14$page = new Page('Week '.$week);
15
16$kslist = new KillList();
17if (CORP_ID)
18    $kslist->addInvolvedCorp(new Corporation(CORP_ID));
19if (ALLIANCE_ID)
20    $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
21
22$kslist->setWeek($week);
23$kslist->setYear($year);
24
25$llist = new KillList();
26if (CORP_ID)
27    $llist->addVictimCorp(new Corporation(CORP_ID));
28if (ALLIANCE_ID)
29    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID));
30
31$llist->setWeek($week);
32$llist->setYear($year);
33
34$summarytable = new KillSummaryTable($kslist, $llist);
35$summarytable->setBreak(6);
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$html .= "<div class=kb-kills-header>20 most recent kills</div>";
69
70
71$klist = new KillList();
72$klist->setOrdered(true);
73if (CORP_ID)
74    $klist->addInvolvedCorp(new Corporation(CORP_ID));
75if (ALLIANCE_ID)
76    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
77
78// boards with low killcount could not display 20 kills with those limits
79//$klist->setStartWeek($week - 1);
80//$klist->setYear($year);
81$klist->setLimit(20);
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 box("Menu");
94$menubox->setIcon("menu-item.gif");
95$menubox->addOption("caption","Navigation");
96$menubox->addOption("link","Previous week", "?a=kills&w=" . $pweek . "&y=" . $pyear);
97$page->addContext($menubox->generate());
98
99$tklist = new TopKillsList();
100$tklist->setWeek($week);
101$tklist->setYear($year);
102if (CORP_ID)
103    $tklist->addInvolvedCorp(new Corporation(CORP_ID));
104if (ALLIANCE_ID)
105    $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
106
107$tklist->generate();
108$tkbox = new AwardBox($tklist, "Top killers", "kills in week " . $week, "kills", "eagle");
109$page->addContext($tkbox->generate());
110
111if ($config->getKillPoints())
112{
113    $tklist = new TopScoreList();
114    $tklist->setWeek($week);
115    $tklist->setYear($year);
116    if (CORP_ID)
117        $tklist->addInvolvedCorp(new Corporation(CORP_ID));
118    if (ALLIANCE_ID)
119        $tklist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
120
121    $tklist->generate();
122    $tkbox = new AwardBox($tklist, "Top scorers", "points in week " . $week, "points", "redcross");
123    $page->addContext($tkbox->generate());
124}
125
126$page->generate();
127?>
Note: See TracBrowser for help on using the browser.