Title="Неспящий Цитатник xa-xa-xa.info"; $Rss->Link="http://".$_SERVER['HTTP_HOST']; $Rss->Copyright="©"; $Rss->Description="Лучшие цитаты портала xa-xa-xa.info"; $Rss->Category = "Цитата дня на xa-xa-xa.info"; $Rss->Language="ru"; $Rss->ManagingEditor="admin@unsleep.ru"; $Rss->WebMaster="admin@unsleep.ru"; $Rss->Query="SELECT quotes.content, quotes.date, quotes.id FROM quotes WHERE status='checked' ORDER by DATE desc Limit 0,10"; $Rss->Open($dbhost,$dbname,$dbuser,$dbpass); $Rss->LastBuildDate=date("r"); // получаем последнюю дату публикации $query = "SET NAMES cp1251"; $resultc = mysql_query($query) or die("FROM quotes failed"); $query = "select quotes.DATE FROM quotes ORDER by quotes.date desc Limit 0,1"; $result1 = mysql_query($query) or die("FROM quotes failed"); $line = mysql_fetch_array($result1); $Date =date("r",strtotime($line[0])); mysql_free_result($result1); $Rss->LastBuildDate=$Date; $Rss->PubDate=$Rss->LastBuildDate; $Rss->PrintHeader(); $Rss->Query(); while ($line = mysql_fetch_array($Rss->Result)) { $Title = "Цитата №".$line[2]; $Description = str_replace("\r\n", "
", htmlspecialchars($line[0])); $Link="http://".$_SERVER['HTTP_HOST']."/id".$line[2]; $PubDate=date("r",strtotime($line[1])); $Category="Лучшие Цитаты на cit.unsleep.ru"; $Rss->PrintBody($Title,$Link,$Description,$Category,$PubDate); } $Rss->PrintFooter(); $Rss->Close(); ?>