=time()-5*3600){
$buf=$q_c['data'];
}else{
$ch=curl_init('http://backend.deviantart.com/rss.xml?q=boost%3Anewest%20'.urlencode($q_c['sname']));
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$buf=curl_exec($ch);
mysql_query('update `'.$sad_prefix.'da_item` set `data`="'.sad_safe_mysql($buf).'", `time`=UNIX_TIMESTAMP() where `id`='.$q_c['id']);
}
$feed=sad_xml_rawtext($buf);
for ($i=1;true;$i++){
if (strlen(sad_xml_getnode($feed,'channel/item|'.$i.'/title#'))<1){break;}
preg_match('|([0-9]+)$|',sad_xml_getnode($feed,'channel/item|'.$i.'/link#'),$a);
preg_match('|/([^/]+?)" alt="thumbnail"|',sad_xml_getnode($feed,'channel/item|'.$i.'/description#'),$b);
$ff ='
'.sad_safe_html(sad_xml_getnode($feed,'channel/item|'.$i.'/title#')).'
'.sad_xml_getnode($feed,'channel/item|'.$i.'/link#').'
'.sad_xml_getnode($feed,'channel/item|'.$i.'/guid#').'
'.sad_xml_getnode($feed,'channel/item|'.$i.'/pubDate#').'
'.sad_safe_xml(sad_xml_getnode($feed,'channel/item|'.$i.'/description#'));
if (strlen(sad_xml_getnode($feed,'channel/item|'.$i.'/description#'))>0){
if (preg_match('_\\.(jpe?g|png|gif|bmp)_i',sad_xml_getnode($feed,'channel/item|'.$i.'/description#'))){
$t='Full image';
}else{$t='Read text';}
$ff.=sad_safe_xml('
'.$t.'');
}
$ff.='';
$allfeed[sad_xml_getnode($feed,'channel/item|'.$i.'/guid#')]=$ff;
}
}
$buf=''; foreach ($allfeed as $guid => $item){
$buf.="- \r\n".$item."\r\n
\r\n\r\n";
}
mysql_query('update `'.$sad_prefix.'da_feed` set `data`="'.sad_safe_mysql($buf).'", `time`=UNIX_TIMESTAMP() where `id`='.$qf_c['id']);
$dd=time();
}else{
$buf=$qf_c['data'];
$dd =$qf_c['time'];
}
// print_r($allfeed);exit;
$sad_contype='application/rss+xml; charset=UTF-8';
$sad_hide=true;
echo '<'.'?xml version="1.0" encoding="utf-8"?'.'>';
?>
{#php:$qf_c['title']#} / DeviantArt
http://kanaria.ru/deviantart/
deviantART RSS for sort:time boost:{#php:substr($fd,2)#}
en-us
Copyright 2011, deviantART.com con KanariaRu
{#php:gmdate("D, d M Y H:i:s \G\M\T",$dd)#}
KanariaRu
http://blogs.law.harvard.edu/tech/rss
{#php:$buf#}