header("Content-type: application/rss+xml");
// header("Content-type: text/plain");
include('./includes/config.php');
include($DOCUMENT_ROOT.'/includes/db_functions.php');
echo ''."\r\n";
// Функция замены специальных тегов
function ReplaceTags($text)
{
$text = str_replace(" ", " ", $text);
$text = str_replace('', '', $text);
$text = str_replace('', '', $text);
$text = str_replace('', '', $text);
$text = str_replace('', '', $text);
$text = str_replace('[IMG]', '', $text);
$text = str_replace('[url=', '', $text);
$text = str_replace("[/url]", "", $text);
$text = str_replace(" - ", " ", $text);
$text = str_replace('[img]', '', $text);
return $text;
}
// ===============================================================================================
// Функция удаляет из текста "[READ_MORE]"
function ShowWithoutReadMore($text)
{
$text = ReplaceTags($text);
if (strpos($text, "[READ_MORE]") != "")
$text = substr($text, 0, strpos($text, "[READ_MORE]"));
return $text;
}
// ==========================================================================================================================
// Функция вывода всех авторов статьи с индексом статьи $post_id
function EchoAuthorsOfPostForRSS($post_id)
{
$authors = GetAuthorsOfPost($post_id);
$result = "";
for ($i = 0; $i < count($authors); $i++)
{
if ($i > 0)
$result .= " / ";
$result .= $authors[$i]['rus_name'];
}
return $result;
}
// Запрос к базе данных
$query = "SELECT *, UNIX_TIMESTAMP(date) AS news_id, DATE_FORMAT(date, '%a, %d %b %Y %H:%i:%s +0400') AS date FROM ".$table_prefix."posts ORDER BY news_id DESC LIMIT 0, 20";
$result = mysql_query($query);
?>
Сетевой журнал «1984»
http://www.1984.totalitarism.ru/
ru
while ($row = mysql_fetch_array($result))
{
if($row)
{
if ($row['enabled'] == 1)
{
$section_path = GetSectionOfPost($row['section']);
$post_path = $row['path'];
$guid = "http://www.1984.totalitarism.ru/sections/".$section_path."/".$post_path."/";
echo " - \r\n";
echo ' '."\r\n";
echo ' \r\n";
echo ' '."\r\n";
echo ' '.$guid."\r\n";
echo ' '.$row['date']."\r\n";
echo "
\r\n";
}
}
}
?>
// Закрытие соединения с базой данных
mysql_close($link);
?>