root/dev/common/feed.php @ 154

Revision 154, 2.6 KB (checked in by exi, 14 years ago)

Added option to enable readdition of dupes which can be handy to fix issues with that mail.
The old item_values mod will be forced to deactivate on the modspage.
Removed the call-by-reference functioncalls in admin_sync.php.
Added autoupgrade code to add some missing itemtypes.
Added code to killlist to set some more variables to the killclass.
Small fix to feed.php for older gzip compatibility.
The IGB techdemo has been added.
Module loss on kill_detail is now 0 for pods instead of null.
Added http-meta equiv refresh to the killmail importer.
Greatly improved related kills page, it now has a Battle Summary.
Changed portrait code to grab the 256x256px version from img.eve.is as 128px is deprecated.

Line 
1<?php
2// liq's feed syndication mod v1.3
3
4@set_time_limit(0);
5require_once("class.corp.php");
6require_once("class.alliance.php");
7require_once("class.killlist.php");
8require_once("class.kill.php");
9
10$html .= "<rss version=\"2.0\">
11<channel>
12<title>".KB_TITLE."</title>
13<description>Kill Feed v1.3</description>
14<link>".KB_HOST."</link>
15<copyright>".KB_TITLE."</copyright>\n";
16
17$klist = new KillList();
18$klist->setPodsNoobShips(true);
19
20if ($_GET['week'])
21{
22    $klist->setWeek($_GET['week']);
23}
24elseif (!$_GET['lastkllid'])
25{
26    $klist->setWeek(date("W"));
27}
28if ($_GET['lastkllid'])
29{
30    if (method_exists($klist, 'setMinKllID'))
31    {
32        $klist->setMinKllID($_GET['lastkllid']);
33    }
34}
35
36if ($_GET['corp'] || $_GET['corp_name'])
37{
38    if ($_GET['corp'])
39    {
40        $c = $_GET['corp'];
41    }
42    if ($_GET['corp_name'])
43    {
44        $c = $_GET['corp_name'];
45    }
46    $corp = new Corporation();
47    $corp->lookup(urldecode($c));
48}
49
50if ($_GET['alli'] || $_GET['alliance_name'])
51{
52    if ($_GET['alli'])
53    {
54        $a = $_GET['alli'];
55    }
56    if ($_GET['alliance_name'])
57    {
58        $a = $_GET['alliance_name'];
59    }
60    $alli = new Alliance();
61    $alli->add(urldecode($a));
62}
63
64if ($_GET['week'])
65{
66    $klist->setWeek($_GET['week']);
67}
68elseif (!$_GET['lastkllid'])
69{
70    $klist->setWeek(date("W"));
71}
72
73if ($_GET['losses'])
74{
75    if (CORP_ID)
76    {
77        $klist->addVictimCorp(new Corporation(CORP_ID));
78    }
79    if (ALLIANCE_ID)
80    {
81        $klist->addVictimAlliance(new Alliance(ALLIANCE_ID));
82    }
83    if ($corp)
84    {
85        $klist->addInvolvedCorp($corp);
86    }
87    if ($alli)
88    {
89        $klist->addInvolvedAlliance($alli);
90    }
91}
92else
93{
94    if (CORP_ID)
95    {
96        $klist->addInvolvedCorp(new Corporation(CORP_ID));
97    }
98    if (ALLIANCE_ID)
99    {
100        $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID));
101    }
102    if ($corp)
103    {
104        $klist->addVictimCorp($corp);
105    }
106    if ($alli)
107    {
108        $klist->addVictimAlliance($alli);
109    }
110}
111
112$kills = array();
113while ($kill = $klist->getKill())
114{
115    $kills[$kill->getID()] = $kill->getTimestamp();
116}
117asort($kills);
118
119foreach ($kills as $id => $timestamp)
120{
121    $kill = new Kill($id);
122    $html .= "<item>
123<title>".$id."</title>
124<description> <![CDATA[ ".$kill->getRawMail()." ]]>  </description>
125<guid>?a=kill_detail&amp;kll_id=".$id."</guid>
126<pubDate>".strftime("%a, %d %b %Y %T %Z", strtotime($timestamp))."</pubDate>
127</item>\n";
128}
129$html .= "</channel>
130</rss>";
131
132if ($_GET['gz'] || $_GET['compress'] == 1)
133{
134    echo gzdeflate($html, 9);
135}
136else
137{
138    echo $html;
139}
140?>
Note: See TracBrowser for help on using the browser.