display changes when recent only

This commit is contained in:
quenousimporte 2025-02-03 17:35:36 +01:00
parent e5f5f1a202
commit 57bcc5a5a2
1 changed files with 13 additions and 9 deletions

22
ics.php
View File

@ -94,8 +94,18 @@ $recentonly = isset($params['recentonly']);
$weblink = isset($params['weblink']) ? $params['weblink'] : ''; $weblink = isset($params['weblink']) ? $params['weblink'] : '';
$html = "<h1>Evénements à venir</h1>"; $html = "<h1>Evénements à venir</h1>";
$html .= "<h2>" . strftime('%A, %e %B %Y %H:%M') . "</h2>";
$html .= "<div>En gras: modifié les $recent derniers jours</div>"; $html .= "<div>";
if ($recentonly)
{
$html .= "M";
}
else
{
$html .= "En gras: m";
}
$html .= "odifié les $recent derniers jours</div>";
if ($weblink) { if ($weblink) {
$html .= "<div><a target=\"_blank\" href=\"$weblink\">Lien vers calendrier web</a></div>"; $html .= "<div><a target=\"_blank\" href=\"$weblink\">Lien vers calendrier web</a></div>";
} }
@ -129,15 +139,9 @@ 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()) . "\">";
if ($e['DTSTAMP'] >= $lastmodified) {
$line .= "<b>";
}
$line .= "$formatteddate: " . $e['SUMMARY']; $line .= "$formatteddate: " . $e['SUMMARY'];
if ($e['DTSTAMP'] >= $lastmodified) {
$line .= "</b>";
}
$line .= '</li>'; $line .= '</li>';
if ($e['DTSTAMP'] >= $lastmodified) { if ($e['DTSTAMP'] >= $lastmodified && !$recentonly) {
$line = "<b>$line</b>"; $line = "<b>$line</b>";
} }
$html .= $line; $html .= $line;