- Timestamp:
- 12/12/06 18:01:14 (14 years ago)
- Location:
- dev
- Files:
-
- 5 added
- 2 removed
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin_menu.php
r136 r148 13 13 $menubox->addOption("link","Post Permissions", "?a=admin_postperm"); 14 14 $menubox->addOption("link","Mods", "?a=admin_mods"); 15 $menubox->addOption("link","Feeds", "?a=admin_feed"); 15 if (file_exists('common/admin_feed.php')) 16 { 17 $menubox->addOption("link","Feeds", "?a=admin_feed"); 18 } 16 19 $menubox->addOption("link","Auditing", "?a=admin_audit"); 17 20 $menubox->addOption("link","Kill Import - files", "?a=kill_import"); -
dev/common/feed.php
r147 r148 1 1 <?php 2 @set_time_limit(0); 2 3 3 // liq's feed syndication mod v1.2 4 // based on liq's feed syndication 5 require_once("class.corp.php"); 6 require_once("class.alliance.php"); 7 require_once("class.killlist.php"); 8 require_once("class.kill.php"); 9 require_once("db.php"); 10 require_once("globals.php"); 4 11 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"; 13 19 14 class RSSTable 20 $klist = new KillList(); 21 $klist->setPodsNoobShips(true); 22 23 if ($_GET['week']) 15 24 { 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']); 43 36 } 44 37 } 45 38 46 $html .= " 47 <rss version=\"2.0\"><channel> 48 <title>".KB_TITLE."</title> 49 <link>".KB_HOST."</link> 50 <copyright>".KB_TITLE."</copyright>"; 51 52 $klist = new KillList(); 53 $klist->setOrdered(true); 54 $klist->setPodsNoobShips(true); 55 56 if ($_GET['corp'] || $_GET['corp_name']) 39 if ($_GET['corp']) 57 40 { 58 if ($_GET['corp']) 59 $c=$_GET['corp']; 60 if ($_GET['corp_name']) 61 $c=$_GET['corp_name']; 62 $corp = new Corporation(); 63 $corp->lookup( urldecode($c) ); 41 $_GET['corp_name'] = $_GET['corp']; 64 42 } 65 if ($_GET['alli'] || $_GET['alliance_name'])43 elseif ($_GET['alli']) 66 44 { 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 } 73 72 } 74 73 75 if ($_GET['week']) 76 $klist->setWeek( $_GET['week'] ); 77 elseif (!$_GET['lastkllid']) 78 $klist->setWeek( date("W") ); 79 if ($_GET['lastkllid']) { 80 if (method_exists($klist, 'setMinKllID')) 81 $klist->setMinKllID($_GET['lastkllid']); 74 $kills = array(); 75 while ($kill = $klist->getKill()) 76 { 77 $kills[$kill->getID()] = $kill->getTimestamp(); 82 78 } 79 asort($kills); 83 80 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>"; 94 94 95 } else { 96 $html .= "<description> Kill Feed v1.2</description>"; 97 if (CORP_ID) 98 $klist->addInvolvedCorp(new Corporation(CORP_ID)); 99 if (ALLIANCE_ID) 100 $klist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 101 if ($corp) 102 $klist->addVictimCorp($corp); 103 if ($alli) 104 $klist->addVictimAlliance($alli); 95 if ($_GET['compress'] == '1') 96 { 97 echo gzdeflate($html); 105 98 } 106 107 $table = new RSSTable($klist); 108 $html .= $table->generate(); 109 $html .= "</channel></rss>"; 110 echo $html; 111 99 else 100 { 101 echo $html; 102 } 112 103 ?>