error) { $rss->parse(); if(count($rss->stories) > 0 ) $feeds = $rss->stories; } // * $strSQL="SELECT * FROM centrum WHERE active=1 AND titulka=1 ORDER BY datum DESC"; $result=mysql_query($strSQL); $numrow=mysql_num_rows($result); for ($i = 0; $i < $numrow; $i++) { $IDcentrum=mysql_result($result, $i, 'IDcentrum'); $nadpis=mysql_result($result, $i, 'nadpis'); $perex=mysql_result($result, $i, 'perex'); $perex=ereg_replace("\n", "
", $perex); $detail=mysql_result($result, $i, 'detail'); $sec=mysql_result($result, $i, 'sec'); $datum=mysql_result($result, $i, 'datum'); error_reporting(E_ALL); $sShowed = false; $sFirst = true; foreach($feeds as $feedindex=>$feed) { if(! $feed) continue; $feeddate = substr($feed->pubdate, 0, 10); if($datum < $feeddate) { if($sFirst) { $sFirst = false; } else { echo "
\n"; } $sShowed = true; $feed->show(false); $feeds[$feedindex] = false; } } $datum=strtotime($datum); $datum=date("j. ", $datum).$mesiace["sk"][date("m", $datum)-1].date(" Y", $datum); $a_datum=mysql_result($result, $i, 'a_datum'); if(! $sShowed) echo "
"; echo "

"; if(strlen($nadpis)>0){ if(strlen($detail)>0){ echo "$nadpis
"; }else{ echo "$nadpis
"; } } if($a_datum==1) echo "$datum   "; if(array_key_exists($sec, $dokusec_pole)) echo "[$dokusec_pole[$sec]]
"; if(strlen($perex)>0){ if(strlen($detail)>0){ echo "$perex"; }else{ echo "$perex"; } } } }else{ // AS-TR: natahovanie RSS feedu if($_REQUEST['sec'] == '8') { require_once('rssreader.php'); $url = 'http://www.euractiv.sk/feed?sid=202'; $rss=new rssFeed($url); if($rss->error){ // ak mame natahovat aj vlastne clanky, nevypiseme nic. echo '



Nie sú zadané žiadne články

'; }else{ $rss->parse(); $rss->showStories(); } } else { $msg_to_page = 10; settype($page, "integer"); if(!$page || $page==1) { $start=0; $page=1; }else { $start=(($page*$msg_to_page)-$msg_to_page); } if(array_key_exists($sec, $dokusec_pole)) echo "

$dokusec_pole[$sec]

"; $max_id=mysql_query("SELECT count(IDcentrum) AS id FROM centrum WHERE active=1 AND sec=$sec"); $max_id=mysql_fetch_array($max_id); $max_id=$max_id['id']; $pages=ceil($max_id/$msg_to_page); $strSQL="SELECT * FROM centrum WHERE active=1 AND sec=$sec ORDER BY datum DESC LIMIT $start, $msg_to_page"; $result=mysql_query($strSQL); $numrow=mysql_num_rows($result); if($numrow==0) echo "



Nie sú zadané žiadne články

"; for ($i = 0; $i < $numrow; $i++) { $IDcentrum=mysql_result($result, $i, 'IDcentrum'); $nadpis=mysql_result($result, $i, 'nadpis'); $perex=mysql_result($result, $i, 'perex'); $perex=ereg_replace("\n", "
", $perex); $detail=mysql_result($result, $i, 'detail'); $sec=mysql_result($result, $i, 'sec'); $datum=mysql_result($result, $i, 'datum'); $datum=strtotime($datum); $datum=date("j. ", $datum).$mesiace["sk"][date("m", $datum)-1].date(" Y", $datum); $a_datum=mysql_result($result, $i, 'a_datum'); echo "

"; if(strlen($nadpis)>0){ if(strlen($detail)>0){ echo "$nadpis
"; }else{ echo "$nadpis
"; } } if($a_datum==1) echo "$datum
"; if(strlen($perex)>0){ if(strlen($detail)>0){ echo "$perex"; }else{ echo "$perex"; } } } echo "

"; echo("\n"); if($page>1) { echo("\n"); echo("\n"); }else{ echo("\n"); echo("\n"); } echo("\n"); if($page<$pages) { echo("\n"); echo("\n"); }else{ echo("\n"); echo("\n"); } echo("
" . $lang_mut["first"]["sk"] . "" . $lang_mut["prew"]["sk"] . "" . $lang_mut["first"]["sk"] . "" . $lang_mut["prew"]["sk"] . "" . $lang_mut["page"]["sk"] . " $page / $pages" . $lang_mut["next"]["sk"] . "" . $lang_mut["last"]["sk"] . "" . $lang_mut["next"]["sk"] . "" . $lang_mut["last"]["sk"] . "
"); echo "
"; } } include("info_bot.php"); ?>