summaryrefslogtreecommitdiff
path: root/templates/themes
diff options
context:
space:
mode:
authorAppleman1234 <applemansigloo@gmail.com>2016-12-15 18:25:42 +0900
committerGitHub <noreply@github.com>2016-12-15 18:25:42 +0900
commitcae526e65a20f3da2d8884c4d8e8978c54120000 (patch)
tree2954153dd49f616f5018490058ff4bfbd17300d3 /templates/themes
parentb58fab98147a92c8e6d22f15d23684508b6bb811 (diff)
parent5feae402cb55d49963bfd2c6f5a33d10690ecbc1 (diff)
Merge pull request #79 from lainchan/clean_prod_vichan_update
Merge vichan changes from upstream and changes directly applied to the site.
Diffstat (limited to 'templates/themes')
-rw-r--r--templates/themes/basic/index.html10
-rw-r--r--templates/themes/catalog/catalog.html31
-rw-r--r--templates/themes/catalog/index.rss19
-rw-r--r--templates/themes/catalog/info.php7
-rw-r--r--templates/themes/catalog/theme.php98
-rw-r--r--templates/themes/categories/news.html8
-rw-r--r--templates/themes/donate/donate.html36
-rw-r--r--templates/themes/donate/info.php45
-rw-r--r--templates/themes/frameset/news.html8
-rw-r--r--templates/themes/irc/info.php17
-rw-r--r--templates/themes/irc/irc.html39
-rw-r--r--templates/themes/irc/radio.html29
-rw-r--r--templates/themes/public_banlist/theme.php2
-rw-r--r--templates/themes/radio/info.php9
-rw-r--r--templates/themes/radio/radio.html66
-rw-r--r--templates/themes/rand/theme.php1
-rw-r--r--templates/themes/recent/recent.css8
-rw-r--r--templates/themes/recent/recent.html10
-rw-r--r--templates/themes/recent/theme.php9
-rwxr-xr-xtemplates/themes/rss/info.php75
-rw-r--r--templates/themes/rss/rss.xml28
-rwxr-xr-xtemplates/themes/rss/theme.php127
-rw-r--r--templates/themes/semirand/theme.php1
-rw-r--r--templates/themes/sitemap/theme.php6
-rw-r--r--templates/themes/stream/info.php80
-rw-r--r--templates/themes/stream/stream.html88
-rw-r--r--templates/themes/stream/theme.php34
-rw-r--r--templates/themes/stream/thumb.pngbin0 -> 7872 bytes
-rw-r--r--templates/themes/ukko/theme.php27
29 files changed, 772 insertions, 146 deletions
diff --git a/templates/themes/basic/index.html b/templates/themes/basic/index.html
index 3e83f919..ad5b92ca 100644
--- a/templates/themes/basic/index.html
+++ b/templates/themes/basic/index.html
@@ -12,7 +12,7 @@
<!--{% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %}-->
{% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %}
</head>
-<body>
+<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %}" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
<div class="bar top">
{{ boardlist.top }}
</div>
@@ -41,10 +41,10 @@
<hr/>
<footer>
- <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> +
- <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} -
- <br><a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group
- <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2015 vichan-devel</p>
+ <p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard +
+ <a href="https://engine.vichan.net/">vichan</a> {{ config.version }} -
+ <br>Tinyboard Copyright &copy; 2010-2014 Tinyboard Development Group
+ <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel</p>
</footer>
</body>
</html>
diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html
index f23298bf..ac19a90e 100644
--- a/templates/themes/catalog/catalog.html
+++ b/templates/themes/catalog/catalog.html
@@ -4,12 +4,13 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script type='text/javascript'>
- active_page = "catalog";
+ var active_page = "catalog"
+ , board_name = "{{ board }}";
</script>
+ <title>{{ settings.title }} ( /{{ board }}/ )</title>
{% include 'header.html' %}
- <title>{{ settings.title }} (/{{ board }}/)</title>
</head>
-<body class="theme-catalog board-{{ board }}">
+<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} theme-catalog active-catalog" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
<div class="top bar topbar">
{{ boardlist.top }}
</div>
@@ -41,15 +42,17 @@
<option value="large">{% trans 'Large' %}</option>
</select>
</div>
-
- <div class="threads">
- <ul id="Grid">
- {% for post in recent_posts %}
- <li class="mix"
+ <br></br>
+ <div class="threads">
+ <div id="Grid">
+ {% for post in recent_posts %}
+ <div class="mix"
data-reply="{{ post.reply_count }}"
- data-bump="{{ post.bump }}"
- data-time="{{ post.time }}"
- data-board="{{ post.board }}"
+ data-bump="{{ post.bump }}"
+ data-time="{{ post.time }}"
+ data-id="{{ post.id }}"
+ data-sticky="{% if post.sticky %}true{% else %}false{% endif %}"
+ data-locked="{% if post.locked %}true{% else %}false{% endif %}"
>
<div class="thread grid-li grid-size-small">
<a href="{{post.link}}">
@@ -61,7 +64,7 @@
id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('%b %d %H:%M')}}">
</a>
<div class="replies">
- <strong>R: {{ post.reply_count }} / I: {{ post.image_count }}</strong>
+ <strong>R: {{ post.reply_count }} / I: {{ post.image_count }}{% if post.sticky %} (sticky){% endif %}</strong>
{% if post.subject %}
<p class="intro">
<span class="subject">
@@ -75,9 +78,9 @@
{{ post.body }}
</div>
</div>
- </li>
+ </div>
{% endfor %}
- </ul>
+ </div>
</div>
<hr/>
diff --git a/templates/themes/catalog/index.rss b/templates/themes/catalog/index.rss
new file mode 100644
index 00000000..e6576ffc
--- /dev/null
+++ b/templates/themes/catalog/index.rss
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
+<channel>
+ <title>/{{ board.uri }}/ - {{ board.title|e }}</title>
+ <link>{{ config.root }}{{ board.uri }}/</link>
+ <description>Live feed of new threads on the board /{{ board.uri }}/ - {{ board.title|e }}.</description>
+ <atom:link href="{{ config.root }}{{ board.uri }}/index.rss" rel="self" type="application/rss+xml"/>
+ {% for post in recent_posts %}
+ <item>
+ <title>{% if post.subject %}{{ post.subject|e }}{% else %}{{ post.body_nomarkup[:256]|remove_modifiers|e }}{% endif %}</title>
+ <link>{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html</link>
+ <guid>{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html</guid>
+ <comments>{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html</comments>
+ <pubDate>{{ post.pubdate }}</pubDate>
+ <description><![CDATA[ <a href='{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html' target=_blank><img style='float:left;margin:8px' border=0 src='{% if not config.uri_thumb %}{{ config.root }}{% endif %}{{ post.file }}'></a> {{ post.body }} ]]></description>
+ </item>
+ {% endfor %}
+</channel>
+</rss>
diff --git a/templates/themes/catalog/info.php b/templates/themes/catalog/info.php
index e2b13307..66c45082 100644
--- a/templates/themes/catalog/info.php
+++ b/templates/themes/catalog/info.php
@@ -47,6 +47,13 @@
);
$theme['config'][] = Array(
+ 'title' => 'Enable Rand catalog',
+ 'name' => 'enable_rand',
+ 'type' => 'checkbox',
+ 'default' => false,
+ 'comment' => 'Enable catalog for the Rand theme. This requires the Rand theme to be enabled.'
+ );
+ $theme['config'][] = Array(
'title' => 'Use tooltipster',
'name' => 'use_tooltipster',
'type' => 'checkbox',
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php
index 9ecdb9d1..3ef974c3 100644
--- a/templates/themes/catalog/theme.php
+++ b/templates/themes/catalog/theme.php
@@ -15,23 +15,30 @@
// - post-thread (a thread has been made)
if ($action === 'all') {
foreach ($boards as $board) {
- if ($config['smart_build']) {
+ $b = new Catalog($settings);
+
+ $action = generation_strategy("sb_catalog", array($board));
+ if ($action == 'delete') {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
- } else {
- $b->build($board);
+ file_unlink($config['dir']['home'] . $board . '/index.rss');
+ }
+ elseif ($action == 'rebuild') {
+ $b->build($settings, $board);
}
}
- } elseif (in_array($board, $boards) &&
- $action == 'post-thread' ||
- ($settings['update_on_posts'] && $action == 'post') ||
- ($settings['update_on_posts'] && $action == 'post-delete'))
- {
- if ($config['smart_build']) {
+ } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && in_array($board, $boards)) {
+ $b = new Catalog($settings);
+
+ $action = generation_strategy("sb_catalog", array($board));
+ if ($action == 'delete') {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
- } else {
- $b->build($board);
+ file_unlink($config['dir']['home'] . $board . '/index.rss');
}
- }
+ elseif ($action == 'rebuild') {
+ $b->build($settings, $board);
+ }
+
+ }
// FIXME: Check that Ukko is actually enabled
if ($settings['enable_ukko'] && (
@@ -40,6 +47,14 @@
{
$b->buildUkko();
}
+
+ // FIXME: Check that Rand is actually enabled
+ if ($settings['enable_rand'] && (
+ $action === 'all' || $action === 'post' ||
+ $action === 'post-thread' || $action === 'post-delete'))
+ {
+ $b->buildRand();
+ }
}
// Wrap functions in a class so they don't interfere with normal Tinyboard operations
@@ -90,14 +105,56 @@
$this->saveForBoard($ukkoSettings['uri'], $recent_posts,
$config['root'] . $ukkoSettings['uri']);
}
+
+ /**
+ * Build and save the HTML of the catalog for the Rand theme
+ */
+ public function buildRand() {
+ global $config;
+
+ $randSettings = themeSettings('rand');
+ $queries = array();
+ $threads = array();
+
+ $exclusions = explode(' ', $randSettings['exclude']);
+ $boards = array_diff(listBoards(true), $exclusions);
+
+ foreach ($boards as $b) {
+ if (array_key_exists($b, $this->threadsCache)) {
+ $threads = array_merge($threads, $this->threadsCache[$b]);
+ } else {
+ $queries[] = $this->buildThreadsQuery($b);
+ }
+ }
+
+ // Fetch threads from boards that haven't beenp processed yet
+ if (!empty($queries)) {
+ $sql = implode(' UNION ALL ', $queries);
+ $res = query($sql) or error(db_error());
+ $threads = array_merge($threads, $res->fetchAll(PDO::FETCH_ASSOC));
+ }
+
+ // Sort in bump order
+ usort($threads, function($a, $b) {
+ return strcmp($b['bump'], $a['bump']);
+ });
+ // Generate data for the template
+ $recent_posts = $this->generateRecentPosts($threads);
+
+ $this->saveForBoard($randSettings['uri'], $recent_posts,
+ $config['root'] . $randSettings['uri']);
+ }
/**
* Build and save the HTML of the catalog for the given board
*/
- public function build($board_name) {
- if (!openBoard($board_name)) {
- error(sprintf(_("Board %s doesn't exist"), $post['board']));
- }
+ public function build($settings, $board_name) {
+ global $config, $board;
+ if ($board['uri'] != $board_name) {
+ if (!openBoard($board_name)) {
+ error(sprintf(_("Board %s doesn't exist"), $board_name));
+ }
+ }
if (array_key_exists($board_name, $this->threadsCache)) {
$threads = $this->threadsCache[$board_name];
@@ -163,10 +220,13 @@
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
}
}
+ } else {
+ $post['file'] = $config['root'] . $config['image_deleted'];
}
if (empty($post['image_count']))
$post['image_count'] = 0;
+ $post['pubdate'] = date('r', $post['time']);
$posts[] = $post;
}
@@ -200,5 +260,11 @@
'board' => $board_name,
'link' => $board_link
)));
+
+ file_write($config['dir']['home'] . $board_name . '/index.rss', Element('themes/catalog/index.rss', Array(
+ 'config' => $config,
+ 'recent_posts' => $recent_posts,
+ 'board' => $board
+ )));
}
}
diff --git a/templates/themes/categories/news.html b/templates/themes/categories/news.html
index 95b330b6..4ce65128 100644
--- a/templates/themes/categories/news.html
+++ b/templates/themes/categories/news.html
@@ -32,10 +32,10 @@
</div>
<footer>
- <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> +
- <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} -
- <br><a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group
- <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2015 vichan-devel</p>
+ <p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard +
+ <a href="https://engine.vichan.net/">vichan</a> {{ config.version }} -
+ <br>Tinyboard Copyright &copy; 2010-2014 Tinyboard Development Group
+ <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel</p>
</footer>
</body>
</html>
diff --git a/templates/themes/donate/donate.html b/templates/themes/donate/donate.html
index 73c06cb4..1047cf56 100644
--- a/templates/themes/donate/donate.html
+++ b/templates/themes/donate/donate.html
@@ -7,6 +7,7 @@
<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"/>
+ <link rel="stylesheet" media="screen" href="/stylesheets/progressbar.css"/>
{% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %}
</head>
<body>
@@ -16,32 +17,35 @@
<h1>{{ settings.title }}</h1>
<div class="subtitle">{{ settings.subtitle }}</div>
</header>
-
+<center>
<img alt="mascot" src="/static/lain_is_cute_datass_small.png"/>
-
- <div class="ban">
+</center>
+ <div class="ban">
<h2>Thanks for donating</h2>
- <p>The server costs $55 per month. If you buy stickers we get about 45-55% of whatever you spend. I have to pay my phone bill to keep two-factor authentication working thats $45 (I pay this myself if im not homeless for the month). I just purchased a few lainchan related domains with whatever BTC we had. $50 or so of donations needs to go to darkengine soon to reimburse him for stickers. I have to pay the bill for my Macbook too sometimes. I want to spend a bunch of donation money on a bulk order of stickers and give em away as prizes or just spam shit in the city. FOOFDOOF is the top donator, hes given us like almost $1000. Sometimes I spend the donation money on food when i'm starving. I transfer all donations into, and keep them as cash.
-
+ <p>The server costs {{ settings.monthlyamount }} per month. If you buy stickers we get about 45-55% of whatever you spend. Historical donation records to the former owner are ForeverN2Dust is the top donator, giving about $3000. FOOFDOOF is #2 with $1000 and lots of cheap Chinese shit. Please specify what you'd like your money to go towards. If you don't want to buy stickers, but want to donate something else please either ask in /q/ or contact the Lainchan administration on IRC at #lainchan on Freenode.
</p>
-<p> The most secure and private way to donate is probably to send cash in the mail to me, but this option is only available to select people until I set up a PO box or something.</p>
- <p>https://www.stickermule.com/marketplace/tags/lainchan</p>
+ <p><a href="https://www.stickermule.com/marketplace/tags/lainchan"> Buy stickers here</a>
+</p>
- <p> Localbitcoins.com is a good place to buy BTC. You can donate BTC to this address: 18CshTkxW6HRFoBhXo9mLJcjkReMmjvuq9</p>
- <img src="https://www.lainchan.org/static/btc.jpg" alt="buttcoin qr">
+<p>Monthly Funding Progress Bar</p>
- <p> The absolute fastest way for me to receive and process the money is with a Credit/Debit/Prepaid card via paypal here:</p>
+<p>Cost per month {{ settings.monthlyamount }}</p>
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
-<input type="hidden" name="cmd" value="_s-xclick">
-<input type="hidden" name="hosted_button_id" value="95LE9PHD8P5NU">
-<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
-<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
-</form>
+<p>Funds from stickers {{ settings.stickeramount }} </p>
+<p>Funds from other donations {{ settings.otheramount }} </p>
+
+<div class="container">
+ <div class="{{ settings.progressbarcssclass }}">
+ <span style="width:{{ settings.progressbarcsswidth }};position:relative;left:{{ settings.progressbarcssleft }}%;
+ "> </span>
+</div>
+<div id="value" style="position:relative;left:{{ settings.progressbartextcssleft }}px;top:-45px;color:#0000ff;">{{ settings.currentprogress }}</div>
+</div>
</div>
+
</body>
</html>
{% endfilter %}
diff --git a/templates/themes/donate/info.php b/templates/themes/donate/info.php
index fa3f649b..751f8a23 100644
--- a/templates/themes/donate/info.php
+++ b/templates/themes/donate/info.php
@@ -17,7 +17,50 @@ $theme = array(
array('title' => 'File',
'name' => 'file',
'type' => 'text',
- 'default' => 'donate.html')),
+ 'default' => 'donate.html'),
+
+ array('title' => 'Monthly Amount',
+ 'name' => 'monthlyamount',
+ 'type' => 'text',
+ 'default' => '$0'),
+
+
+ array('title' => 'Current Sticker Amount',
+ 'name' => 'stickeramount',
+ 'type' => 'text',
+ 'default' => '$0'),
+
+ array('title' => 'Current Other Donations Amount',
+ 'name' => 'otheramount',
+ 'type' => 'text',
+ 'default' => '$0'),
+
+ array('title' => 'Current Progress',
+ 'name' => 'currentprogress',
+ 'type' => 'text',
+ 'default' => '$0'),
+
+ array('title' => 'Progress Bar CSS class',
+ 'name' => 'progressbarcssclass',
+ 'type' => 'text',
+ 'default' => 'progress-bar green glow'),
+
+
+ array('title' => 'Progress Bar CSS width',
+ 'name' => 'progressbarcsswidth',
+ 'type' => 'text',
+ 'default' => '15%'),
+
+ array('title' => 'Progress Bar CSS left',
+ 'name' => 'progressbarcssleft',
+ 'type' => 'text',
+ 'default' => '51'),
+
+ array('title' => 'Progress Bar Text CSS left',
+ 'name' => 'progressbartextcssleft',
+ 'type' => 'text',
+ 'default' => '195'),
+ ),
'build_function' => 'donate_build');
?>
diff --git a/templates/themes/frameset/news.html b/templates/themes/frameset/news.html
index 9f779b74..320c64d3 100644
--- a/templates/themes/frameset/news.html
+++ b/templates/themes/frameset/news.html
@@ -31,10 +31,10 @@
</div>
<footer>
- <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> +
- <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} -
- <br><a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group
- <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2015 vichan-devel</p>
+ <p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard +
+ <a href="https://engine.vichan.net/">vichan</a> {{ config.version }} -
+ <br>Tinyboard Copyright &copy; 2010-2014 Tinyboard Development Group
+ <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel</p>
</footer>
</body>
</html>
diff --git a/templates/themes/irc/info.php b/templates/themes/irc/info.php
index 8b31b011..8ca3be0a 100644
--- a/templates/themes/irc/info.php
+++ b/templates/themes/irc/info.php
@@ -17,7 +17,22 @@ $theme = array(
array('title' => 'File',
'name' => 'file',
'type' => 'text',
- 'default' => 'irc.html')),
+ 'default' => 'irc.html'),
+
+ array('title' => 'Channel',
+ 'name' => 'channel',
+ 'type' => 'text',
+ 'default' => 'general'),
+
+ array('title' => 'Server',
+ 'name' => 'server',
+ 'type' => 'text',
+ 'default' => 'irc.lainchan.org'),
+
+ array('title' => 'Port',
+ 'name' => 'port',
+ 'type' => 'text',
+ 'default' => '6697')),
'build_function' => 'irc_build');
?>
diff --git a/templates/themes/irc/irc.html b/templates/themes/irc/irc.html
index 9fadff99..7aa617cf 100644
--- a/templates/themes/irc/irc.html
+++ b/templates/themes/irc/irc.html
@@ -1,48 +1,29 @@
{% filter remove_whitespace %}
<!DOCTYPE html>
-<html style="height:100vh; width:100%;">
+<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/cyberpunk.css"/>
+ <link rel="stylesheet" media="screen" href="/stylesheets/dark.css"/>
+ <link rel="stylesheet" media="screen" href="/stylesheets/dark_irc.css"/>
<link rel="stylesheet" href="/stylesheets/font-awesome/css/font-awesome.min.css">
- </head>
- <body style="background-image: url(/bg.php); background-size:cover; background-repeat:no-repeat; height:100vh; width: inherit; margin:none; padding:none; overflow-x:hidden; overflow-y:hidden;">
- <div class="bar top">
- {{ boardlist.top }}
+</head>
+ <body>
+ <div class="bar top">
+ {{ boardlist.top }}
</div>
- {% if config.url_banner %}<img class="board_image" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
<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="background-color: black; text-align: left!important;">
- <h2>WELCOME TO CYBERIA</h2>
-
- <p>Welcome to lainchan's #BADA55 radio stream. <br/>Statistics
- about this stream such as current listeners, song title, et
- cetera will soon be added to this page.
- </p>
-
- <ul>
-
- <li><a href="https://lainchan.org/static/lain.ogg.m3u">Vorbis M3U Playlist</a></li>
- <li><a href="https://lainchan.org/static/lain.mp3.m3u">MP3 M3U Playlist</a></li>
-
- XSPF considered harmful.
- </ul>
-
- <audio controls preload="none" style="margin: 0 5% 20px 5%; width: 90%; box-shadow: 0px 0px 5px black;">
- <source src="https://lainchan.org/radio_assets/lain.ogg" type="audio/ogg">
- <source src="https://lainchan.org/radio_assets/lain.mp3" type="audio/mpeg">
- <em>Your browser lacks support for OGG Vorbis files. Please open the M3U file or XSPF file in a multimedia player.</em>
- </audio>
+ <div class="ban" style="text-align: left!important;">
+ <h2>Web Client - Point your own clients to #{{ settings.channel }} on {{ settings.server }}:+{{ settings.port }} .</h2>
+ <iframe src="https://kiwiirc.com/client/{{ settings.server }}:+{{ settings.port }}/#{{ settings.channel }}" width="800px" height="100%" scrolling="no"></iframe>
</div>
</body>
</html>
diff --git a/templates/themes/irc/radio.html b/templates/themes/irc/radio.html
deleted file mode 100644
index 7f84134b..00000000
--- a/templates/themes/irc/radio.html
+++ /dev/null
@@ -1,29 +0,0 @@
-{% 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"/>
- <link rel="stylesheet" media="screen" href="/stylesheets/dark_irc.css"/>
- </head>
- <body>
- <div class="bar top">
- {{ boardlist.top }}
- </div>
-
- <header>
- <h1>{{ settings.title }}</h1>
- <div class="subtitle">{{ settings.subtitle }}</div>
- </header>
-
-
- <div class="ban" style="text-align: left!important;">
- <h2>Web Client - Point your own clients to #lainchan on irc.freenode.net.</h2>
- <iframe src="https://webchat.freenode.net?channels=%23lainchan&uio=MTE9MTMz98" width="766" height="400"></iframe>
- </div>
- </body>
-</html>
-{% endfilter %}
diff --git a/templates/themes/public_banlist/theme.php b/templates/themes/public_banlist/theme.php
index c9f7e6f0..62a794dd 100644
--- a/templates/themes/public_banlist/theme.php
+++ b/templates/themes/public_banlist/theme.php
@@ -25,7 +25,7 @@
public static function gen_json($settings) {
ob_start();
- Bans::stream_json(false, true, true, array(), array("/\bcp\b/i"));
+ Bans::stream_json(false, true, true, array(), array("/\bcp\b/i", "/porn/i"));
$out = ob_get_contents();
ob_end_clean();
return $out;
diff --git a/templates/themes/radio/info.php b/templates/themes/radio/info.php
index d6679733..2ae31fbd 100644
--- a/templates/themes/radio/info.php
+++ b/templates/themes/radio/info.php
@@ -17,7 +17,12 @@ $theme = array(
array('title' => 'File',
'name' => 'file',
'type' => 'text',
- 'default' => 'radio.html')),
+ 'default' => 'radio.html'),
+
+ array('title' => 'Radio Status URL',
+ 'name' => 'radiostatus',
+ 'type' => 'text',
+ 'default' => '/radio_assets/status.xsl')),
'build_function' => 'radio_build');
-?> \ No newline at end of file
+?>
diff --git a/templates/themes/radio/radio.html b/templates/themes/radio/radio.html
index 2828b6e0..3e16430e 100644
--- a/templates/themes/radio/radio.html
+++ b/templates/themes/radio/radio.html
@@ -1,29 +1,75 @@
{% filter remove_whitespace %}
<!DOCTYPE html>
-<html>
+<html style="height:100vh; width:100%;">
<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"/>
- <link rel="stylesheet" media="screen" href="/stylesheets/dark_irc.css"/>
+ <link rel="stylesheet" media="screen" href="/stylesheets/cyberpunk.css"/>
<link rel="stylesheet" href="/stylesheets/font-awesome/css/font-awesome.min.css">
-</head>
- <body>
- <div class="bar top">
- {{ boardlist.top }}
+<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function(){
+ check_status();
+ setInterval(check_status, 15000);
+});
+
+function check_status(){
+$.get("{{ settings.radiostatus }}", function(data){
+var el = $( '<div></div>' );
+el.html(data);
+var sd = el.find(".streamdata");
+
+$(".nowplaying").text("Now playing: " + sd[16].textContent);
+
+$(".currentlisteners").text("Current listeners: " + sd[13].textContent); });
+}
+</script>
+ </head>
+ <body style=" background: url(/bg.php) no-repeat center center fixed;
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
+ ">
+ <div class="bar top">
+ {{ boardlist.top }}
</div>
+ {% if config.url_banner %}<img class="board_image" src="{{ config.url_banner }}" {% if config.banner_width or config.banner_height %}style="{% if config.banner_width %}width:{{ config.banner_width }}px{% endif %};{% if config.banner_width %}height:{{ config.banner_height }}px{% endif %}" {% endif %}alt="" />{% endif %}
<header>
<h1>{{ settings.title }}</h1>
<div class="subtitle">{{ settings.subtitle }}</div>
</header>
+ <img alt="mascot" src="static/lain_is_cute_datass_small.png" style="display: block; margin: 0 auto;"/>
+
+ <div class="ban" style="margin-top: 0px!important; background-color: black; text-align: left!important;">
+ <h2>WELCOME TO CYBERIA</h2>
+
+ <p>Welcome to lainchan's radio stream.
+ </p>
+ <noscript><p>Radio statistics will be not be updated without JavaScript, please visit https://lainchan.org/radio_assets/status.xsl to see them directly.</p></noscript>
+
+ <p class="nowplaying"> Now playing:
+ </p>
+ <p class="currentlisteners"> Current listeners:
+ </p>
+
+ <ul>
+
+ <li><a href="https://lainchan.org/static/lain.ogg.m3u">Vorbis M3U Playlist</a></li>
+ <li><a href="https://lainchan.org/static/lain.mp3.m3u">MP3 M3U Playlist</a></li>
+
+ XSPF considered harmful.
+ </ul>
- <div class="ban" style="text-align: left!important;">
- <h2>Web Client - Point your own clients to #lainchan on irc.freenode.net.</h2>
- <iframe src="https://webchat.freenode.net?channels=%23lainchan&uio=MTE9MTMz98" width="766" height="400"></iframe>
+ <audio controls preload="none" style="margin: 0 5% 20px 5%; width: 90%; box-shadow: 0px 0px 5px black;">
+ <source src="https://lainchan.org/radio_assets/lain.ogg" type="audio/ogg">
+ <source src="https://lainchan.org/radio_assets/lain" type="audio/mpeg">
+ <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>
diff --git a/templates/themes/rand/theme.php b/templates/themes/rand/theme.php
index b4cfb4ff..e3814c4e 100644
--- a/templates/themes/rand/theme.php
+++ b/templates/themes/rand/theme.php
@@ -18,6 +18,7 @@
$body = '';
$overflow = array();
$board = array(
+ 'dir' => $this->settings['uri'] . "/",
'url' => $this->settings['uri'],
'name' => $this->settings['title'],
'title' => sprintf($this->settings['subtitle'], $this->settings['thread_limit'])
diff --git a/templates/themes/recent/recent.css b/templates/themes/recent/recent.css
index 1ec5dc50..2559bcc3 100644
--- a/templates/themes/recent/recent.css
+++ b/templates/themes/recent/recent.css
@@ -44,14 +44,14 @@ body
color: #7fdd57;
border: 0px solid #060;
float: left;
- width: 300px;
+ width: 50%;
}
.box.right {
background: #0b000f;
color: #7fdd57;
border: 0px solid #006;
float: right;
- width: 436px;
+ width: 50%;
}
.box h2 {
@@ -170,3 +170,7 @@ div.ban h2:not(:nth-child(1))
{
border-top: 0px solid #0b000f;
}
+
+div.footer{
+clear:both;
+}
diff --git a/templates/themes/recent/recent.html b/templates/themes/recent/recent.html
index 763f8bec..45b627d8 100644
--- a/templates/themes/recent/recent.html
+++ b/templates/themes/recent/recent.html
@@ -9,6 +9,7 @@
<link rel="stylesheet" media="screen" href="https://lainchan.org/stylesheets/font-awesome/css/font-awesome.min.css"/>
{% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}" />{% endif %}
+ {% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %}
</head>
<body>
<div class="bar top">
@@ -22,12 +23,14 @@
</header>
<br>
+ <center>
<img alt="mascot" class="lain_banner"src="static/lain_banner1.png"/>
+ </center>
<br>
- <div class="ban" id="global"> <h2>CYBERPUNK IS DEAD</h2> Pour out the Soykaf, lurk, and read the <a href="https://lainchan.org/rules">rules</a> before posting! </div>
-
+ <div class="ban" id="global2"> <h2>CYBERPUNK IS DUCK</h2> Pour out the Soykaf, lurk, and read the <a href="https://lainchan.org/rules">rules</a> before posting! </div>
+ <center> <img alt="mascot" class="lain_banner" src="static/duck.png"></center>
<br>
<div class="ban" id="global">
@@ -65,13 +68,14 @@
</ul>
</div>
</div>
-
+ <div class="footer">
<footer>
<center>
<a href="mailto:admin@lainchan.org?Subject=Hello" target="_top">admin@lainchan.org</a>
</center>
</footer>
+ </div>
</body>
</html>
{% endfilter %}
diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php
index f44e2529..d4d4e9b8 100644
--- a/templates/themes/recent/theme.php
+++ b/templates/themes/recent/theme.php
@@ -19,16 +19,17 @@
global $config, $_theme;
if ($action == 'all') {
- copy('templates/themes/recent/' . $settings['basecss'], $config['dir']['home'] . $settings['css']);
+ copy('templates/themes/recent/' . $settings['basecss'], $config['dir']['home'] . "stylesheets/" . $settings['css']);
}
$this->excluded = explode(' ', $settings['exclude']);
if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete') {
- if ($config['smart_build']) {
+ $action = generation_strategy('sb_recent', array());
+ if ($action == 'delete') {
file_unlink($config['dir']['home'] . $settings['html']);
}
- else {
+ elseif ($action == 'rebuild') {
file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings));
}
}
@@ -64,7 +65,7 @@
if (isset($post['files']))
$files = json_decode($post['files']);
- if ($files[0]->file == 'deleted') continue;
+ if ($files[0]->file == 'deleted' || $files[0]->thumb == 'file') continue;
// board settings won't be available in the template file, so generate links now
$post['link'] = $config['root'] . $board['dir'] . $config['dir']['res']
diff --git a/templates/themes/rss/info.php b/templates/themes/rss/info.php
new file mode 100755
index 00000000..4da43bf0
--- /dev/null
+++ b/templates/themes/rss/info.php
@@ -0,0 +1,75 @@
+<?php
+ $theme = Array();
+
+ // Theme name
+ $theme['name'] = 'RSS';
+ // Description (you can use Tinyboard markup here)
+ $theme['description'] = 'Show recent posts and images as a RSS';
+ $theme['version'] = 'v0.1';
+
+ // Theme configuration
+ $theme['config'] = Array();
+
+ $theme['config'][] = Array(
+ 'title' => 'Title',
+ 'name' => 'title',
+ 'type' => 'text',
+ 'default' => 'Recent Posts RSS'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Excluded boards',
+ 'name' => 'exclude',
+ 'type' => 'text',
+ 'comment' => '(space seperated)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => '# of recent posts',
+ 'name' => 'limit_posts',
+ 'type' => 'text',
+ 'default' => '30',
+ 'comment' => '(maximum posts to display)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'XML file',
+ 'name' => 'xml',
+ 'type' => 'text',
+ 'default' => 'recent.xml',
+ 'comment' => '(eg. "recent.xml")'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Base URL',
+ 'name' => 'base_url',
+ 'type' => 'text',
+ 'default' => 'http://test.com',
+ 'comment' => '(eg. "http://test.com")'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Show Threads Only',
+ 'name' => 'show_threads_only',
+ 'type' => 'text',
+ 'default' => 'false',
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Enable Per Board',
+ 'name' => 'enable_per_board',
+ 'type' => 'text',
+ 'default' => 'false',
+ );
+
+ // Unique function name for building everything
+ $theme['build_function'] = 'rss_recentposts_build';
+ $theme['install_callback'] = 'rss_recentposts_install';
+
+ if (!function_exists('rss_recentposts_install')) {
+ function rss_recentposts_install($settings) {
+ if (!is_numeric($settings['limit_posts']) || $settings['limit_posts'] < 0)
+ return Array(false, '<strong>' . utf8tohtml($settings['limit_posts']) . '</strong> is not a non-negative integer.');
+ }
+ }
+
diff --git a/templates/themes/rss/rss.xml b/templates/themes/rss/rss.xml
new file mode 100644
index 00000000..6bf34113
--- /dev/null
+++ b/templates/themes/rss/rss.xml
@@ -0,0 +1,28 @@
+{% filter remove_whitespace %}
+<?xml version="1.0" encoding="utf-8"?>
+<rss xmlns:dc="http://purl.org/dc/elements/1.1/"
+ version="2.0">
+ <channel>
+ <description>
+ <![CDATA[{{ settings.subtitle }}]]>
+ </description>
+ <title>{{ settings.title }}</title>
+ <generator>Tinyboard {{ config.version }}</generator>
+ <link>{{ settings.base_url }}{{ config.root }}{{ settings.html }}</link>
+ {% for post in recent_posts %}
+ <item>
+ <title><![CDATA[ {{ post.board_name }} ]]></title>
+ <description>
+ <![CDATA[
+ <a href="{{ settings.base_url }}{{ post.link }}">
+ {{ post.snippet }}
+ </a>
+ ]]>
+ </description>
+ <link>{{ settings.base_url }}{{ post.link }}</link>
+ <guid>{{ settings.base_url }}{{ post.link }}</guid>
+ </item>
+ {% endfor %}
+ </channel>
+</rss>
+{% endfilter %}
diff --git a/templates/themes/rss/theme.php b/templates/themes/rss/theme.php
new file mode 100755
index 00000000..eb833ec8
--- /dev/null
+++ b/templates/themes/rss/theme.php
@@ -0,0 +1,127 @@
+<?php
+ require 'info.php';
+
+ function rss_recentposts_build($action, $settings, $board) {
+ // Possible values for $action:
+ // - all (rebuild everything, initialization)
+ // - news (news has been updated)
+ // - boards (board list changed)
+ // - post (a post has been made)
+ // - post-thread (a thread has been made)
+
+ $b = new RSSRecentPosts();
+ $b->build($action, $settings);
+ }
+
+ // Wrap functions in a class so they don't interfere with normal Tinyboard operations
+ class RSSRecentPosts {
+ public function build($action, $settings) {
+ global $config, $_theme,$board;
+
+
+ $this->excluded = explode(' ', $settings['exclude']);
+ if ($settings['show_threads_only'] == 'true'){
+ if ($action == 'all' || $action == 'post-thread' || $action == 'post-delete')
+ file_write($config['dir']['home'] . $settings['xml'], $this->site_rsspage($settings));
+ }
+ else {
+ if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete')
+ file_write($config['dir']['home'] . $settings['xml'], $this->site_rsspage($settings));
+ }
+
+ if ($settings['enable_per_board'] == 'true'){
+ $boards = listBoards();
+ foreach ($boards as &$_board) {
+ if (in_array($_board['uri'], $this->excluded))
+ continue;
+
+ openBoard($_board['uri']);
+ if ($settings['show_threads_only'] == 'true'){
+ if ($action == 'all' || $action == 'post-thread' || $action == 'post-delete')
+ file_write($config['dir']['home'] . $board['dir'] . $settings['xml'], $this->board_rsspage($settings,$_board));
+ }
+ else {
+ if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete')
+ file_write($config['dir']['home'] . $board['dir'] . $settings['xml'], $this->board_rsspage($settings,$_board));
+ }
+ }
+
+ }
+ }
+
+ // Build news page
+ public function site_rsspage($settings) {
+ global $config, $board;
+
+ $recent_posts = Array();
+
+ $boards = listBoards();
+
+ $query = '';
+ foreach ($boards as &$_board) {
+ if (in_array($_board['uri'], $this->excluded))
+ continue;
+ if ($settings['show_threads_only'] == 'true'){
+ $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` is null UNION ALL ", $_board['uri'], $_board['uri']);
+ }
+ else {
+ $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` UNION ALL ", $_board['uri'], $_board['uri']);
+ }
+ }
+ $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int)$settings['limit_posts'], $query);
+ $query = query($query) or error(db_error());
+
+ while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
+ openBoard($post['board']);
+
+ $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id'];
+ $post['snippet'] = pm_snippet($post['body'], 30);
+ $post['board_name'] = $board['name'];
+
+ $recent_posts[] = $post;
+ }
+
+
+ return Element('themes/rss/rss.xml', Array(
+ 'settings' => $settings,
+ 'config' => $config,
+ 'recent_posts' => $recent_posts,
+ ));
+ }
+
+ // Build news page
+ public function board_rsspage($settings,$_board) {
+ global $config, $board;
+
+ $recent_posts = Array();
+
+ $query = '';
+ if ($settings['show_threads_only'] == 'true'){
+ $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` is null UNION ALL ", $_board['uri'], $_board['uri']);
+ }
+ else {
+ $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` UNION ALL ", $_board['uri'], $_board['uri']);
+ }
+ $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int)$settings['limit_posts'], $query);
+ $query = query($query) or error(db_error());
+
+ while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
+ openBoard($post['board']);
+
+ $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id'];
+ $post['snippet'] = pm_snippet($post['body'], 30);
+ $post['board_name'] = $board['name'];
+
+ $recent_posts[] = $post;
+ }
+
+
+ return Element('themes/rss/rss.xml', Array(
+ 'settings' => $settings,
+ 'config' => $config,
+ 'recent_posts' => $recent_posts,
+ ));
+ }
+ };
+
+?>
diff --git a/templates/themes/semirand/theme.php b/templates/themes/semirand/theme.php
index 1acecbfb..e8d3e56c 100644
--- a/templates/themes/semirand/theme.php
+++ b/templates/themes/semirand/theme.php
@@ -225,6 +225,7 @@
return Element('index.html', array(
'config' => $config,
'board' => array(
+ 'dir' => $this->settings['uri'] . "/",
'url' => $this->settings['uri'],
'title' => $this->settings['title'],
'subtitle' => str_replace('%s', $this->settings['thread_limit'],
diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php
index 52779d53..6bc035bb 100644
--- a/templates/themes/sitemap/theme.php
+++ b/templates/themes/sitemap/theme.php
@@ -23,10 +23,12 @@
}
}
- if ($config['smart_build']) {
+ $action = generation_strategy('sb_sitemap', array());
+
+ if ($action == 'delete') {
file_unlink($settings['path']);
}
- else {
+ elseif ($action == 'rebuild') {
$boards = explode(' ', $settings['boards']);
$threads = array();
diff --git a/templates/themes/stream/info.php b/templates/themes/stream/info.php
new file mode 100644
index 00000000..081b29ca
--- /dev/null
+++ b/templates/themes/stream/info.php
@@ -0,0 +1,80 @@
+<?php
+ $theme = Array();
+
+ // Theme name
+ $theme['name'] = 'Stream';
+ // Description (you can use Tinyboard markup here)
+ $theme['description'] = 'Stream page';
+ $theme['version'] = 'v0.9.1';
+
+ // Theme configuration
+ $theme['config'] = Array();
+
+ $theme['config'][] = Array(
+ 'title' => 'Site title',
+ 'name' => 'title',
+ 'type' => 'text'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Slogan',
+ 'name' => 'subtitle',
+ 'type' => 'text',
+ 'comment' => '(optional)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'File',
+ 'name' => 'file',
+ 'type' => 'text',
+ 'default' => 'stream.html',
+ 'comment' => '(eg. "stream.html")'
+ );
+ $theme['config'][] = Array(
+ 'title' => 'OGV stream URL',
+ 'name' => 'ogvurl',
+ 'type' => 'text',
+ 'default' => 'https://lainchan.org/radio_assets/lainstream.ogg'
+ );
+ $theme['config'][] = Array(
+ 'title' => 'RTMP stream URL',
+ 'name' => 'rtmpurl',
+ 'type' => 'text',
+ 'default' => 'rtmp://lainchan.org/live/stream'
+ );
+ $theme['config'][] = Array(
+ 'title' => 'RTMP Video.JS stream URL',
+ 'name' => 'rtmpvideojsurl',
+ 'type' => 'text',
+ 'default' => 'rtmp://lainchan.org/live/&stream'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'OGV Status URL',
+ 'name' => 'ogvstatus',
+ 'type' => 'text',
+ 'default' => '/radio_assets/status.xsl'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'RTMP Status URL',
+ 'name' => 'rtmpstatus',
+ 'type' => 'text',
+ 'default' => '/live/status?app=live&name=stream'
+ );
+ $theme['config'][] = Array(
+ 'title' => 'RTMP Viewers URL',
+ 'name' => 'rtmpviewers',
+ 'type' => 'text',
+ 'default' => '/live/subs?app=live&name=stream'
+ );
+
+
+ // Unique function name for building everything
+ $theme['build_function'] = 'stream_build';
+ $theme['install_callback'] = 'stream_install';
+ if (!function_exists('stream_install')) {
+ function stream_install($settings) {
+ }
+ }
+
diff --git a/templates/themes/stream/stream.html b/templates/themes/stream/stream.html
new file mode 100644
index 00000000..dc2ed26d
--- /dev/null
+++ b/templates/themes/stream/stream.html
@@ -0,0 +1,88 @@
+{% filter remove_whitespace %}
+<!doctype html>
+<html>
+<head>
+ <link rel="stylesheet" media="screen" href="/stylesheets/style.css">
+ <link href="https://vjs.zencdn.net/5.11.7/video-js.css" rel="stylesheet">
+ <meta charset="utf-8">
+ <title>{{ settings.title }}</title>
+ {% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
+ {% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}">{% endif %}
+ <link rel="stylesheet" media="screen" href="/stylesheets/dark.css">
+ <!--{% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %}-->
+ {% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %}
+<style>
+.video-js { width:100%!important; height: auto!important; }
+</style>
+<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
+
+<script type="text/javascript">
+$(document).ready(function(){
+ check_status();
+ setInterval(check_status, 15000);
+});
+
+function check_status(){
+ $.get("{{ settings.rtmpviewers }}", function(data){
+ $("#rtmpviewers").text(data);
+ });
+
+ $.get("{{ settings.ogvstatus }}", function(data){
+var el = $( '<div></div>' );
+el.html(data);
+var sd = el.find(".streamdata");
+
+$("#ogvnowplaying").text( sd[25].textContent);
+
+$("#ogvviewers").text( sd[22].textContent );
+});
+}
+
+</script>
+</head>
+<body>
+ <div class="bar top">
+ {{ boardlist.top }}
+ </div>
+ <header>
+ <h1>{{ settings.title }}</h1>
+ <div class="subtitle">{{ settings.subtitle }}</div>
+ </header>
+
+ <div>
+ <div id="box" width="100%">
+ <video id="my-video" class="video-js vjs-big-play-centered vjs-default-skin" height="264" width="640" controls preload="auto" poster="https://lainchan.org/static/lain_is_cute_datass_small.png" data-setup='{ "example_option": true, "techOrder": ["html5","flash"],"fluid": true}'>
+ <source src='{{ settings.rtmpvideojsurl }}' type='rtmp/mp4'/>
+ <source src="{{ settings.ogvurl }}" type='video/ogv'>
+ <p class="vjs-no-js">
+ To view this video please enable JavaScript, and consider upgrading to a web browser that
+ <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
+ </p>
+ </video>
+ </div>
+ <br/>
+ <p>Now Streaming RTMP <span id="rtmpnowplaying">unknown</span></p>
+ <p>Now Streaming OGV <span id="ogvnowplaying">unknown</span></p>
+ <p>Current RTMP viewers: <span id="rtmpviewers">unknown</span></p>
+ <p>Current OGV viewers: <span id="ogvviewers">unknown</span></p>
+ <div>
+ <p>Raw stream URLs for Mplayer, mpv, VLC, etc:</p>
+ <p> RTMP : {{ settings.rtmpurl }} </p>
+ <p> OGV : {{ settings.ogvurl }} </p>
+ </div><br/>
+ </div>
+
+ </div>
+
+ <hr/>
+ <footer>
+ <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> +
+ <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} -
+ <br><a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group
+ <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2015 vichan-devel</p>
+ </footer>
+<script src="https://vjs.zencdn.net/5.11.7/video.js"></script>
+</body>
+</html>
+{% endfilter %}
diff --git a/templates/themes/stream/theme.php b/templates/themes/stream/theme.php
new file mode 100644
index 00000000..6d11a0dc
--- /dev/null
+++ b/templates/themes/stream/theme.php
@@ -0,0 +1,34 @@
+<?php
+ require 'info.php';
+
+ function stream_build($action, $settings, $board) {
+ // Possible values for $action:
+ // - all (rebuild everything, initialization)
+ // - boards (board list changed)
+
+ Stream::build($action, $settings);
+ }
+
+ // Wrap functions in a class so they don't interfere with normal Tinyboard operations
+ class Stream {
+ public static function build($action, $settings) {
+ global $config;
+
+ if ($action == 'all' )
+ file_write($config['dir']['home'] . $settings['file'], Stream::homepage($settings));
+ }
+
+ // Build news page
+ public static function homepage($settings) {
+ global $config;
+
+
+ return Element('themes/stream/stream.html', Array(
+ 'settings' => $settings,
+ 'config' => $config,
+ 'boardlist' => createBoardlist(),
+ ));
+ }
+ };
+
+?>
diff --git a/templates/themes/stream/thumb.png b/templates/themes/stream/thumb.png
new file mode 100644
index 00000000..d0c3c771
--- /dev/null
+++ b/templates/themes/stream/thumb.png
Binary files differ
diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php
index 05525299..a3f30dd4 100644
--- a/templates/themes/ukko/theme.php
+++ b/templates/themes/ukko/theme.php
@@ -11,10 +11,16 @@
return;
}
- if ($config['smart_build']) {
+ $action = generation_strategy('sb_ukko', array());
+
+ if ($action == 'delete') {
file_unlink($settings['uri'] . '/index.html');
+ if ($config['api']['enabled']) {
+ $jsonFilename = $settings['uri'] . '/0.json';
+ file_unlink($jsonFilename);
+ }
}
- else {
+ elseif ($action == 'rebuild') {
file_write($settings['uri'] . '/index.html', $ukko->build());
}
}
@@ -28,6 +34,7 @@
$body = '';
$overflow = array();
$board = array(
+ 'dir' => $this->settings['uri'] . "/",
'url' => $this->settings['uri'],
'uri' => $this->settings['uri'],
'name' => $this->settings['title'],
@@ -45,6 +52,9 @@
$count = 0;
$threads = array();
+ if ($config['api']['enabled']) {
+ $apithreads = array();
+ }
while($post = $query->fetch()) {
if(!isset($threads[$post['board']])) {
@@ -86,6 +96,9 @@
$thread->posts = array_reverse($thread->posts);
$body .= '<h2><a href="' . $config['root'] . $post['board'] . '">/' . $post['board'] . '/</a></h2>';
$body .= $thread->build(true);
+ if ($config['api']['enabled']) {
+ array_push($apithreads,$thread);
+ }
} else {
$page = 'index';
if(floor($threads[$post['board']] / $config['threads_per_page']) > 0) {
@@ -99,7 +112,15 @@
$body .= '<script> var overflow = ' . json_encode($overflow) . '</script>';
$body .= '<script type="text/javascript" src="/'.$this->settings['uri'].'/ukko.js"></script>';
-
+
+ // json api
+ if ($config['api']['enabled']) {
+ require_once __DIR__. '/../../../inc/api.php';
+ $api = new Api();
+ $jsonFilename = $board['dir'] . '0.json';
+ $json = json_encode($api->translatePage($apithreads));
+ file_write($jsonFilename, $json);
+ }
return Element('index.html', array(
'config' => $config,
'board' => $board,