<?



$lines_rss=file_get_contents("http://dolzhenkov.ru/wallpapers/feed/");
$lines=explode("<item>" , $lines_rss); //Разбиваем страничку на строки

$massiv_adresov_galerey = array();
		 
for($xx=0; $xx<10; $xx++)  
{
	 
	if(preg_match('/<title>(.*)<pubDate>(.*)<\/pubDate>(.*)<\/category>/si',$lines[$xx], $resultat))
	{
		//echo "$xx". $resultat[1]."<br/>";
		$massiv_adresov_galerey[strtotime($resultat[2])]="<item><title>".$resultat[1]."<pubDate>".$resultat[2]."</pubDate>".$resultat[3]."</category></item>
		
		";  // Записываем в массив

	}
}


 


$lines_rss=file_get_contents("http://dolzhenkov.ru/rss");
$lines=explode("<item>" , $lines_rss); //Разбиваем страничку на строки

 
	 	 
for($xx=0; $xx<10; $xx++)  
{
	 
	if(preg_match('/<title>(.*)<comments>(.*)<pubDate>(.*)<\/pubDate>(.*)<\/dc\:creator>(.*)<wfw\:commentRss>/si',$lines[$xx], $resultat))
	{
		//echo "$xx". $resultat[1]."<br/>";
		$massiv_adresov_galerey[strtotime($resultat[3])]="<item><title>".$resultat[1]."<pubDate>".$resultat[3]."</pubDate>".$resultat[5]."</item>
		
		";  // Записываем в массив

	}
}

 
 	
 
$lines_rss=file_get_contents("http://dolzhenkov.ru/tour/feed/");
$lines=explode("<item>" , $lines_rss); //Разбиваем страничку на строки

 
		 
for($xx=0; $xx<10; $xx++)  
{
	 
	if(preg_match('/<title>(.*)<pubDate>(.*)<\/pubDate>(.*)<\/category>/si',$lines[$xx], $resultat))
	{
		//echo "$xx". $resultat[1]."<br/>";
		$massiv_adresov_galerey[strtotime($resultat[2])]="<item><title>".$resultat[1]."<pubDate>".$resultat[2]."</pubDate>".$resultat[3]."</category></item>
		
		";  // Записываем в массив

	}
}

 

krsort($massiv_adresov_galerey);
reset($massiv_adresov_galerey);
$lastupdate= date ( "r", key($massiv_adresov_galerey ));

echo '<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Dolzhenkov.ru</title>
 
	<link>http://dolzhenkov.ru</link>
	<description>Путевые заметки, Туристические обзоры, Люди, Страны, Города.</description>
	<lastBuildDate>'.$lastupdate.'</lastBuildDate>
	<language>ru</language>
 
	
	';

//print_r($massiv_adresov_galerey);	 

$massiv_rss = array();

foreach($massiv_adresov_galerey as $key => $value) { $massiv_rss[] = $value;}

for($xx=0; $xx<9; $xx++)  
{

echo $massiv_rss[$xx];

}



echo '</channel>
</rss>
';
 
 
 

?>