summaryrefslogtreecommitdiff
path: root/templates
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
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')
-rw-r--r--templates/generic_page.html11
-rw-r--r--templates/index.html22
-rw-r--r--templates/installer/config.html3
-rwxr-xr-xtemplates/main.js53
-rw-r--r--templates/mod/ban_form.html2
-rw-r--r--templates/mod/dashboard.html2
-rw-r--r--templates/mod/edit_page.html29
-rw-r--r--templates/mod/log.html16
-rw-r--r--templates/mod/news.html2
-rw-r--r--templates/mod/pages.html34
-rw-r--r--templates/mod/rebuilt.html6
-rw-r--r--templates/mod/view_ip.html2
-rw-r--r--templates/page.html15
-rw-r--r--templates/post/flag.html2
-rw-r--r--templates/post/name.html4
-rw-r--r--templates/post/post_controls.html8
-rw-r--r--templates/post/poster_id.html4
-rw-r--r--templates/post_thread.html15
-rwxr-xr-xtemplates/posts.sql1
-rw-r--r--templates/report.html22
-rw-r--r--templates/report_delete.html21
-rw-r--r--templates/rules.html2
-rw-r--r--templates/search_form.html9
-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
-rw-r--r--templates/thread.html61
53 files changed, 1038 insertions, 226 deletions
diff --git a/templates/generic_page.html b/templates/generic_page.html
index 3ff200f9..cc076106 100644
--- a/templates/generic_page.html
+++ b/templates/generic_page.html
@@ -8,7 +8,7 @@
</head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
-<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 %}">
{{ boardlist.top }}
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
{% if config.url_banner %}<img class="banner" 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 %}
@@ -39,9 +39,12 @@
{{ boardlist.bottom }}
<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>
+ <a href='https://int.vichan.net/devel/'>vichan</a> +
+ <a href='https://github.com/lainchan/lainchan'>lainchan</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-2016 vichan-devel
+ <br><a href="https://github.com/lainchan/lainchan">lainchan</a> Copyright &copy; 2014-2016 lainchan Administration</p>
+
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
</footer>
<script type="text/javascript">{% raw %}
diff --git a/templates/index.html b/templates/index.html
index 1878d455..ae9af59a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -5,21 +5,23 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<script type="text/javascript">
+ var
{% if not no_post_form %}
- var active_page = "index";
+ active_page = "index"
+ , board_name = "{{ board.uri }}";
{% else %}
- var active_page = "ukko";
+ active_page = "ukko";
{% endif %}
</script>
{% include 'header.html' %}
<title>{{ board.url }} - {{ board.title|e }}</title>
</head>
-<body>
+<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} active-{% if not no_post_form %}index{% else %}ukko{% endif %}" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
<div class="bar top">
{{ boardlist.top }}
</div>
-
+
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
{% 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 %}
@@ -58,12 +60,20 @@
{% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %}
<hr />
+ {% if config.catalog_link %}
+ | <a href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">Catalog</a>
+ {% endif %}
+ <hr />
+
<form name="postcontrols" action="{{ config.post_url }}" method="post">
<input type="hidden" name="board" value="{{ board.uri }}" />
{% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
{{ body }}
{% include 'report_delete.html' %}
</form>
+
+
+ {{ boardlist.bottom }}
{{ config.ad.bottom }}
@@ -72,8 +82,8 @@
<a href='https://int.vichan.net/devel/'>vichan</a> +
<a href='https://github.com/lainchan/lainchan'>lainchan</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
- <br><a href="https://github.com/lainchan/lainchan">lainchan</a> Copyright &copy; 2014-2015 lainchan Administration</p>
+ <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel
+ <br><a href="https://github.com/lainchan/lainchan">lainchan</a> Copyright &copy; 2014-2016 lainchan Administration</p>
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
</footer>
diff --git a/templates/installer/config.html b/templates/installer/config.html
index 193bb98b..973328f5 100644
--- a/templates/installer/config.html
+++ b/templates/installer/config.html
@@ -87,6 +87,9 @@
<legend>Miscellaneous</legend>
<label for="secure_trip_salt">Secure trip (##) salt:</label>
<input type="text" id="secure_trip_salt" name="secure_trip_salt" value="{{ config.secure_trip_salt }}" size="40">
+
+ <label for="more">Additional configuration:</label>
+ <textarea id="more" name="more">{{ more }}</textarea>
</fieldset>
<p style="text-align:center">
diff --git a/templates/main.js b/templates/main.js
index 3e44ed2d..af665987 100755
--- a/templates/main.js
+++ b/templates/main.js
@@ -70,26 +70,40 @@ var datelocale =
};
-function alert(a) {
- var handler, div;
- var close = function() {
- handler.fadeOut(400, function() { handler.remove(); });
- return false;
- };
+function alert(a, do_confirm, confirm_ok_action, confirm_cancel_action) {
+ var handler, div, bg, closebtn, okbtn;
+ var close = function() {
+ handler.fadeOut(400, function() { handler.remove(); });
+ return false;
+ };
- handler = $("<div id='alert_handler'></div>").hide().appendTo('body');
+ handler = $("<div id='alert_handler'></div>").hide().appendTo('body');
- $("<div id='alert_background'></div>").click(close).appendTo(handler);
+ bg = $("<div id='alert_background'></div>").appendTo(handler);
- div = $("<div id='alert_div'></div>").appendTo(handler);
- $("<a id='alert_close' href='javascript:void(0)'><i class='fa fa-times'></i></div>")
- .click(close).appendTo(div);
+ div = $("<div id='alert_div'></div>").appendTo(handler);
+ closebtn = $("<a id='alert_close' href='javascript:void(0)'><i class='fa fa-times'></i></div>")
+ .appendTo(div);
- $("<div id='alert_message'></div>").html(a).appendTo(div);
+ $("<div id='alert_message'></div>").html(a).appendTo(div);
- $("<button class='button alert_button'>"+_("OK")+"</button>").click(close).appendTo(div);
+ okbtn = $("<button class='button alert_button'>"+_("OK")+"</button>").appendTo(div);
- handler.fadeIn(400);
+ if (do_confirm) {
+ confirm_ok_action = (typeof confirm_ok_action !== "function") ? function(){} : confirm_ok_action;
+ confirm_cancel_action = (typeof confirm_cancel_action !== "function") ? function(){} : confirm_cancel_action;
+ okbtn.click(confirm_ok_action);
+ $("<button class='button alert_button'>"+_("Cancel")+"</button>").click(confirm_cancel_action).click(close).appendTo(div);
+ bg.click(confirm_cancel_action);
+ okbtn.click(confirm_cancel_action);
+ closebtn.click(confirm_cancel_action);
+ }
+
+ bg.click(close);
+ okbtn.click(close);
+ closebtn.click(close);
+
+ handler.fadeIn(400);
}
var saved = {};
@@ -106,7 +120,10 @@ var codestyles = {
{% for stylesheet in code_stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}',
{% endraw %}{% endfor %}{% raw %}
};
-var board_name = false;
+
+if (typeof board_name === 'undefined') {
+ var board_name = false;
+}
function changeStyle(styleName, link) {
{% endraw %}
@@ -163,13 +180,7 @@ function changeStyle(styleName, link) {
{% endraw %}
{% if config.stylesheets_board %}
- {# This is such an unacceptable mess. There needs to be an easier way. #}
- {# Needs fix for slugify #}
- var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }})/);
{% raw %}
- if (matches) {
- board_name = matches[1];
- }
if (!localStorage.board_stylesheets) {
localStorage.board_stylesheets = '{}';
diff --git a/templates/mod/ban_form.html b/templates/mod/ban_form.html
index 911a8dcd..91281359 100644
--- a/templates/mod/ban_form.html
+++ b/templates/mod/ban_form.html
@@ -24,7 +24,7 @@
</th>
<td>
{% if not hide_ip %}
- <input type="text" name="ip" id="ip" size="30" maxlength="40" value="{{ ip }}">
+ <input type="text" name="ip" id="ip" size="30" maxlength="40" value="{{ ip|e }}">
{% else %}
<em>{% trans 'hidden' %}</em>
{% endif %}
diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html
index 9e622c8c..ee1817b3 100644
--- a/templates/mod/dashboard.html
+++ b/templates/mod/dashboard.html
@@ -1,5 +1,5 @@
<ul>
- {% for board in boards %}
+ {% for board in boards %}
<li>
<a href="?/{{ config.board_path|sprintf(board.uri) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(board.uri) }}</a>
-
diff --git a/templates/mod/edit_page.html b/templates/mod/edit_page.html
new file mode 100644
index 00000000..3d132767
--- /dev/null
+++ b/templates/mod/edit_page.html
@@ -0,0 +1,29 @@
+<div style="text-align:center">
+<form method="POST">
+ <input name="token" value="{{ token }}" type="hidden">
+ <table>
+ <tr>
+ <th>{% trans %}Markup method{% endtrans %}
+ {% set allowed_html = config.allowed_html %}
+ {% trans %}<p class="unimportant">"markdown" is provided by <a href="http://parsedown.org/">parsedown</a>. Note: images disabled.</p>
+ <p class="unimportant">"html" allows the following tags:<br/>{{ allowed_html }}</p>
+ <p class="unimportant">"infinity" is the same as what is used in posts.</p>
+ <p class="unimportant">This page will not convert between formats,<br/>choose it once or do the conversion yourself!</p>{% endtrans %}
+ </th>
+ <td>
+ <select name="method">
+ {% for markup in ['markdown', 'html', 'infinity'] %}
+ <option value="{{ markup }}" {% if page.type == markup %}selected{% endif %}>{{ markup }}</option>
+ {% endfor %}
+ </select>
+ </td></tr>
+ <tr><th>{% trans %}Page content{% endtrans %}
+ <br/>
+ <span class="unimportant">{% trans %}Page will appear at:{% endtrans %}
+ {% if board %} <a href="/{{ board.uri }}/{{ page.name }}.html">{{ config.domain }}/{{ board.uri }}/{{ page.name }}.html</a>
+ {% else %} <a href="/{{ page.name }}.html">{{ config.site }}/{{ page.name }}.html</a>
+ {% endif %}</span></th><td><textarea name="content" style="height:500px;width:500px">{{content}}</textarea></td><tr>
+ </table>
+ <input type="submit" value="Save page">
+</form>
+</div>
diff --git a/templates/mod/log.html b/templates/mod/log.html
index 0aa3f110..a38b4af5 100644
--- a/templates/mod/log.html
+++ b/templates/mod/log.html
@@ -10,7 +10,15 @@
<tr>
<td class="minimal">
{% if log.username %}
- <a href="?/log:{{ log.username|e }}">{{ log.username|e }}</a>
+ {% if hide_names %}
+ <em>hidden</em>
+ {% else %}
+ {% if not mod|hasPermission(config.mod.modlog) %}
+ <a href="?/new_PM/{{ log.username|e }}">{{ log.username|e }}</a>
+ {% else %}
+ <a href="?/log:{{ log.username|e }}">{{ log.username|e }}</a>
+ {% endif %}
+ {% endif %}
{% elseif log.mod == -1 %}
<em>system</em>
{% else %}
@@ -44,7 +52,11 @@
{% if count > logs|count %}
<p class="unimportant" style="text-align:center;word-wrap:break-word">
{% for i in range(0, (count - 1) / config.mod.modlog_page) %}
- <a href="?/log{% if username %}:{{ username }}{% endif %}/{{ i + 1 }}">[{{ i + 1 }}]</a>
+ {% if public %}
+ <a href="?page={{ i + 1 }}&amp;board={{ board|url_encode }}">[{{ i + 1 }}]</a>
+ {% else %}
+ <a href="?/log{% if username %}:{{ username }}{% elseif board %}:b:{{ board }}{% endif %}/{{ i + 1 }}">[{{ i + 1 }}]</a>
+ {% endif %}
{% endfor %}
</p>
{% endif %}
diff --git a/templates/mod/news.html b/templates/mod/news.html
index 510d60ce..57058291 100644
--- a/templates/mod/news.html
+++ b/templates/mod/news.html
@@ -40,7 +40,7 @@
<div class="ban">
{% if mod|hasPermission(config.mod.news_delete) %}
<span style="float:right;padding:2px">
- <a class="unimportant" href="?/news/delete/{{ post.id }}/{{ post.delete_token }}">[{% trans 'delete' %}]</a>
+ <a class="unimportant" href="?/edit_news/delete/{{ post.id }}/{{ post.delete_token }}">[{% trans 'delete' %}]</a>
</span>
{% endif %}
<h2 id="{{ post.id }}">
diff --git a/templates/mod/pages.html b/templates/mod/pages.html
new file mode 100644
index 00000000..c2395c02
--- /dev/null
+++ b/templates/mod/pages.html
@@ -0,0 +1,34 @@
+<script type="text/javascript" src="js/jquery.min.js"></script>
+<div style="text-align:center">
+<p class="unimportant">
+{% if board %}
+{% set page_max = config.pages_max %}
+{% trans %}This page allows you to create static pages for your board. The limit is {{ page_max }} pages per board. You will still have to link to your pages somewhere in your board, for example in a sticky or in the board's announcement. To make links in the board's announcement, use &lt;a&gt; HTML tags.{% endtrans %}
+{% else %}
+{% trans %}This page allows you to create static pages for your imageboard.{% endtrans %}
+{% endif %}
+<h2>{% trans %}Existing pages{% endtrans %}</h2>
+{% if pages %}
+<form>
+<table style="margin:auto">
+<tr><th>{% trans %}URL{% endtrans %}</th><th>{% trans %}Title{% endtrans %}</th><th>{% trans %}Edit{% endtrans %}</th><th>{% trans %}Delete{% endtrans %}</tr>
+{% for page in pages %}
+<tr><td>{{ page.name }}</td><td>{{ page.title }}</td><td><a href="?/edit_page/{{ page.id }}">{% trans %}Edit{% endtrans %}</a></td><td><a href="?/edit_pages/delete/{{ page.name }}{% if board %}/{{ board }}{% endif %}/{{ page.delete_token }}">{% trans %}Delete{% endtrans %}</a></td>
+{% endfor %}
+{% else %}
+<em>No pages yet!</em>
+{% endif %}
+</table>
+</form>
+<hr/>
+<h2>{% trans %}Create a new page{% endtrans %}</h2>
+<form method="POST">
+ <input type="hidden" name="token" value="{{ token }}">
+<table>
+<tr><th>{% trans %}URL{% endtrans %}</th><th>{% trans %}Title{% endtrans %}</th></tr>
+<tr><td><input type="text" name="page"></td><td><input type="text" name="title"></td>
+</table>
+<input type="submit" value="{% trans %}Create{% endtrans %}">
+</form>
+
+</div>
diff --git a/templates/mod/rebuilt.html b/templates/mod/rebuilt.html
index 57d16fff..f27cdf56 100644
--- a/templates/mod/rebuilt.html
+++ b/templates/mod/rebuilt.html
@@ -1,12 +1,12 @@
<div class="ban">
<h2>{% trans 'Rebuilt' %}</h2>
+ <p>
+ <a href="?/rebuild">{% trans 'Go back and rebuild again' %}</a>.
+ </p>
<ul>
{% for log in logs %}
<li>{{ log }}</li>
{% endfor %}
</ul>
- <p>
- <a href="?/rebuild">{% trans 'Go back and rebuild again' %}</a>.
- </p>
</div>
diff --git a/templates/mod/view_ip.html b/templates/mod/view_ip.html
index 1c1c7fa6..4bacc7f6 100644
--- a/templates/mod/view_ip.html
+++ b/templates/mod/view_ip.html
@@ -45,7 +45,7 @@
</td>
{% if mod|hasPermission(config.mod.remove_notes) %}
<td class="minimal">
- <a href="?/IP/{{ ip }}/remove_note/{{ note.id }}">
+ <a href="?/IP/{{ ip|url_encode(true) }}/remove_note/{{ note.id }}">
<small>[{% trans 'remove' %}]</small>
</a>
</td>
diff --git a/templates/page.html b/templates/page.html
index 7c0ccb09..a61e6f73 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -5,12 +5,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<script type="text/javascript">
- active_page = "page";
+ var active_page = "page";
</script>
{% include 'header.html' %}
<title>{{ title }}</title>
</head>
-<body>
+<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} active-page" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
+ {{ boardlist.top }}
+
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr>{% endif %}
<header>
<h1>{{ title }}</h1>
@@ -25,9 +27,12 @@
<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>
+ <a href='https://int.vichan.net/devel/'>vichan</a> +
+ <a href='https://github.com/lainchan/lainchan'>lainchan</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-2016 vichan-devel
+ <br><a href="https://github.com/lainchan/lainchan">lainchan</a> Copyright &copy; 2014-2016 lainchan Administration</p>
+
</footer>
</body>
</html>
diff --git a/templates/post/flag.html b/templates/post/flag.html
index 61622368..481e40ae 100644
--- a/templates/post/flag.html
+++ b/templates/post/flag.html
@@ -1,5 +1,5 @@
{% if config.display_flags and post.modifiers.flag %}
- <img
+ <img
{% if config.country_flags_condensed %}
class="flag flag-{{ post.modifiers.flag }}" src="{{ config.image_blank }}"
{% else %}
diff --git a/templates/post/name.html b/templates/post/name.html
index 13c676c7..e7f85f8b 100644
--- a/templates/post/name.html
+++ b/templates/post/name.html
@@ -1,5 +1,5 @@
{% set capcode = post.capcode|capcode %}
-{% if post.email|length > 0 and (config.hide_sage!=true or post.email!='sage') %}
+{% if post.email|length > 0 and (config.hide_sage!=true or post.email!='sage') and config.hide_email!=true %}
{# start email #}
<a class="email" href="mailto:{{ post.email }}">
{% endif %}
@@ -7,7 +7,7 @@
{% if post.trip|length > 0 %}
<span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span>
{% endif %}
-{% if post.email|length > 0 %}
+{% if post.email|length > 0 and (config.hide_sage!=true or post.email!='sage') and config.hide_email!=true %}
{# end email #}
</a>
{% endif %}
diff --git a/templates/post/post_controls.html b/templates/post/post_controls.html
index 108d80b3..7e56edd3 100644
--- a/templates/post/post_controls.html
+++ b/templates/post/post_controls.html
@@ -41,7 +41,6 @@
{% endif %}
{% endif %}
-
{% if mod|hasPermission(config.mod.move, board.uri) %}
{% if not post.thread %}
<a title="{% trans %}Move thread to another board{% endtrans %}" href="?/{{ board.dir }}move/{{ post.id }}">{{ config.mod.link_move }}</a>&nbsp;
@@ -49,6 +48,13 @@
<a title="{% trans %}Move reply to another board{% endtrans %}" href="?/{{ board.dir }}move_reply/{{ post.id }}">{{ config.mod.link_move }}</a>&nbsp;
{% endif %}
{% endif %}
+{% if mod|hasPermission(config.mod.cycle, board.uri) %}
+ {% if post.cycle %}
+ <a title="{% trans %}Make thread not cycle{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'uncycle/' ~ post.id) }}">{{ config.mod.link_uncycle }}</a>&nbsp;
+ {% else %}
+ <a title="{% trans %}Make thread cycle{% endtrans %}" href="?/{{ secure_link(board.dir ~ 'cycle/' ~ post.id) }}">{{ config.mod.link_cycle }}</a>&nbsp;
+ {% endif %}
+{% endif %}
{% if mod|hasPermission(config.mod.editpost, board.uri) %}
<a title="{% trans %}Edit post{% endtrans %}" href="?/{{ board.dir }}edit{% if config.mod.raw_html_default %}_raw{% endif %}/{{ post.id }}">{{ config.mod.link_editpost }}</a>&nbsp;
{% endif %}
diff --git a/templates/post/poster_id.html b/templates/post/poster_id.html
index 4efc56ff..51f0624f 100644
--- a/templates/post/poster_id.html
+++ b/templates/post/poster_id.html
@@ -1,7 +1,7 @@
{% if config.poster_ids %}
{% if post.thread %}
- ID: <span class="poster_id">{{ post.ip|poster_id(post.thread) }}</span>
+ <span class="poster_id">{{ post.ip|poster_id(post.thread) }}</span>
{% else %}
- ID: <span class="poster_id">{{ post.ip|poster_id(post.id) }}</span>
+ <span class="poster_id">{{ post.ip|poster_id(post.id) }}</span>
{% endif %}
{% endif %}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index 61146491..125d5f78 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -1,7 +1,7 @@
{% filter remove_whitespace %}
{# tabs and new lines will be ignored #}
-<div id="thread_{{ post.id }}" data-board="{{ board.uri }}">
+<div class="thread" id="thread_{{ post.id }}" data-board="{{ board.uri }}">
{% if not index %}<a id="{{ post.id }}" class="post_anchor"></a>{% endif %}
{% include 'post/fileinfo.html' %}
@@ -19,25 +19,32 @@
<a class="post_no" onclick="citeReply({{ post.id }})" href="{% if isnoko50 %}{{ post.link('q', '50') }}{% else %}{{ post.link('q') }}{% endif %}">{{ post.id }}</a>
{% if post.sticky %}
{% if config.font_awesome %}
- <i class="fa fa-thumb-tack"></i>
+ <i class="fa fa-thumb-tack" title="Sticky"></i>
{% else %}
<img class="icon" title="Sticky" src="{{ config.image_sticky }}" alt="Sticky" />
{% endif %}
{% endif %}
{% if post.locked %}
{% if config.font_awesome %}
- <i class="fa fa-lock"></i>
+ <i class="fa fa-lock" title="Locked"></i>
{% else %}
<img class="icon" title="Locked" src="{{ config.image_locked }}" alt="Locked" />
{% endif %}
{% endif %}
{% if post.bumplocked and (config.mod.view_bumplock < 0 or (post.mod and post.mod|hasPermission(config.mod.view_bumplock, board.uri))) %}
{% if config.font_awesome %}
- <i class="fa fa-anchor"></i>
+ <i class="fa fa-anchor" title="Bumplocked"></i>
{% else %}
<img class="icon" title="Bumplocked" src="{{ config.image_bumplocked }}" alt="Bumplocked" />
{% endif %}
{% endif %}
+ {% if post.cycle %}
+ {% if config.font_awesome %}
+ <i class="fa fa-refresh" title="Cyclical"></i>
+ {% else %}
+ <img class="icon" title="Cyclical" src="{{ config.image_sticky }}" alt="Cyclical" />
+ {% endif %}
+ {% endif %}
{% if index %}
<a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ link_for(post) }}">[{% trans %}Reply{% endtrans %}]</a>
{% endif %}
diff --git a/templates/posts.sql b/templates/posts.sql
index 6b2249ef..070e687b 100755
--- a/templates/posts.sql
+++ b/templates/posts.sql
@@ -17,6 +17,7 @@ CREATE TABLE IF NOT EXISTS ``posts_{{ board }}`` (
`ip` varchar(39) CHARACTER SET ascii NOT NULL,
`sticky` int(1) NOT NULL,
`locked` int(1) NOT NULL,
+ `cycle` int(1) NOT NULL,
`sage` int(1) NOT NULL,
`embed` text,
`slug` varchar(256) DEFAULT NULL,
diff --git a/templates/report.html b/templates/report.html
new file mode 100644
index 00000000..b34f7430
--- /dev/null
+++ b/templates/report.html
@@ -0,0 +1,22 @@
+<form action="{{ config.post_url }}" method="post" id="report_form">
+ {% if error %}
+ <div class="error">
+ <strong>{{ error|e }}</strong>
+ </div>
+ {% endif %}
+ <input type="hidden" name="board" value="{{ board.uri }}">
+ <input type="hidden" name="{{ post|e }}" value="1">
+ {% if global %}
+ <input type="hidden" name="global" value="1">
+ <div><h1>Attention!</h1><p>This form is only for reporting <strong>child pornography</strong>, <strong>bot spam</strong> and <strong>credit card numbers, social security numbers or banking information</strong>. DMCA requests and all other deletion requests <em>MUST</em> be sent via email to admin@8chan.co.</p><p>8chan is unmoderated and allows posts without collecting <em>ANY</em> information from the poster less the details of their post. Furthermore, all boards on 8chan are user created and not actively monitored by anyone but the board creator.</p><p>8chan has a small volunteer staff to handle this queue, please do not waste their time by filling it with nonsense! <em>If you made a report with this tool and the post was not deleted, <strong>do not make the report again!</strong> Email admin@8chan.co instead.</em> Abuse of the global report system could lead to address blocks against your IP from 8chan.</p><p>Again, 8chan's global volunteers <em>do not</em> handle board specific issues. You most likely want to click "Report" instead to reach the creator and volunteers he assigned to this board.</p>
+ {% endif %}
+ <p>{% trans %}Enter reason below...{% endtrans %}</p>
+ <input type="text" id="reason" name="reason" value="{{ reason_prefill|e|addslashes }}">
+ {% if config.report_captcha %}
+ <p>{% trans %}To submit your report, please fill out the CAPTCHA below.{% endtrans %}</p>
+ {{ captcha['html'] }}<br/>
+ <input class="captcha_text" name="captcha_text" size="25" maxlength="6" autocomplete="off" type="text" value="">
+ <input class="captcha_cookie" name="captcha_cookie" type="hidden" autocomplete="off" value="{{ captcha['cookie']|e }}"><br/>
+ {% endif %}
+ <input name="report" value="{% trans %}Submit{% endtrans %}" type="submit">
+</form>
diff --git a/templates/report_delete.html b/templates/report_delete.html
index 2fcb7259..e246da9e 100644
--- a/templates/report_delete.html
+++ b/templates/report_delete.html
@@ -1,13 +1,16 @@
-{% if config.allow_delete %}
-<div class="delete">
- {% trans %}Delete Post{% endtrans %} [<input title="Delete file only" type="checkbox" name="file" id="delete_file" />
- <label for="delete_file">{% trans %}File{% endtrans %}</label>] <label for="password">{% trans %}Password{% endtrans %}</label>
+<div id="post-moderation-fields">
+ {% if config.allow_delete %}
+ <div id="delete-fields">
+ {% trans %}Delete Post{% endtrans %} [<input title="Delete file only" type="checkbox" name="file" id="delete_file" />
+ <label for="delete_file">{% trans %}File{% endtrans %}</label>] <label for="password">{% trans %}Password{% endtrans %}</label>
<input id="password" type="password" name="password" size="12" maxlength="18" />
<input type="submit" name="delete" value="{% trans %}Delete{% endtrans %}" />
-</div>
-{% endif %}
-<div class="delete" style="clear:both">
- <label for="reason">{% trans %}Reason{% endtrans %}</label>
+ </div>
+ {% endif %}
+
+ <div id="report-fields">
+ <label for="reason">{% trans %}Reason{% endtrans %}</label>
<input id="reason" type="text" name="reason" size="20" maxlength="30" />
<input type="submit" name="report" value="{% trans %}Report{% endtrans %}" />
-</div>
+ </div>
+</div> \ No newline at end of file
diff --git a/templates/rules.html b/templates/rules.html
index 76fb6a5f..3cc064c2 100644
--- a/templates/rules.html
+++ b/templates/rules.html
@@ -24,7 +24,7 @@
<li>Mods usually ask each other for opinions before doing anything. We hate having to ban someone.</li>
<li> Just relax and try to have fun. Jokes are always welcome.</li>
<li> Visit a board you've never been to. Try out /random/.</li>
- <li> Max file size is 35 mb.</li>
+ <li> Max file size is 25 mb.</li>
<li> PDF, ePub, and webm are supported across the boards.</li>
<li>We ALWAYS need contributors to our board software, located on <a href="https://github.com/lainchan/lainchan/">github</a></li>
<li> Dice rolling: posting in the email field with the form "dice XdY+/-Z" will result in X Y-sided dice rolled and summed, with the modifier Z added, the result is displayed at the top of the post body.</li>
diff --git a/templates/search_form.html b/templates/search_form.html
index 4c8bd077..095968de 100644
--- a/templates/search_form.html
+++ b/templates/search_form.html
@@ -6,8 +6,13 @@
<input id="search" name="search" type="text" size="40" value="{{ search }}">
<select name="board">
<option value="none">{% trans %}Select board{% endtrans %}&hellip;</option>
- {% for b in boards %}
- <option value="{{ b }}"{% if b == board %} selected{% endif %}>/{{ b }}/</option>
+
+ {% for b2 in boards %}
+ {% if b2 == b %}
+ <option value="{{ b2 }}" selected>/{{ b2 }}/</option>
+ {% else %}
+ <option value="{{ b2 }}">/{{ b2 }}/</option>
+ {% endif %}
{% endfor %}
</select>
<input type="submit" value="{% trans %}Search{% endtrans %}" />
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,
diff --git a/templates/thread.html b/templates/thread.html
index 62fe2c12..5ecef649 100644
--- a/templates/thread.html
+++ b/templates/thread.html
@@ -6,16 +6,30 @@
<script type="text/javascript">
- var active_page = "thread";
+ var active_page = "thread"
+ , board_name = "{{ board.uri }}"
+ , thread_id = "{{ thread.id }}";
</script>
{% include 'header.html' %}
- <title>{{ board.url }} - {% if config.thread_subject_in_title and thread.subject %}{{ thread.subject }}{% else %}{{ board.title|e }}{% endif %}</title>
+
+ {% set meta_subject %}{% if config.thread_subject_in_title and thread.subject %}{{ thread.subject|e }}{% else %}{{ thread.body_nomarkup[:256]|remove_modifiers|e }}{% endif %}{% endset %}
+
+ <meta name="description" content="{{ board.url }} - {{ board.title|e }} - {{ meta_subject }}" />
+ <meta name="twitter:card" value="summary">
+ <meta property="og:title" content="{{ meta_subject }}" />
+ <meta property="og:type" content="article" />
+ <meta property="og:url" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.res }}{{ thread.id }}.html" />
+ {% if thread.files.0.thumb %}<meta property="og:image" content="{{ config.domain }}/{{ board.uri }}/{{ config.dir.thumb }}{{ thread.files.0.thumb }}" />{% endif %}
+ <meta property="og:description" content="{{ thread.body_nomarkup|e }}" />
+
+ <title>{{ board.url }} - {{ meta_subject }}</title>
</head>
-<body id="thread">
+<body id="thread" class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} active-thread" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
<div class="bar top">
{{ boardlist.top }}
</div>
+ <a name="top"></a>
{% if pm %}<div class="top_notice">You have <a href="?/PM/{{ pm.id }}">an unread PM</a>{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.</div><hr />{% endif %}
{% 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>
@@ -34,23 +48,44 @@
{% include 'attention_bar.html' %}
+
{{ config.ad.top }}
{% include 'post_form.html' %}
{% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %}
<hr />
- <a href="{{ return }}">[{% trans %}Return{% endtrans %}]</a>
- <a href="#bottom" style="padding-left: 10px">[{% trans %}Go to bottom{% endtrans %}]</a>
+ <div class="threadlinks-noup">
+ <span class="threadlink">[ <a href="{{ return }}">{% trans %}Return{% endtrans %}</a> /</span>
+ <span class="threadlink"><a href="#bottom" style="padding-left: 10px"> {% trans %}Go to bottom{% endtrans %}</a> ]</span>
+ </div>
<hr />
<form name="postcontrols" action="{{ config.post_url }}" method="post">
- <input type="hidden" name="board" value="{{ board.uri }}" />
- {% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
- {{ body }}
- {% include 'report_delete.html' %}
+ <input type="hidden" name="board" value="{{ board.uri }}" />
+ {% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
+
+ {{ body }}
+
+ <div id="thread-interactions">
+ <span id="thread-links">
+ <a id="thread-return" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a>
+ <a id="thread-top" href="#top">[{% trans %}Go to top{% endtrans %}]</a>
+ {% if config.catalog_link %}
+ <a id="thread-catalog" href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
+ {% endif %}
+ </span>
+
+ <span id="thread-quick-reply">
+ <a id="link-quick-reply" href="#">[{% trans %}Post a Reply{% endtrans %}]</a>
+ </span>
+
+ {% include 'report_delete.html' %}
+ </div>
+
+ <div class="clearfix"></div>
</form>
-
- {{ boardlist.bottom }}
+
+ {{ boardlist.bottom }}
{{ config.ad.bottom }}
@@ -60,8 +95,8 @@
<a href='https://int.vichan.net/devel/'>vichan</a> +
<a href='https://github.com/lainchan/lainchan'>lainchan</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
- <br><a href="https://github.com/lainchan/lainchan">lainchan</a> Copyright &copy; 2014-2015 lainchan Administration</p>
+ <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel
+ <br><a href="https://github.com/lainchan/lainchan">lainchan</a> Copyright &copy; 2014-2016 lainchan Administration</p>
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
</footer>
<div class="bar bottom">