parent
57bcc5a5a2
commit
6f37161f4c
27
ics.php
27
ics.php
|
@ -91,24 +91,9 @@ $params = [];
|
||||||
parse_str($_SERVER['QUERY_STRING'], $params);
|
parse_str($_SERVER['QUERY_STRING'], $params);
|
||||||
$recent = isset($params['recent']) ? (int)$params['recent'] : 7;
|
$recent = isset($params['recent']) ? (int)$params['recent'] : 7;
|
||||||
$recentonly = isset($params['recentonly']);
|
$recentonly = isset($params['recentonly']);
|
||||||
$weblink = isset($params['weblink']) ? $params['weblink'] : '';
|
|
||||||
|
|
||||||
$html = "<h1>Evénements à venir</h1>";
|
$html = "<h1>Evénements à venir</h1>";
|
||||||
|
$html .= "<div>Récent : $recent derniers jours</div>";
|
||||||
$html .= "<div>";
|
|
||||||
if ($recentonly)
|
|
||||||
{
|
|
||||||
$html .= "M";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$html .= "En gras: m";
|
|
||||||
}
|
|
||||||
$html .= "odifié les $recent derniers jours</div>";
|
|
||||||
|
|
||||||
if ($weblink) {
|
|
||||||
$html .= "<div><a target=\"_blank\" href=\"$weblink\">Lien vers calendrier web</a></div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$o = ics2json($result);
|
$o = ics2json($result);
|
||||||
$lastmodified = new DateTime();
|
$lastmodified = new DateTime();
|
||||||
|
@ -131,7 +116,7 @@ foreach ($o['VEVENTS'] as $e) {
|
||||||
$group[$year] = [];
|
$group[$year] = [];
|
||||||
}
|
}
|
||||||
if (!isset($group[$year][$month])) {
|
if (!isset($group[$year][$month])) {
|
||||||
$html .= "<h3>$month</h3>";
|
$html .= "<h3>". ucfirst($month) ."</h3>";
|
||||||
$group[$year][$month] = [];
|
$group[$year][$month] = [];
|
||||||
}
|
}
|
||||||
if (!isset($group[$year][$month][$week])) {
|
if (!isset($group[$year][$month][$week])) {
|
||||||
|
@ -139,11 +124,11 @@ foreach ($o['VEVENTS'] as $e) {
|
||||||
$group[$year][$month][$week] = true;
|
$group[$year][$month][$week] = true;
|
||||||
}
|
}
|
||||||
$line = "<li title=\"modifié le " . strftime('%A, %e %B %Y %H:%M', $e['DTSTAMP']->getTimestamp()) . "\">";
|
$line = "<li title=\"modifié le " . strftime('%A, %e %B %Y %H:%M', $e['DTSTAMP']->getTimestamp()) . "\">";
|
||||||
$line .= "$formatteddate: " . $e['SUMMARY'];
|
$line .= ucfirst($formatteddate) . ": " . $e['SUMMARY'];
|
||||||
$line .= '</li>';
|
if ($e['DTSTAMP'] >= $lastmodified) {
|
||||||
if ($e['DTSTAMP'] >= $lastmodified && !$recentonly) {
|
$line .= " 🆕";
|
||||||
$line = "<b>$line</b>";
|
|
||||||
}
|
}
|
||||||
|
$line .= '</li>';
|
||||||
$html .= $line;
|
$html .= $line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue