root/dev/common/losses.php @ 215

Revision 215, 2.9 KB (checked in by ralle030583, 16 years ago)

2 new Features:
1) its now possible to set some option for an beta 'public-mode'
2) its now possible to change the menu bar through admin panel
- you can change the order of the links in the menu bar
- you can add links to extern sites
- administration isnt very nice atm but works (will change it)

Bugfix in install_step2.php

Line 
1<?php
2require_once('common/includes/class.corp.php');
3require_once('common/includes/class.alliance.php');
4require_once('common/includes/class.killlist.php');
5require_once('common/includes/class.killlisttable.php');
6require_once('common/includes/class.killsummarytable.php');
7require_once('common/includes/class.toplist.php');
8
9if (config::get('public_losses')){
10        die('Forbidden');
11}
12
13$week = $_GET['w'];
14$year = $_GET['y'];
15
16if ($week == '')
17    $week = kbdate('W');
18
19if ($year == '')
20    $year = kbdate('Y');
21
22if ($week == 52)
23{
24    $nweek = 1;
25    $nyear = $year + 1;
26}
27else
28{
29    $nweek = $week + 1;
30    $nyear = $year;
31}
32if ($week == "1")
33{
34    $pweek = 52;
35    $pyear = $year - 1;
36}
37else
38{
39    $pweek = $week - 1;
40    $pyear = $year;
41}
42
43$page = new Page("Losses - Week ".$week);
44
45$klist = new KillList();
46$klist->setWeek($week);
47$klist->setYear($year);
48if (CORP_ID)
49    $klist->addInvolvedCorp(new Corporation(CORP_ID));
50if (ALLIANCE_ID)
51    $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
52
53$lslist = new KillList();
54$lslist->setWeek($week);
55$lslist->setYear($year);
56if (CORP_ID)
57    $lslist->addVictimCorp(new Corporation(CORP_ID));
58if (ALLIANCE_ID)
59    $lslist->addVictimAlliance(new Alliance(ALLIANCE_ID));
60
61$summarytable = new KillSummaryTable($klist, $lslist);
62$summarytable->setBreak(6);
63$html .= $summarytable->generate();
64// $html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>";
65// if ( $week != kbdate( "W" ) )
66// $html .= "[<a href=\"?a=losses&w=".$nweek."&y=".$nyear."\"><<</a>]";
67// $html .= "</td><td class=weeknav align=right>[<a href=\"?a=losses&w=".$pweek."&y=".$pyear."\">>></a>]</td></tr></table>";
68$llist = new KillList();
69$llist->setOrdered(true);
70$llist->setWeek($week);
71$llist->setYear($year);
72if (CORP_ID)
73    $llist->addVictimCorp(new Corporation(CORP_ID));
74if (ALLIANCE_ID)
75    $llist->addVictimAlliance(new Alliance(ALLIANCE_ID));
76if ($_GET['scl_id'])
77    $llist->addVictimShipClass(new ShipClass($_GET['scl_id']));
78else
79    $llist->setPodsNoobShips(false);
80
81$table = new KillListTable($llist);
82$html .= $table->generate();
83
84$menubox = new box("Menu");
85$menubox->setIcon("menu-item.gif");
86$menubox->addOption("caption", "Navigation");
87$menubox->addOption("link", "Previous week", "?a=losses&w=".$pweek."&y=".$pyear);
88if ($week != kbdate("W"))
89{
90    $menubox->addOption("link", "Next week", "?a=losses&w=".$nweek."&y=".$nyear);
91}
92$page->addContext($menubox->generate());
93
94$tllist = new TopLossesList();
95$tllist->setWeek($week);
96$tllist->setYear($year);
97if (CORP_ID)
98    $tllist->addVictimCorp(new Corporation(CORP_ID));
99if (ALLIANCE_ID)
100    $tllist->addVictimAlliance(new Alliance(ALLIANCE_ID));
101
102$tllist->generate();
103$tlbox = new AwardBox($tllist, "Top losers", "losses in week ".$week, "losses", "moon");
104$page->addContext($tlbox->generate());
105
106$page->setContent($html);
107$page->generate();
108?>
Note: See TracBrowser for help on using the browser.