<?php
require './header.php';

$ogi_page_name = 'incident_feed';

//Only available to subscribers so check here
/*if(!X_MEMBER)
{		
error('You need to be logged in to access this page'); }*/
//eval('echo "'.template('ogi_header').'";');
/* ***************************************
End of Member check, code below is accessed on if member check is passed
*******************************************
*/

require './ogi_funcs.php';?>
<? header('Content-type: text/xml'); ?>
<rss version="2.0">
<channel>
<title>Oil &amp; Gas Industry Terrorism Monitor - Incident Feed</title>
<description>Latest Incidents Feed from the Oil and Gas Industry Terrorism Monitor</description>
<link>http://www.ogi-tm.com/ogi_display_record.php?list_type=incident</link>
<copyright>Copyright 2007.</copyright>
			
			
<?
$q="SELECT * FROM ogirecords WHERE record_type = 'Incident' ORDER BY record_date DESC LIMIT 0,15";
$doGet=mysql_query($q);


while($records = mysql_fetch_array($doGet)){

$html = array();
			//Date
			if($records[record_amended] == '0' || $records[record_amended] == '')
				{$html[record_updated] = date( "r" , $records['record_added']);}
				else 
				{$html[record_updated] = date( "r" , $records['record_amended']);}
			

			//Title
			$html[record_title] = htmlentities(postify($records[record_title]));
			
			if(X_MEMBER)
{//Text
			$html[record_text] =    stripslashes(htmlentities(strip_tags(postify($records['record_text']))));
			$html[record_text] =	str_replace(chr(145), "'", $html[record_text]);
				$html[record_text] =	str_replace(chr(146), "'", $html[record_text]);
				$html[record_text] =	str_replace(chr(147), '"', $html[record_text]);
				$html[record_text] =	str_replace(chr(148), '"', $html[record_text]);
				$html[record_text] =	str_replace(chr(149), ' ', $html[record_text]);
				$html[record_text] =	str_replace('&middot;', ' ', $html[record_text]);
				$html[record_text] =	str_replace(chr(151), '-', $html[record_text]);}
			else
			{$html[record_text] ='';}
			


?> 
     <item><guid ispermalink="true">http://www.ogi-tm.com/ogi_display_record_details.php?record_id=<?=$records['record_id'] ?></guid>
        <title><?=$html['record_title'] ?></title> 
        <description><?=$html['record_text'] ?>
</description> 
        <link>http://www.ogi-tm.com/ogi_display_record_details.php?record_id=<?=$records['record_id'] ?></link> 
        <pubDate><?=$html['record_updated'] ?></pubDate> 
     </item>    
<?php } ?>  

</channel>
</rss>