5 | | @set_time_limit(0); |
6 | | header('Content-type: text/xml'); |
7 | | require_once( "class.corp.php" ); |
8 | | require_once( "class.alliance.php" ); |
9 | | require_once( "class.killlist.php" ); |
10 | | require_once( "class.kill.php" ); |
11 | | require_once( "db.php" ); |
12 | | require_once( "globals.php" ); |
| 12 | $html .= " |
| 13 | <rss version=\"2.0\"> |
| 14 | <channel> |
| 15 | <title>".KB_TITLE."</title> |
| 16 | <description>Kill Feed</description> |
| 17 | <link>".KB_HOST."</link> |
| 18 | <copyright>".KB_TITLE."</copyright>\n"; |
16 | | function RSSTable($kill_list) { |
17 | | $this->limit = 0; |
18 | | $this->offset = 0; |
19 | | $this->kill_list_ = $kill_list; |
20 | | } |
21 | | |
22 | | function setLimit($limit) { |
23 | | $this->limit_ = $limit; |
24 | | } |
25 | | |
26 | | function generate() { |
27 | | $prevdate = ""; |
28 | | $this->kill_list_->rewind(); |
29 | | |
30 | | while ($kill = $this->kill_list_->getKill()) |
31 | | { |
32 | | $rawkill = new Kill( $kill->getID() ); |
33 | | |
34 | | $html .= " |
35 | | <item> |
36 | | <title>".$rawkill->getID()."</title> |
37 | | <description> <![CDATA[ ".$rawkill->getRawMail()." ]]> </description> |
38 | | <guid>?a=kill_detail&kll_id=".$kill->getID()."</guid> |
39 | | <pubDate>".strftime( "%a, %d %b %Y %T %Z" , strtotime($kill->getTimeStamp()))."</pubDate> |
40 | | </item> "; |
41 | | } |
42 | | return $html; |
| 25 | $klist->setWeek($_GET['week']); |
| 26 | } |
| 27 | elseif (!$_GET['lastkllid']) |
| 28 | { |
| 29 | $klist->setWeek(date("W")); |
| 30 | } |
| 31 | if ($_GET['lastkllid']) |
| 32 | { |
| 33 | if (method_exists($klist, 'setMinKllID')) |
| 34 | { |
| 35 | $klist->setMinKllID($_GET['lastkllid']); |
67 | | if ($_GET['alli']) |
68 | | $a=$_GET['alli']; |
69 | | if ($_GET['alliance_name']) |
70 | | $a=$_GET['alliance_name']; |
71 | | $alli = new Alliance(); |
72 | | $alli->add( urldecode($a) ); |
| 45 | $_GET['alliance_name'] = $_GET['corp']; |
| 46 | } |
| 47 | if ($_GET['corp_name']) |
| 48 | { |
| 49 | $corp = new Corporation(); |
| 50 | $corp->lookup($_GET['corp_name']); |
| 51 | if ($_GET['losses']) |
| 52 | { |
| 53 | $klist->addVictimCorp($corp); |
| 54 | } |
| 55 | else |
| 56 | { |
| 57 | $klist->addInvolvedCorp($corp); |
| 58 | } |
| 59 | } |
| 60 | elseif ($_GET['alliance_name']) |
| 61 | { |
| 62 | $ally = new Alliance(); |
| 63 | $ally->add($_GET['alliance_name']); |
| 64 | if ($_GET['losses']) |
| 65 | { |
| 66 | $klist->addVictimAlliance($ally); |
| 67 | } |
| 68 | else |
| 69 | { |
| 70 | $klist->addInvolvedAlliance($ally); |
| 71 | } |
84 | | if ( $_GET['losses']) { |
85 | | $html .= "<description> Loss Feed v1.2</description>"; |
86 | | if (CORP_ID) |
87 | | $klist->addVictimCorp(new Corporation(CORP_ID)); |
88 | | if (ALLIANCE_ID) |
89 | | $klist->addVictimAlliance(new Alliance(ALLIANCE_ID)); |
90 | | if ($corp) |
91 | | $klist->addInvolvedCorp($corp); |
92 | | if ($alli) |
93 | | $klist->addInvolvedAlliance($alli); |
| 81 | foreach ($kills as $id => $timestamp) |
| 82 | { |
| 83 | $kill = new Kill($id); |
| 84 | $html .= "<item> |
| 85 | <title>".$id."</title> |
| 86 | <description> <![CDATA[ ".$kill->getRawMail()." ]]> </description> |
| 87 | <guid>?a=kill_detail&kll_id=".$id."</guid> |
| 88 | <pubDate>".strftime("%a, %d %b %Y %T %Z" , strtotime($timestamp))."</pubDate> |
| 89 | </item>\n"; |
| 90 | } |
| 91 | $html .= " |
| 92 | </channel> |
| 93 | </rss>"; |