- ';
$e = 0;
foreach ($rss->channel->item as $item){
setlocale(LC_TIME, 'french.UTF-8', 'fr_FR.UTF-8'); // ok caractères accentués
date_default_timezone_set('Europe/Paris');
$datetime = date_create($item->pubDate);
$date = date_format($datetime, 'd F Y'); // original
$seconds = time() - strtotime($item->pubDate);
$year = floor($seconds /31556926);
$months = floor($seconds /2629743);
$week=floor($seconds /604800);
$day = floor($seconds /86400);
$hours = floor($seconds / 3600);
$mins = floor(($seconds - ($hours*3600)) / 60);
$secs = floor($seconds % 60);
if($seconds < 60) $time = "Publié à l'instant";
else if($seconds < 3600 ) $time = ($mins==1)? " Publié à l'instant": " Publié il y a ". $mins." minutes";
else if($seconds < 86400) $time = ($hours==1)? " Publié il y a ". $hours. " heure": " Publié il y a ".$hours. " heures";
else if($seconds < 604800) $time = ($day==1)? " Publié il y a ". $day. " jour": " Publié il y a ".$day. " jours";
else if($seconds < 2629743) $time = ($week==1)? " Publié il y a ". $week. " semaine": " Publié il y a ".$week. " semaines";
else if($seconds < 31556926) $time = ($months==1)? " Publié il y a ". $months." mois": " Publié il y a ".$months." mois";
else $time = ($year==1)? " Publié il y a ". $year. " an": " Publié il y a ".$year. " ans";
// return $time;
echo "
- link')\">".$item->title. "" ;
echo ''. '' . $time . ''; echo 'le '. $hDate = strftime("%A %d %B %G", strtotime($item->pubDate)).''; echo 'à ' . $hDate = strftime("%H:%M:%S", strtotime($item->pubDate)). ''; echo ''.''. ''; echo '
' .$item->description.'
'.' ';
$e = $e +1;
// ajout par albert pub google -----------------------------
if (
($e ==4) ||
($e ==10) ||
($e ==16) ||
($e ==23) ||
($e ==29) ||
($e ==35)
)
{
echo
' - '. ''. ''. ''. ''. ''. /* pour evite que la pub deborde*/ ' '; } } echo '
';
echo '
';
?>