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

Revision 343, 3.5 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.killsummarytable.public.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$month = kbdate('m');
13
14$page = new Page( kbdate("F") );
15
16$kslist = new KillList();
17involved::load($kslist,'kill');
18$kslist->setStartDate(date('Y-m').'-1 00:00:00');
19
20if (config::get('summarytable')){
21if (config::get('public_summarytable')){
22        $summarytable = new KillSummaryTablePublic($kslist);
23}
24else
25{
26        $llist = new KillList();
27        involved::load($llist,'loss');
28        $llist->setStartDate(date('Y-m').'-1 00:00:00');
29       
30        $summarytable = new KillSummaryTable($kslist, $llist);
31}
32$summarytable->setBreak(config::get('summarytable_rowcount'));
33$html .= $summarytable->generate();
34}
35
36if ($week == 1)
37{
38    $pyear = kbdate("Y") - 1;
39    $pweek = 52;
40}
41else
42{
43    $pyear = kbdate("Y");
44    $pweek = $week - 1;
45}
46
47if ($page->killboard_->hasCampaigns(true))
48{
49    $html .= "<div class=kb-campaigns-header>Active campaigns</div>";
50    $list = new ContractList();
51    $list->setActive("yes");
52    $list->setCampaigns(true);
53    $table = new ContractListTable($list);
54    $html .= $table->generate();
55}
56
57if ($page->killboard_->hasContracts(true))
58{
59    $html .= "<div class=kb-campaigns-header>Active contracts</div>";
60    $list = new ContractList();
61    $list->setActive("yes");
62    $list->setCampaigns(false);
63    $table = new ContractListTable($list);
64    $html .= $table->generate();
65}
66
67// bad hax0ring, we really need mod callback stuff
68if (strpos(config::get('mods_active'), 'rss_feed') !== false)
69{
70    $html .= "<div class=kb-kills-header style=\"margin-top: 30px\"><a href=\"?a=rss\"><img src=\"mods/rss_feed/rss_icon.png\" alt=\"RSS-Feed\" border=\"0\"></a>&nbsp;20 most recent kills</div>";
71}
72else
73{
74    $html .= "<div class=kb-kills-header style=\"margin-top: 30px\">Most recent kills</div>";
75}
76
77
78$klist = new KillList();
79$klist->setOrdered(true);
80involved::load($klist,'kill');
81
82// boards with low killcount could not display 20 kills with those limits
83$klist->setLimit(config::get('killcount'));
84
85if ($_GET['scl_id'])
86    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
87else
88    $klist->setPodsNoobShips(false);
89
90$table = new KillListTable($klist);
91$table->setLimit(config::get('killcount'));
92$html .= $table->generate();
93
94$page->setContent($html);
95$menubox = new box("Menu");
96$menubox->setIcon("menu-item.gif");
97$menubox->addOption("caption","Navigation");
98$menubox->addOption("link","Kills ". date('F'), "?a=killsmonthly&m=" . $month . "&y=" . $year);
99$menubox->addOption("link","Losses ". date('F'), "?a=lossesmonthly&m=" . $month . "&y=" . $year);
100$page->addContext($menubox->generate());
101
102$tklist = new TopKillsList();
103$tklist->setStartDate(date('Y-m').'-1 00:00:00');
104involved::load($tklist,'kill');
105
106$tklist->generate();
107$tkbox = new AwardBox($tklist, "Top killers", "kills in " . date('F'), "kills", "eagle");
108$page->addContext($tkbox->generate());
109
110if (config::get('kill_points'))
111{
112    $tklist = new TopScoreList();
113    $tklist->setStartDate(date('Y-m').'-1 00:00:00');
114    involved::load($tklist,'kill');
115
116    $tklist->generate();
117    $tkbox = new AwardBox($tklist, "Top scorers", "points in " . date('F'), "points", "redcross");
118    $page->addContext($tkbox->generate());
119}
120
121$page->generate();
122?>
Note: See TracBrowser for help on using the browser.