Posílám kompletní kód, zjistil jsem že na jiném PC mi to problém nedělá a žádná chybová hláška není. Je tedy možné, že zdroj to v XML výpise již odstranil, ale v cache počítače to stále mám. Kdyby měl někdo čas, poslal bych URL k otestování, zda vám to ukazuje.
JInak kód je tento, červeně označený kód je ten co hlásí chybu:
<?php
require 'XXXXXXX.php';
libxml_use_internal_errors(true);
class EHub
{
function Filter($keywords=false,$page_deals=PAGE_DEALS,$paginate=true)
{
global $EHUB_FEEDS;
if (($feeds=scandir(FEED_DIR)) === false) exit('Cannot open feed directory: '.FEED_DIR);
echo '<div class="ehub_container">';
if (isset($_GET['deal_page']) && is_int((int)$_GET['deal_page']))
{
$from=($page_deals*$_GET['deal_page'])-$page_deals;
$to=$from+$page_deals;
}
else
{
$from=0;
$to=$from+$page_deals;
}
$count=0;
$url_seen=array();
foreach ($feeds as $feed)
{
if ($feed=='.' || $feed=='..' || is_dir(FEED_DIR.$feed)) continue;
$xml=new SimpleXMLElement(file_get_contents(FEED_DIR.$feed));
foreach ($xml->DEAL as $DEAL)
{
// echo "F: $from T: $to C: $count<br/>";
if (in_array($DEAL->URL,$url_seen)) continue;
else $url_seen[]=(string)$DEAL->URL;
//print_r($url_seen);
$DEAL->ORIGINAL_PRICE=preg_replace('/([0-9]+)(\.?.*)/','\1',$DEAL->ORIGINAL_PRICE);
$DEAL->FINAL_PRICE=preg_replace('/([0-9]+)(\.?.*)/','\1',$DEAL->FINAL_PRICE);
if (!isset($DEAL->DISCOUNT))
{
if($DEAL->ORIGINAL_PRICE) {
$DEAL->DISCOUNT=round($DEAL->FINAL_PRICE/$DEAL->ORIGINAL_PRICE*100);
} else {
$DEAL->DISCOUNT = 0;
}
}
else $DEAL->DISCOUNT=preg_replace('/[^0-9]*/','',$DEAL->DISCOUNT);
$DEAL->ORIG_DEAL_START=$DEAL->DEAL_START;$DEAL->ORIG_DEAL_END=$DEAL->DEAL_END;
$DEAL->DEAL_START=date('d.m.Y', strtotime($DEAL->DEAL_START));
$DEAL->DEAL_END=date('d.m.Y', strtotime($DEAL->DEAL_END));
if (strtotime($DEAL->DEAL_END) < time() ) continue;
$DEAL->URL=sprintf('%s?a_aid=%s&a_bid=%s&desturl=%s',EHUB_URL,EHUB_ID,$EHUB_FEEDS[$feed][0],$DEAL->URL);
if (isset($keywords))
{
if (preg_match('/('.str_replace(' ','|',$keywords).')/i',$DEAL->TITLE.$DEAL->URL.$DEAL->TAG.$DEAL->CATEGORY))
{
$count++;$deals[]=$DEAL;
}
}
else
{
$count++;$deals[]=$DEAL;
}
}
}
if (isset($deals) && count($deals))
{
usort($deals, 'self::sortdeal');
for ($i=$from;$i<$to;$i++)
{
if (isset($deals[$i]))
{
$DEAL=$deals[$i];
eval('echo "'.addcslashes(HTML_FORMAT,'"').'";');
}
}
}
$pages=ceil($count / $page_deals);
if ($pages>1 && $paginate)
{
$query_string=array();
parse_str($_SERVER['QUERY_STRING'],$qs);
unset($qs['deal_page']);
foreach ($qs as $k=>$v) $query_string[]="$k=$v";
$query_string=implode('&',$query_string);
if ($from / $page_deals >=1) echo '<a href="?deal_page='.($from/$page_deals).'&'.$query_string.'"><< Předchozí</a> | ';
else echo '<< Předchozí | ';
for ($p=1;$p<=$pages;$p++)
{
if ($p==$from/$page_deals+1) echo " $p | ";
else echo '<a href="?deal_page='.$p.'&'.$query_string.'"> '.$p.'</a> | ';
}
if ($from / $page_deals + 2 <= $pages) echo '<a href="?deal_page='.($from/$page_deals+2).'&'.$query_string.'">Další >></a>';
else echo ' Další >>';
}
echo '</div>';
}
function sortdeal($x,$y)
{
if ($x->DEAL_START==$y->DEAL_START) return 0;
return strtotime($x->DEAL_START)<strtotime($y->DEAL_START) ? 1 : -1; //reverse order
}
}
?>