Add radio page

This commit is contained in:
Michael Walker 2014-09-28 19:43:15 +00:00
parent 81bfe2e910
commit 3cd0a6093c
4 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?php
$theme = array(
'name' => 'Radio',
'description' => 'Display a link to the lainchan radio',
'version' => 'v1',
'config' => array(
array('title' => 'Page title',
'name' => 'title',
'type' => 'text'),
array('title' => 'Slogan',
'name' => 'subtitle',
'type' => 'text',
'comment' => '(optional)'),
array('title' => 'File',
'name' => 'file',
'type' => 'text',
'default' => 'radio.html')),
'build_function' => 'radio_build');
?>

View File

@ -0,0 +1,52 @@
{% filter remove_whitespace %}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>{{ settings.title }}</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" media="screen" href="/stylesheets/style.css"/>
<link rel="stylesheet" media="screen" href="/stylesheets/dark.css"/>
</head>
<body>
{{ boardlist.top }}
<header>
<h1>{{ settings.title }}</h1>
<div class="subtitle">{{ settings.subtitle }}</div>
</header>
<img alt="mascot" src="static/lain_is_cute_datass_small.png"/>
<div class="ban" style="text-align: left!important;">
<h2>WELCOME TO CYBERIA</h2>
<p>Welcome to lainchan's very own internet radio!<br/>Statistics
about this stream such as current listeners, song title, et
cetera, can currently be found
at <a href="http://radio.lain.io/">radio.lain.io</a>; they will
soon be added to this page.
</p>
<p><strong>NOTE:</strong> Some experimental browsers, namely
very recent versions of Chromium, have been known to break with
OGG streams. If your connection is choppy, try a either running
the stream in a different browser, or opening one of the
playlists in a media player:</p>
<ul>
<li><a href="http://radio.lain.io/stream/lainchan.m3u">M3U Playlist</a></li>
<li><a href="http://radio.lain.io/stream/lainchan.xspf">XPSF Playlist</a></li>
</ul>
<audio controls=""
preload="none"
src="http://radio.lain.io/stream/lainchan"
type="application/ogg"
style="margin: 0 5%; width: 90%; box-shadow: 0px 0px 5px black;">
<em>Your browser lacks support for OGG Vorbis files. Please open the M3U file or XSPF file in a multimedia player.</em>
</audio>
</div>
</body>
</html>
{% endfilter %}

View File

@ -0,0 +1,27 @@
<?php
require 'info.php';
function radio_build($action, $settings, $board) {
radio::build($action, $settings);
}
class radio {
public static function build($action, $settings) {
global $config;
if ($action == 'all') {
file_write($config['dir']['home'] . $settings['file'], radio::install($settings));
}
}
public static function install($settings) {
global $config;
return Element('themes/radio/radio.html',
array('settings' => $settings,
'config' => $config,
'boardlist' => createBoardlist()));
}
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB