1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Author: Doctor Z |
---|
5 | * eMail: east4now11@hotmail.com |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | class RSSTable extends KillListTable |
---|
10 | { |
---|
11 | function RSSTable($kill_list) |
---|
12 | { |
---|
13 | $this->limit = 0; |
---|
14 | $this->offset = 0; |
---|
15 | |
---|
16 | $this->kill_list_ = $kill_list; |
---|
17 | $this->daybreak_ = true; |
---|
18 | } |
---|
19 | |
---|
20 | function generate() |
---|
21 | { |
---|
22 | global $config; |
---|
23 | $odd = false; |
---|
24 | $prevdate = ""; |
---|
25 | $this->kill_list_->rewind(); |
---|
26 | |
---|
27 | while ($kill = $this->kill_list_->getKill()) |
---|
28 | { |
---|
29 | $url = KB_HOST; |
---|
30 | if(strncasecmp("http://", KB_HOST, 7)) |
---|
31 | { |
---|
32 | $url = "http://".KB_HOST; |
---|
33 | } |
---|
34 | if($url[strlen($url) - 1] != '/') |
---|
35 | { |
---|
36 | $url .= '/'; |
---|
37 | } |
---|
38 | /* date in format: Tue, 03 Jun 2003 09:39:21 GMT |
---|
39 | Hack added because the time is not parsed correctly by strtotime() |
---|
40 | */ |
---|
41 | $timestamp = $kill->getTimeStamp(); |
---|
42 | $timestring = explode(" ", $timestamp); |
---|
43 | $datestring = strftime("%a, %d %b %Y " , strtotime($timestamp)); |
---|
44 | $datestring .= $timestring[1]; |
---|
45 | $datestring .= strftime(" %Z" , strtotime($timestamp)); |
---|
46 | $html .= "<item> |
---|
47 | <title>".$kill->getVictimName()." was killed</title> |
---|
48 | <description> |
---|
49 | <![CDATA[ |
---|
50 | <p><b>Ship:</b> ".$kill->getVictimShipName()." |
---|
51 | <br /><b>Victim:</b> ".$kill->getVictimName()." |
---|
52 | <br /><b>Corp:</b> ".shorten($kill->getVictimCorpName())." |
---|
53 | <br /><b>System:</b> ".shorten($kill->getSolarSystemName(), 10)." |
---|
54 | <br /><b>Date:</b> ".$timestamp." |
---|
55 | <br /> |
---|
56 | <br /><b>Killed By:</b> |
---|
57 | <br /><b>Final Blow:</b> ".$kill->getFBPilotName()." |
---|
58 | <br /><b>Corp:</b> ".shorten($kill->getFBCorpName())." |
---|
59 | </p> |
---|
60 | ]]> |
---|
61 | </description> |
---|
62 | <guid>".$url."index.php?a=kill_detail&kll_id=".$kill->getID()."</guid> |
---|
63 | <pubDate>".$datestring."</pubDate> |
---|
64 | </item>\n"; |
---|
65 | } |
---|
66 | |
---|
67 | return $html; |
---|
68 | } |
---|
69 | } |
---|
70 | ?> |
---|