Gere en cas de flux rss invalide sur la page d'accueil
This commit is contained in:
parent
8f67797f3b
commit
efc0e5881b
|
@ -58,6 +58,7 @@ if (file_exists($cache_file) && $timedif < $cache_time) {
|
|||
}
|
||||
$xml = @simplexml_load_string($string);
|
||||
|
||||
if ( ! $xml === FALSE ) {
|
||||
echo '<div align="center"><table class="tedit" cellspacing="0" cellpadding="6">';
|
||||
echo "<tr><th colspan='2'><a target='_blank' style='font-size: 18px;font-weight: bold;color: #10507C;' href='".$xml->channel->link."'>".$xml->channel->title."</a><br/><i>".$xml->channel->description."</i></th></tr>";
|
||||
//echo '<tr><th>'._("Title").'</th><th>'._("Date").'</th></tr>';
|
||||
|
@ -65,17 +66,17 @@ $count = 0;
|
|||
$max = 5;
|
||||
foreach ($xml->channel->item as $val) {
|
||||
if ($count < $max) {
|
||||
echo '
|
||||
<tr>
|
||||
<td '.(empty($val->pubDate)?'colpan=2':'').'><a target="_blank" href="'.$val->link.'">'.$val->title.'</a></td>';
|
||||
if (!empty($val->pubDate)) { echo '<td>'.strftime("%d/%m/%Y" , strtotime($val->pubDate)).'</td>'; }
|
||||
echo "<tr>\n<td ".(empty($val->pubDate)?'colpan=2':'').'><a target="_blank" href="'.$val->link.'">'.$val->title.'</a></td>';
|
||||
if (!empty($val->pubDate)) {
|
||||
echo '<td>'.strftime("%d/%m/%Y" , strtotime($val->pubDate)).'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
} //foreach
|
||||
echo "</table></div>\n";
|
||||
echo "<br/>";
|
||||
|
||||
} // $xml === FALSE
|
||||
} // empty feed_url
|
||||
|
||||
if($admin->enabled) {
|
||||
|
|
Loading…
Reference in New Issue