tidy up formatting

This commit is contained in:
Ben Harris 2021-09-12 20:13:59 -04:00
parent af6bb5e0df
commit e5b4379406
10 changed files with 214 additions and 205 deletions

View File

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://tilde.team/css/hacker.css">
<link rel="stylesheet" href="/css/hacker.css">
<title>tilderadio dj info</title>
</head>

View File

@ -2,6 +2,8 @@
<a href="https://tildegit.org/tilderadio/site">page source</a> | <a href="/dmca.php">DMCA</a>
</footer>
</div>
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
</body>

View File

@ -8,8 +8,8 @@
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/css/hacker.css">
<link rel="stylesheet" href="/css/calendar.css">
<link rel="icon" type="image/png" href="https://tilderadio.org/logos/tilderadio.png"><?=isset($additional_head)?PHP_EOL." ".$additional_head.PHP_EOL:""?>
<link rel="icon" type="image/png" href="/logos/tilderadio.png">
<?=isset($additional_head) ? PHP_EOL . " " . $additional_head . PHP_EOL : ""?>
</head>
<body>
@ -37,3 +37,8 @@
</div>
<br>
<br>
<div class="container">
<h1>
<a href="/"><img style="width:72px;margin-top:-30px;margin-right:5px;" src="/logos/tilderadio.png" alt="">tilderadio.org</a>
</h1>
<hr>

View File

@ -1,16 +1,18 @@
<?php include 'header.php'; ?>
<h1>
<a href="/"><img style="width:72px;margin-top:-30px;margin-right:5px;" src="./logos/tilderadio.png" alt="">tilderadio.org</a>
</h1>
<h4><?=json_decode(file_get_contents("https://bot.tildegit.org/api/slogan"))?></h4>
<blockquote><?=json_decode(file_get_contents("https://bot.tildegit.org/api/slogan"))?></blockquote>
<p>tilderadio is internet radio streamed by / for users of the <a href="https://tildeverse.org/">tildeverse</a>.</p>
<p>
TildeRadio is Internet radio streamed by / for users of the <a href="https://tildeverse.org/">tildeverse</a>.
<a href="https://tilde.chat/kiwi/#tilderadio" target="_blank">Join us in #tilderadio</a>,
our dedicated IRC channel on <a href="https://tilde.chat">tilde.chat</a>
</p>
<p><a href="https://kiwi.tilde.chat/#tilderadio" target="_blank">Join us in #tilderadio</a>, our dedicated IRC channel on <a href="https://tilde.chat">tilde.chat</a></p>
<p>Follow us on Mastodon where we announce when DJ's go live! <a href="https://tilde.zone/@tilderadio" target="_blank">@tilderadio</a></p>
<p>
follow us on mastodon where we announce when DJ's go live!
<a href="https://tilde.zone/@tilderadio" target="_blank">@tilderadio</a>
</p>
<hr>
@ -19,9 +21,7 @@ TildeRadio is Internet radio streamed by / for users of the <a href="https://til
<iframe src="https://azuracast.tilderadio.org/public/tilderadio/embed" style="width: 100%; min-height: 160px; border: 0;"></iframe>
<p>
Or use the following links in your media player of choice:
</p>
<p>Or use the following links in your media player of choice:</p>
<ul>
<li>https://azuracast.tilderadio.org/radio/8000/radio.ogg</li>

View File

@ -1,3 +1,2 @@
<?php
$apikey = "my azuracast api key";

View File

