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

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