summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-18 13:16:31 -0400
committerczaks <marcin@6irc.net>2013-08-18 13:16:31 -0400
commitda1b7d087e55019b064e4dff0498ae0aa8a64418 (patch)
treecf92758fac657dee32485d34353653953b05b9a6 /templates
parentf6c25382b9708eff88a575ba199a645fc3dac420 (diff)
parentf8837ad60cac5aa7ec1457819986822d14661681 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: install.php
Diffstat (limited to 'templates')
-rw-r--r--templates/mod/theme_config.html19
-rw-r--r--templates/post_reply.html2
-rw-r--r--templates/post_thread.html2
-rw-r--r--templates/posts.sql4
-rw-r--r--templates/themes/catalog/info.php8
-rw-r--r--templates/themes/catalog/theme.php2
6 files changed, 27 insertions, 10 deletions
diff --git a/templates/mod/theme_config.html b/templates/mod/theme_config.html
index 2dbb8397..d85b5df1 100644
--- a/templates/mod/theme_config.html
+++ b/templates/mod/theme_config.html
@@ -7,12 +7,21 @@
<tr>
<th>{{ conf.title }}</th>
<td>
- <input type="text" name="{{ conf.name }}"
- {% if settings[conf.name] %}value="{{ settings[conf.name] }}"{% else %}{% if conf.default %}value="{{ conf.default }}"{% endif %}{% endif %}
- {% if conf.size %}
- size="{{ conf.size }}"
+ {% if conf.type == 'checkbox' %}
+ <input type="checkbox" name="{{ conf.name }}"
+ {% if settings[conf.name] or (not settings[conf.name] is defined and conf.default) %}
+ checked
+ {% endif %}>
+ {% else %}
+ <input type="text" name="{{ conf.name }}"
+ {% if settings[conf.name] %}
+ value="{{ settings[conf.name] }}"
+ {% else %}
+ {% if conf.default %}value="{{ conf.default }}"{% endif %}{% endif %}
+ {% if conf.size %}
+ size="{{ conf.size }}"
+ {% endif %}>
{% endif %}
- />
{% if conf.comment %}
<span class="unimportant">{{ conf.comment }}</span>
{% endif %}
diff --git a/templates/post_reply.html b/templates/post_reply.html
index 65fd576c..bc3d36cd 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -91,7 +91,7 @@
)
</span>
</p>
- <a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if post.thumb == 'file' %} class="file"{% endif %}>
+ <a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if post.thumb == 'file' or post.modifiers['is_file'] == '1' %} class="file"{% endif %}>
<img class="post-image" src="
{% if post.thumb == 'file' %}
{{ config.root }}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index adc3b64e..ddbb0b2e 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -41,7 +41,7 @@
{% endif %}
)
</span></p>
-<a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if post.thumb == 'file' %} class="file"{% endif %}>
+<a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if post.thumb == 'file' or post.modifiers['is_file'] == '1' %} class="file"{% endif %}>
<img class="post-image" src="
{% if post.thumb == 'file' %}
{{ config.root }}
diff --git a/templates/posts.sql b/templates/posts.sql
index ca2ec304..4eef3a0d 100644
--- a/templates/posts.sql
+++ b/templates/posts.sql
@@ -10,10 +10,10 @@ CREATE TABLE IF NOT EXISTS ``posts_{{ board }}`` (
`body_nomarkup` text,
`time` int(11) NOT NULL,
`bump` int(11) DEFAULT NULL,
- `thumb` varchar(50) DEFAULT NULL,
+ `thumb` varchar(255) DEFAULT NULL,
`thumbwidth` int(11) DEFAULT NULL,
`thumbheight` int(11) DEFAULT NULL,
- `file` varchar(50) DEFAULT NULL,
+ `file` varchar(255) DEFAULT NULL,
`filewidth` int(11) DEFAULT NULL,
`fileheight` int(11) DEFAULT NULL,
`filesize` int(11) DEFAULT NULL,
diff --git a/templates/themes/catalog/info.php b/templates/themes/catalog/info.php
index 1b9831ae..c68c9e09 100644
--- a/templates/themes/catalog/info.php
+++ b/templates/themes/catalog/info.php
@@ -38,5 +38,13 @@
'comment' => '(eg. "catalog.css")'
);
+ $theme['config'][] = Array(
+ 'title' => 'Update on new posts',
+ 'name' => 'update_on_posts',
+ 'type' => 'checkbox',
+ 'default' => false,
+ 'comment' => 'Without this checked, the catalog only updates on new threads.'
+ );
+
// Unique function name for building everything
$theme['build_function'] = 'catalog_build';
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php
index 4e2d40db..96550683 100644
--- a/templates/themes/catalog/theme.php
+++ b/templates/themes/catalog/theme.php
@@ -20,7 +20,7 @@
$b = new Catalog();
$b->build($settings, $board);
}
- } elseif ($action == 'post-thread' && in_array($board, $boards)) {
+ } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') && in_array($board, $boards)) {
$b = new Catalog();
$b->build($settings, $board);
}