@ -20,16 +20,13 @@ $daterange = new DatePeriod($begin, new DateInterval('P1D'), $end);
<th></th>
<?php
// Loop over our date range to draw the headers
foreach($daterange as $date){
?>
foreach($daterange as $date){ ?>
<th>
<span class="day"><?php echo $date->format("d") ?></span>
<span class="long"><?php echo $date->format("l") ?></span>
<span class="short"><?php echo $date->format("D") ?></span>
</th>
<?php
}
?>
<?php } ?>
</tr>
</thead>
<tbody>
@ -37,17 +34,13 @@ foreach($daterange as $date){
// time will count us by 30-min increments through the day
$time = mktime(0, 0, 0, 1, 1);
// Loop over the day in 30 min increments
for ($i = 0; $i < 86400; $i += 1800) {
?>
for ($i = 0; $i < 86400; $i += 1800) { ?>
<tr>
<?php
// Only show row if we're on a full hour block. It's a rowspan 2
if ((($i / 1800) % 2) === 0 ) {
?>
if ((($i / 1800) % 2) === 0 ) { ?>
<td class="hour" rowspan="2"><span><?php echo date('H', $time + $i) ?>:00</span></td>
<?php
}
?>
<?php } ?>
<?php
$now = new DateTime();
@ -67,6 +60,7 @@ for ($i = 0; $i < 86400; $i += 1800) {
break;
}
}
$active = false;
if (!$wrotepointer) {
// If current time is in this range, draw pointer.
@ -92,9 +86,7 @@ for ($i = 0; $i < 86400; $i += 1800) {
}
?>
</tr>
<?php
}
?>
<?php } ?>
</tbody>
</table>
</section>

View File

@ -25,10 +25,11 @@ echo "PRODID:tilderadio schedule".ICS_EOL;
echo "DTSTAMP:" . ics_formatdate("now") . ICS_EOL;
// A list of event IDs that we have on the calendar, to avoid duplication
$event_ids = array();
$event_ids = [];
foreach ($schedule as $event) {
$id = strval($event["id"]) . gmdate("DHis", strtotime($event["start"])) . gmdate("DHis", strtotime($event["end"]));
if (!in_array($id,$event_ids)) {
array_push($event_ids, $id);
// The VEVENT structure's pretty easy to generate, especially since we're already in UTC.

View File

@ -1,13 +1,19 @@
<?php
$additional_head='<link rel="alternate" type="text/calendar" href="https://tilderadio.org/schedule/ics.php">';
include '../header.php';
$additional_head='<link rel="stylesheet" href="/css/calendar.css">
<link rel="alternate" type="text/calendar" href="https://tilderadio.org/schedule/ics.php">';
include __DIR__ . '/../header.php';
include 'schedule.php';
?>
<h1><a href="https://tilderadio.org"><img style="width:72px;margin-top:-30px;margin-right:5px;" src="../logos/tilderadio.png" alt="tilderadio logo">tilderadio.org</a></h1>
<p>all times in UTC. current time is <span id="utcdate"><?=formatdate("now")?></span>
<span class="pointer-label-wrapper">(</span><span class="pointer-label">&mdash;</span><span class="pointer-label-wrapper">)</span>.</p>
<p>this schedule is also available in <a href="https://icalendar.org/validator.html?url=https://tilderadio.org/schedule/ics.php">iCalendar format</a>. point your calendar client at <code>https://tilderadio.org/schedule/ics.php</code>.</p>
<p>
all times in UTC. current time is <span id="utcdate"><?=formatdate("now")?></span>
<span class="pointer-label-wrapper">(</span><span class="pointer-label">&mdash;</span><span class="pointer-label-wrapper">)</span>.
</p>
<p>
this schedule is also available in <a href="https://icalendar.org/validator.html?url=https://tilderadio.org/schedule/ics.php">iCalendar format</a>.
point your calendar client at <code>https://tilderadio.org/schedule/ics.php</code>.
</p>
<?php
include 'calendar.php';
@ -65,9 +71,13 @@ function getCurrentRange(now) {
// Because PHP gives the time on page load, people who disable Javascript won't be missing out on much.
let months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
let daysOfWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
function update_date() {
var d = new Date();
document.getElementById("utcdate").innerText = daysOfWeek[d.getUTCDay()]+" "+months[d.getUTCMonth()]+" "+d.getUTCDate().toString()+" "+d.getUTCHours().toString().padStart(2,'0')+":"+d.getUTCMinutes().toString().padStart(2,'0');
document.getElementById("utcdate").innerText =
daysOfWeek[d.getUTCDay()] + " " + months[d.getUTCMonth()] + " " +
d.getUTCDate().toString() + " " + d.getUTCHours().toString().padStart(2,'0') +
":" + d.getUTCMinutes().toString().padStart(2,'0');
setTimeout(update_date, 15000);
updatePointer(d);
}
@ -106,7 +116,6 @@ function updatePointer(d) {
}
// Update pointer immediately
updatePointer(new Date());
</script>
<?php include '../footer.php'; ?>
<?php include __DIR__.'/../footer.php'; ?>

View File

@ -36,6 +36,7 @@ if (isset($_GET["json"]) && $_GET["json"] === "yes") {
$data = $schedule[1];
}
echo $data["name"] . " will stream at " . gmdate("D M d H:i", strtotime($data["start"])) . " UTC (in ";
$diff = strtotime($data["start"]) - strtotime("now");
if ($diff < 60) {
echo "" . $diff . " seconds)";