Virtual events
This commit is contained in:
		
							
								
								
									
										11
									
								
								index.php
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								index.php
									
									
									
									
									
								
							@@ -4,6 +4,7 @@ use ICal\ICal;
 | 
			
		||||
static $DATE_FORMAT = 'd.m.Y H:i';
 | 
			
		||||
static $VISITORS_FILE = '/media/sg/dorf.jetzt_visitors';
 | 
			
		||||
static $DORF_IN_LOCKDOWN = true;
 | 
			
		||||
static $DORF_VIRTUAL_EVENTS = true;
 | 
			
		||||
static $ICAL_URL = 'https://chaosdorf.de/~derf/cccd_all.ics';
 | 
			
		||||
$state_map = array(
 | 
			
		||||
	'closed' => (object) array(
 | 
			
		||||
@@ -48,7 +49,7 @@ $hash_to_state = array(
 | 
			
		||||
	'86c75c0ad413b06ff8291673162d0b64' => 'unknown',
 | 
			
		||||
	'0' => 'error',
 | 
			
		||||
);
 | 
			
		||||
if (! $DORF_IN_LOCKDOWN){
 | 
			
		||||
if ($DORF_VIRTUAL_EVENTS || ! $DORF_IN_LOCKDOWN){
 | 
			
		||||
$img = file_get_contents('https://chaosdorf.de/raumstatus/status.png');
 | 
			
		||||
$hash = md5($img);
 | 
			
		||||
$state = $hash_to_state[$hash];
 | 
			
		||||
@@ -102,8 +103,10 @@ $v = file_get_contents($VISITORS_FILE);
 | 
			
		||||
				<i class="material-icons" id="state-icn" style="color:red;font-size:16rem;">lock</i>
 | 
			
		||||
				<p class="card-text font-weight-normal">Das Chaosdorf ist aufgrund <a href="https://www.land.nrw/de/pressemitteilung/landesregierung-beschliesst-weitere-massnahmen-zur-eindaemmung-der-corona-virus">einer Verordnung der Landesregierung</a> geschlossen.</p>
 | 
			
		||||
				<p class="card-text font-weight-normal">Das gilt mindestens bis <span class="font-weight-bold">19. April 2020</span>.</p>
 | 
			
		||||
				<p class="card-text font-weight-normal">Natürlich hört das Chaosdorfleben nicht auf, <span class="font-weight-bold">kommt uns gerne im <a href="https://wiki.chaosdorf.de/VirtualSpace">VirtualSpace</a> besuchen.</span></p>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		
 | 
			
		||||
		<?php else: ?>
 | 
			
		||||
		<div class="card mb-3 text-center">
 | 
			
		||||
			<div class="card-body">
 | 
			
		||||
@@ -115,6 +118,8 @@ $v = file_get_contents($VISITORS_FILE);
 | 
			
		||||
					</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<?php endif ?>
 | 
			
		||||
		<?php if($DORF_VIRTUAL_EVENTS || !$DORF_IN_LOCKDOWN): ?>
 | 
			
		||||
		<div class="card mb-3 text-center">
 | 
			
		||||
			<div class="card-body">
 | 
			
		||||
				<h5 class="card-title">Events</h5>
 | 
			
		||||
@@ -123,6 +128,7 @@ $v = file_get_contents($VISITORS_FILE);
 | 
			
		||||
				<p class="card-text">
 | 
			
		||||
					<h5 class="font-weight-bold"><?= htmlspecialchars($first_event->summary, ENT_QUOTES, 'UTF-8') ?></h5>
 | 
			
		||||
					<span class="font-weight-normal"><?= format_event($first_event) ?></span>
 | 
			
		||||
					<span class="font-weight-normal"><a href="<?= $first_event->url ?>">Details zur Veranstaltung</a></span>
 | 
			
		||||
				</p>
 | 
			
		||||
				<h5 class="card-title">Danach:</h5>
 | 
			
		||||
				<table class="table">
 | 
			
		||||
@@ -131,6 +137,7 @@ $v = file_get_contents($VISITORS_FILE);
 | 
			
		||||
						<tr>
 | 
			
		||||
							<th scope="row"><?=format_event($event)?></th>
 | 
			
		||||
							<td><?= htmlspecialchars($event->summary) ?></td>
 | 
			
		||||
							<td><a href="<?= $first_event->url ?>">Details</a></td>
 | 
			
		||||
						</tr>
 | 
			
		||||
					<?php endforeach ?>
 | 
			
		||||
					</tbody>
 | 
			
		||||
@@ -146,8 +153,8 @@ $v = file_get_contents($VISITORS_FILE);
 | 
			
		||||
				<?php endif ?>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<?php endif ?>
 | 
			
		||||
	</div>
 | 
			
		||||
	<?php endif ?>
 | 
			
		||||
	<footer class="page-footer font-small text-center">
 | 
			
		||||
		<div>
 | 
			
		||||
		Look at the code <a href="https://git.iwonder.name/iwonder/dorf.jetzt">here</a>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user