diff --git a/ics.php b/ics.php index bd2e92f..efca5a9 100644 --- a/ics.php +++ b/ics.php @@ -91,24 +91,9 @@ $params = []; parse_str($_SERVER['QUERY_STRING'], $params); $recent = isset($params['recent']) ? (int)$params['recent'] : 7; $recentonly = isset($params['recentonly']); -$weblink = isset($params['weblink']) ? $params['weblink'] : ''; $html = "

Evénements à venir

"; - -$html .= "
"; -if ($recentonly) -{ - $html .= "M"; -} -else -{ - $html .= "En gras: m"; -} -$html .= "odifié les $recent derniers jours
"; - -if ($weblink) { - $html .= "
Lien vers calendrier web
"; -} +$html .= "
Récent : $recent derniers jours
"; $o = ics2json($result); $lastmodified = new DateTime(); @@ -131,7 +116,7 @@ foreach ($o['VEVENTS'] as $e) { $group[$year] = []; } if (!isset($group[$year][$month])) { - $html .= "

$month

"; + $html .= "

". ucfirst($month) ."

"; $group[$year][$month] = []; } if (!isset($group[$year][$month][$week])) { @@ -139,11 +124,11 @@ foreach ($o['VEVENTS'] as $e) { $group[$year][$month][$week] = true; } $line = "
  • getTimestamp()) . "\">"; - $line .= "$formatteddate: " . $e['SUMMARY']; - $line .= '
  • '; - if ($e['DTSTAMP'] >= $lastmodified && !$recentonly) { - $line = "$line"; + $line .= ucfirst($formatteddate) . ": " . $e['SUMMARY']; + if ($e['DTSTAMP'] >= $lastmodified) { + $line .= " 🆕"; } + $line .= ''; $html .= $line; } }