root/dev/mods/monthly_views/kills.php @ 343

Revision 343, 2.7 KB (checked in by beans, 12 years ago)

A lot of updates done by Karbowiak (LaMaH).
See them here:  http://eve-id.net/forum/viewtopic.php?f=503&t=13204&p=15284#p15284

Highlights:
* Integrated feed fetcher & API Mod into the core
* memcached support in core

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.ship.php');
6require_once('common/includes/class.killlisttable.php');
7require_once('common/includes/class.killsummarytable.public.php');
8require_once('common/includes/class.toplist.php');
9
10$week = $_GET['w'];
11$year = $_GET['y'];
12
13if ($week == '')
14    $week = kbdate('W');
15
16if ($year == '')
17    $year = kbdate('Y');
18
19if ($week == 52)
20{
21    $nweek = 1;
22    $nyear = $year + 1;
23    $pyear = $year - 1;
24}
25else
26{
27    $nweek = $week + 1;
28    $nyear = $year;
29}
30if ($week == 1)
31{
32    $pweek = 52;
33    $pyear = $year - 1;
34}
35else
36{
37    $pweek = $week - 1;
38    $pyear = $year;
39}
40
41$page = new Page("Kills - Week ".$week);
42
43$kslist = new KillList();
44$kslist->setWeek($week);
45$kslist->setYear($year);
46involved::load($kslist,'kill');
47
48if (config::get('summarytable')){
49        if (config::get('public_summarytable')){
50                $summarytable = new KillSummaryTablePublic($kslist);
51        }
52        else
53        {
54                $llist = new KillList();
55                $llist->setWeek($week);
56                $llist->setYear($year);
57                involved::load($llist,'loss');
58                $summarytable = new KillSummaryTable($kslist, $llist);
59        }
60        $summarytable->setBreak(config::get('summarytable_rowcount'));
61        $html .= $summarytable->generate();
62}
63       
64$klist = new KillList();
65$klist->setOrdered(true);
66$klist->setWeek($week);
67$klist->setYear($year);
68involved::load($klist,'kill');
69if ($_GET['scl_id'])
70    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
71else
72    $klist->setPodsNoobShips(false);
73
74$pagesplitter = new PageSplitter($klist->getCount(), 30);   
75$klist->setPageSplitter($pagesplitter);
76$table = new KillListTable($klist);
77$html .= $table->generate();
78$html .= $pagesplitter->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);
85if ($week != kbdate("W"))
86{
87    $menubox->addOption('link', "Next week", "?a=kills&w=".$nweek."&y=".$nyear);
88}
89$page->addContext($menubox->generate());
90
91$tklist = new TopKillsList();
92$tklist->setWeek($week);
93$tklist->setYear($year);
94involved::load($tklist,'kill');
95
96$tklist->generate();
97$tkbox = new AwardBox($tklist, "Top killers", "kills in week ".$week, "kills", "eagle");
98$page->addContext($tkbox->generate());
99
100if (config::get('kill_points'))
101{
102    $tklist = new TopScoreList();
103    $tklist->setWeek($week);
104    $tklist->setYear($year);
105    involved::load($tklist,'kill');
106
107    $tklist->generate();
108    $tkbox = new AwardBox($tklist, "Top scorers", "points in week ".$week, "points", "redcross");
109    $page->addContext($tkbox->generate());
110}
111
112$page->generate();
113?>
Note: See TracBrowser for help on using the browser.