<?php
require'fun.php';
if($conn->query('SELECT COUNT(*)FROM`rss`WHERE`id`="'.$pid.'"')->fetch_row()[0]>0)
{
$rssinfo=$conn->query('SELECT`nume`,`imgsrc`,`srcd`,`lupdate`,`link`FROM`rss`WHERE`id`="'.$pid.'"')->fetch_row();
$x1=' '.htmlspecialchars($rssinfo[0]);
$x2='';
if($cid>0)
{
$finfo=$conn->query('SELECT`nume`FROM`forum_forumuri`WHERE`id`="'.$cid.'"')->fetch_row();
$x1.=' din forumul '.htmlspecialchars($finfo[0]);
$x2='/categorie/'.$cid.'-'.seo($finfo[0]);
$back[1]='<a href="/forum/forum/'.$cid.'-'.seo($finfo[0]).'">'.htmlspecialchars($finfo[0]).'</a>';
$back[2]='<a href="/fluxuri-rss/categorie/'.$cid.'-'.seo($finfo[0]).'">'.img('stiri.png',2).htmlspecialchars($finfo[0]).'</a>';
}
else
$back[1]='<a href="/fluxuri-rss">'.img('stiri.png',2).'Fluxuri RSS</a>';
$x2.='/id/'.$pid.'-'.seo($rssinfo[0]);
if($rssinfo[3]<($_SERVER['REQUEST_TIME']-3600))
{
require'clasa_lastRSS.php';
$rss=new lastRSS;
$rss->cache_dir='log/rss';
$rss->cache_time=3600;
$rss->cp='utf-8';
$rss->default_cp='utf-8';
$rss->items_limit=0;
$rss->date_format='r';
$rss->stripHTML=false;
$rss->CDATA='content';
if($rs=$rss->get($rssinfo[4]))
{
$conn->query('UPDATE`rss`SET`lupdate`="'.$_SERVER['REQUEST_TIME'].'",`nume`="'.$rs['title'].'",`pgurl`="'.$rs['link'].'",`srcd`="'.$rs['description'].'",`pubdate`="'.strtotime($rs['lastBuildDate']).'"WHERE`id`="'.$pid.'"');
$conn->query('DELETE FROM`rss_date`WHERE`rssid`="'.$pid.'"');
$rssitems=$rs['items'];
$numar_items=count($rssitems);
for($i=0;$i<$numar_items;$i++)
{
$rssitem=$rssitems[$i];
$conn->query('INSERT INTO`rss_date`SET`rssid`="'.$pid.'",`nume`="'.$rssitem['title'].'",`link`="'.$rssitem['link'].'",`text`="'.$rssitem['description'].'",`pubdate`="'.strtotime($rssitem['pubDate']).'"');
}
}
else
$conn->query('INSERT INTO`rss_date`SET`rssid`="'.$pid.'",`nume`="Eroare!",`link`="",`text`="Nu este posibila actualizarea!",`pubdate`="'.$_SERVER['REQUEST_TIME'].'"');
}
require'f_conectare.php';
conectare('flux RSS'.$x1,'flux-rss'.$x2);
$head[1]='urmareste fluxul'.$x1;
if($is_pc>1&&$rssinfo[2]!='')
$head[0].='.rotunjit{border:2px solid #eee;box-shadow:0 3px 2px rgba(0,0,0,0.3);border-radius:5px;margin:0 auto}';
$head[5]='<p style="text-align:center">'.($rssinfo[2]!=''?'<a href="/'.$rssinfo[2].'"><img '.($is_pc>1?'class="rotunjit" ':'').'src="/'.$rssinfo[2].'" alt="RSS" width="128" height="128" /></a><a href="/'.$rssinfo[2].'"><img src="'.$domenii_statice[2].'zoom.gif" alt="" /></a>':'<a href="'.$domenii_statice[2].'nopic.jpg"><img src="'.$domenii_statice[2].'nopic.jpg" alt="" width="128" height="128" /></a><a href="'.$domenii_statice[2].'nopic.jpg"><img src="'.$domenii_statice[2].'zoom.gif" alt="" /></a>').'</p>';
$titlu='Flux RSS'.$x1;
require'f_sus.php';
echo$div[4].img('stiri.png',2).'Flux RSS'.$x1.$div[5].$div[10].htmlspecialchars($rssinfo[2]).$div[0];
$elemente=$conn->query('SELECT COUNT(*)FROM`rss_date`WHERE`rssid`="'.$pid.'"')->fetch_row()[0];
if($elemente>0)
{
require'f_data.php';
require'f_paginare1.php';
$items=$conn->query('SELECT`id`,`nume`,`text`,`pubdate`FROM`rss_date`WHERE`rssid`="'.$pid.'"ORDER BY`id`LIMIT '.$limit_start.','.$pe_pagina);
while($item=$items->fetch_row())
{
echo$div[1].'<img src="'.$domenii_statice[2].'spm.gif" alt="" width="16" height="16" />'.htmlspecialchars($item[1]).'<br />Descriere: '.htmlspecialchars($item[2]).'<br /><small>Data publicării: '.data($item[3]).'</small><br />'.img('world.png',2).$div[0];
}
require'f_paginare2.php';
}
else
echo$div[7].'Momentan nu sunt actualizari!'.$div[0];
}
else
{
http_response_code(410);
$titlu='Eroare!';
require'f_sus.php';
echo$div[4].'<img src="'.$domenii_statice[2].'actiune_delete.png" alt="" width="16" height="16" />Eroare!'.$div[5].$div[7].'Acest flux nu a fost găsit!<br />Probabil a fost șters!'.$div[0];
}
require'f_jos.php';