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

Revision 376, 3.9 KB (checked in by kovell, 11 years ago)

MyISAM can be selected again on install
duplicate item descriptions removed from install
alliance/corp/pilot optional installs now have external id and correct structure
alliance/corp/pilot/kill details can be selected by external id
corp/alliance/kill now have get and set methods for external ids
killlist has method to select only kills with an external id set
monthly views mod now shows clock and combined kills if selected
optimisations and fixes to killlists and toplists

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');
9if(config::get('show_clock')) require_once('common/includes/class.clock.php');
10
11$week = kbdate('W');
12$year = kbdate('Y');
13$month = kbdate('m');
14
15$page = new Page( kbdate("F") );
16
17$kslist = new KillList();
18involved::load($kslist,'kill');
19$kslist->setStartDate(date('Y-m').'-1 00:00:00');
20
21if (config::get('summarytable')){
22if (config::get('public_summarytable')){
23        $summarytable = new KillSummaryTablePublic($kslist);
24}
25else
26{
27        $llist = new KillList();
28        involved::load($llist,'loss');
29        $llist->setStartDate(date('Y-m').'-1 00:00:00');
30       
31        $summarytable = new KillSummaryTable($kslist, $llist);
32}
33$summarytable->setBreak(config::get('summarytable_rowcount'));
34$html .= $summarytable->generate();
35}
36
37if ($week == 1)
38{
39    $pyear = kbdate("Y") - 1;
40    $pweek = 53;
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// bad hax0ring, we really need mod callback stuff
69if (strpos(config::get('mods_active'), 'rss_feed') !== false)
70{
71    $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;".config::get('killcount')." most recent kills</div>";
72}
73else
74{
75    $html .= "<div class=kb-kills-header style=\"margin-top: 30px\">Most recent kills</div>";
76}
77
78
79$klist = new KillList();
80$klist->setOrdered(true);
81    if(config::get('show_comb_home'))
82    {
83        if(ALLIANCE_ID >0) $klist->addCombinedAlliance(ALLIANCE_ID);
84        if(CORP_ID >0) $klist->addCombinedCorp(CORP_ID);
85        if(PILOT_ID>0) $klist->addCombinedPilot(PILOT_ID);
86    }
87    else involved::load($klist,'kill');
88
89$klist->setLimit(config::get('killcount'));
90
91if ($_GET['scl_id'])
92    $klist->addVictimShipClass(new ShipClass($_GET['scl_id']));
93else
94    $klist->setPodsNoobShips(false);
95
96$table = new KillListTable($klist);
97if(config::get('show_comb_home')) $table->setCombined(true);
98$table->setLimit(config::get('killcount'));
99$html .= $table->generate();
100
101$page->setContent($html);
102$menubox = new box("Menu");
103$menubox->setIcon("menu-item.gif");
104$menubox->addOption("caption","Navigation");
105$menubox->addOption("link","Kills ". date('F'), "?a=killsmonthly&amp;m=" . $month . "&amp;y=" . $year);
106$menubox->addOption("link","Losses ". date('F'), "?a=lossesmonthly&amp;m=" . $month . "&amp;y=" . $year);
107$page->addContext($menubox->generate());
108
109// Show the Eve time.
110if(config::get('show_clock'))
111{
112        $clock = new Clock();
113        $page->addContext($clock->generate());
114}
115$tklist = new TopKillsList();
116$tklist->setStartDate(date('Y-m').'-1 00:00:00');
117involved::load($tklist,'kill');
118
119$tklist->generate();
120$tkbox = new AwardBox($tklist, "Top killers", "kills in " . date('F'), "kills", "eagle");
121$page->addContext($tkbox->generate());
122
123if (config::get('kill_points'))
124{
125    $tklist = new TopScoreList();
126    $tklist->setStartDate(date('Y-m').'-1 00:00:00');
127    involved::load($tklist,'kill');
128
129    $tklist->generate();
130    $tkbox = new AwardBox($tklist, "Top scorers", "points in " . date('F'), "points", "redcross");
131    $page->addContext($tkbox->generate());
132}
133
134$page->generate();
135?>
Note: See TracBrowser for help on using the browser.