From b666886416f793074669a7e2bc1d7cc3c2b4746a Mon Sep 17 00:00:00 2001
From: Michael Foster
Date: Fri, 16 Aug 2013 21:08:01 +1000
Subject: A few modifications:
1. Finally, clean up some of the crappy code in inc/display.php; no more extreme clutter. new Thread() and new Post() take an array as the first parameter now.
2. Poster country flags. Currently requires the "geoip" extension.
3. Give post images a classname. This was also long-overdue.
---
templates/post_reply.html | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'templates/post_reply.html')
diff --git a/templates/post_reply.html b/templates/post_reply.html
index b0391f19..56832710 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -27,6 +27,9 @@
{% endif %}
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
[{{ post.ip }} ]
+ {% endif %}
+ {% if config.display_flags and post.modifiers.flag_country %}
+
{% endif %}
{{ post.time|date(config.post_date) }}
@@ -49,7 +52,7 @@
{% if post.embed %}
{{ post.embed }}
{% elseif post.file == 'deleted' %}
-
+
{% elseif post.file and post.file %}
File: {{ post.file }}
(
@@ -87,7 +90,7 @@
- ';
}
}
- if ($mod && isset($post['raw']) && $post['raw']) {
- $post['body'] = '' . $post['body'] . ' ';
- }
-
if (mysql_version() >= 50503) {
$post['body_nomarkup'] = $post['body']; // Assume we're using the utf8mb4 charset
} else {
diff --git a/templates/post_reply.html b/templates/post_reply.html
index 56832710..1cce0e27 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -108,6 +108,9 @@
{{ post.postControls }}
{% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
+ {% if post.modifiers['ban message'] %}
+ {{ config.mod.ban_message|sprintf(post.modifiers['ban message']) }}
+ {% endif %}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index 5caca9a4..6824ce9d 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -81,6 +81,9 @@
{% endif %}
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
[ {{ post.ip }} ]
+ {% endif %}
+ {% if config.display_flags and post.modifiers.flag_country %}
+
{% endif %}
{{ post.time|date(config.post_date) }}
@@ -127,6 +130,9 @@
{% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
+ {% if post.modifiers['ban message'] %}
+ {{ config.mod.ban_message|sprintf(post.modifiers['ban message']) }}
+ {% endif %}
{% if post.omitted or post.omitted_images %}
--
cgit v1.3
From a9fe4ea2db12e8d16212ad9565d3b0a1dfdfd54d Mon Sep 17 00:00:00 2001
From: Michael Foster
Date: Fri, 16 Aug 2013 22:12:25 +1000
Subject: Change flag_country to just flag
---
post.php | 2 +-
templates/post_reply.html | 4 ++--
templates/post_thread.html | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
(limited to 'templates/post_reply.html')
diff --git a/post.php b/post.php
index d160c7e3..92035f77 100644
--- a/post.php
+++ b/post.php
@@ -430,7 +430,7 @@ if (isset($_POST['delete'])) {
error('GeoIP not available: ' . geoip_db_filename(GEOIP_COUNTRY_EDITION));
}
if ($country_code = @geoip_country_code_by_name($_SERVER['REMOTE_ADDR'])) {
- $post['body'] .= '' . strtolower($country_code) . ' ';
+ $post['body'] .= '' . strtolower($country_code) . ' ';
}
}
diff --git a/templates/post_reply.html b/templates/post_reply.html
index 1cce0e27..3ae60b0d 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -28,8 +28,8 @@
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
[{{ post.ip }} ]
{% endif %}
- {% if config.display_flags and post.modifiers.flag_country %}
-
+ {% if config.display_flags and post.modifiers.flag %}
+
{% endif %}
{{ post.time|date(config.post_date) }}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index 6824ce9d..f4ca7e72 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -82,8 +82,8 @@
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
[{{ post.ip }} ]
{% endif %}
- {% if config.display_flags and post.modifiers.flag_country %}
-
+ {% if config.display_flags and post.modifiers.flag %}
+
{% endif %}
{{ post.time|date(config.post_date) }}
--
cgit v1.3
From 0ad1c03997d43e2473039c3991e74bdd0ad9b5c1 Mon Sep 17 00:00:00 2001
From: Michael Foster
Date: Fri, 16 Aug 2013 23:12:40 +1000
Subject: Optional "flag style" and "flag alt" modifiers
---
inc/config.php | 6 +++---
templates/post_reply.html | 4 +++-
templates/post_thread.html | 4 +++-
3 files changed, 9 insertions(+), 5 deletions(-)
(limited to 'templates/post_reply.html')
diff --git a/inc/config.php b/inc/config.php
index 5e215fca..f0e3ea9f 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -739,9 +739,9 @@
// Location of post flags/icons (where "%s" is the flag name). Defaults to static/flags/%s.png.
// $config['uri_flags'] = 'http://static.example.org/flags/%s.png';
- // Width and height of post flags:
- $config['flag_width'] = 16;
- $config['flag_height'] = 11;
+ // Width and height (and more?) of post flags. Can be overridden with the Tinyboard post modifier:
+ // .
+ $config['flag_style'] = 'width:16px;height:11px;';
/*
* ====================
diff --git a/templates/post_reply.html b/templates/post_reply.html
index 3ae60b0d..635709bc 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -29,7 +29,9 @@
[{{ post.ip }} ]
{% endif %}
{% if config.display_flags and post.modifiers.flag %}
-
+
{% endif %}
{{ post.time|date(config.post_date) }}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index f4ca7e72..4630eb40 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -83,7 +83,9 @@
[{{ post.ip }} ]
{% endif %}
{% if config.display_flags and post.modifiers.flag %}
-
+
{% endif %}
{{ post.time|date(config.post_date) }}
--
cgit v1.3
From 0565e2119d54cb4be8c6931ee42acfb586188893 Mon Sep 17 00:00:00 2001
From: Michael Foster
Date: Fri, 16 Aug 2013 23:25:32 +1000
Subject: Bugfix: Thumbnail sizes (thumbx => thumbwidth, etc.)
---
templates/post_reply.html | 2 +-
templates/post_thread.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'templates/post_reply.html')
diff --git a/templates/post_reply.html b/templates/post_reply.html
index 635709bc..518a8edf 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -104,7 +104,7 @@
{{ config.root }}{{ config.spoiler_image }}
{% else %}
{{ config.uri_thumb }}{{ post.thumb }}
- {% endif %}" style="width:{{ post.thumbx }}px;height:{{ post.thumby }}px" alt="" />
+ {% endif %}" style="width:{{ post.thumbwidth }}px;height:{{ post.thumbheight }}px" alt="" />
{% endif %}
{{ post.postControls }}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index 4630eb40..fa8495d5 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -54,7 +54,7 @@
{{ config.root }}{{ config.spoiler_image }}
{% else %}
{{ config.uri_thumb }}{{ post.thumb }}
- {% endif %}" style="width:{{ post.thumbx }}px;height:{{ post.thumby }}px" alt="" />
+ {% endif %}" style="width:{{ post.thumbwidth }}px;height:{{ post.thumbheight }}px" alt="" />
{% endif %}