View file forum/rss_news.php

File size: 1.96Kb
<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"setforum.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";

header("Content-type:application/rss+xml; charset=utf-8");
echo '<?xml version="1.0" encoding="utf-8" ?>';
echo '<rss version="2.0"><channel>';
echo '<title>Форум общение без ограничения '.$config_title.' </title>';
echo '<link>'.$config_home.'</link>';
echo '<description>Сообщения RSS - '.$config_title.'</description>';
echo '<image><url>'.$config_logotip.'</url>';
echo '<title>'.$config_title.' Сообщения NEWS</title>';
echo '<link>'.$config_home.'</link></image>';
echo '<language>ru</language>';
echo '<copyright>'.$config_copy.'</copyright>';
echo '<managingEditor>'.$config_emails.'</managingEditor>';
echo '<webMaster>'.$config_emails.'</webMaster>';
echo '<lastBuildDate>'.date(r,$sitetime).'</lastBuildDate>';


$file = file("../local/dataforum/$id.dat");
$file = array_reverse($file);

$total = count($file); 
   

if($total>15){$total=15;}

for ($i=0;$i<$total;$i++){

$data = explode("|",$file[$i]);

$data[4]=bb_code_forum($data[4]);
$data[4]=str_replace('../images/smiles',$config_home.'/images/smiles',$data[4]);
$data[4]=htmlspecialchars($data[4]);


//list($uday, $umonth, $uyear) = explode(".", $data[2]); 
///list($uhour, $umin) = explode(":", $data[3]); 
$usecond = mktime($uhour,$umin,'0',$umonth,$uday,$uyear);

echo '<item><title>'.$data[3].'</title><link>'.$config_home.'/forum/index.php?fid='.$data[8].'&amp;id='.$data[7].'</link>';
echo '<description>'.$data[4].' </description><author>Пишет: '.$config_home.'/pages/anketa.php?uz='.$data[0].'&amp;'.SID.'">'.nickname($data[0]).'</author>';
echo '<pubDate>'.date(r,$data[3]).'</pubDate><category>Сообщения</category><guid>'.$config_home.'/forum/index.php?fid='.$data[8].'&amp;id='.$data[7].'</guid></item>';
}

echo '</channel></rss>';
?>