parent
							
								
									57bcc5a5a2
								
							
						
					
					
						commit
						6f37161f4c
					
				
							
								
								
									
										27
									
								
								ics.php
								
								
								
								
							
							
						
						
									
										27
									
								
								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 = "<h1>Evénements à venir</h1>";
 | 
			
		||||
 | 
			
		||||
$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>";
 | 
			
		||||
}
 | 
			
		||||
$html .= "<div>Récent : $recent derniers jours</div>";
 | 
			
		||||
 | 
			
		||||
$o = ics2json($result);
 | 
			
		||||
$lastmodified = new DateTime();
 | 
			
		||||
| 
						 | 
				
			
			@ -131,7 +116,7 @@ foreach ($o['VEVENTS'] as $e) {
 | 
			
		|||
            $group[$year] = [];
 | 
			
		||||
        }
 | 
			
		||||
        if (!isset($group[$year][$month])) {
 | 
			
		||||
            $html .= "<h3>$month</h3>";
 | 
			
		||||
            $html .= "<h3>". ucfirst($month) ."</h3>";
 | 
			
		||||
            $group[$year][$month] = [];
 | 
			
		||||
        }
 | 
			
		||||
        if (!isset($group[$year][$month][$week])) {
 | 
			
		||||
| 
						 | 
				
			
			@ -139,11 +124,11 @@ foreach ($o['VEVENTS'] as $e) {
 | 
			
		|||
            $group[$year][$month][$week] = true;
 | 
			
		||||
        }
 | 
			
		||||
        $line = "<li title=\"modifié le " . strftime('%A, %e %B %Y %H:%M', $e['DTSTAMP']->getTimestamp()) . "\">";
 | 
			
		||||
        $line .= "$formatteddate: " . $e['SUMMARY'];
 | 
			
		||||
        $line .= '</li>';
 | 
			
		||||
        if ($e['DTSTAMP'] >= $lastmodified && !$recentonly) {
 | 
			
		||||
            $line = "<b>$line</b>";
 | 
			
		||||
        $line .= ucfirst($formatteddate) . ": " . $e['SUMMARY'];
 | 
			
		||||
        if ($e['DTSTAMP'] >= $lastmodified) {
 | 
			
		||||
            $line .= " 🆕";
 | 
			
		||||
        }
 | 
			
		||||
        $line .= '</li>';
 | 
			
		||||
        $html .= $line;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue