From ad55a634bf3f9301489f5371942c73940361a24c Mon Sep 17 00:00:00 2001 From: Michael Save Date: Mon, 16 Apr 2012 16:40:24 +1000 Subject: various improvements --- stylesheets/style.css | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index d77f05b5..edebf0c1 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -68,15 +68,18 @@ form table input { } input[type="text"], input[type="password"], textarea { border: 1px solid #a9a9a9; - text-indent: 0px; + text-indent: 0; text-shadow: none; text-transform: none; word-spacing: normal; } form table tr td { text-align: left; - margin: 0px; - padding: 0px; + margin: 0; + padding: 0; +} +form table.mod tr td { + padding: 2px; } form table tr th { text-align: left; @@ -102,7 +105,7 @@ form table tr td div label { } p.fileinfo { display: block; - margin: 0px; + margin: 0; padding-right: 7em; } div.banner { @@ -326,7 +329,7 @@ div.pages form input { hr { border: none; border-top: 1px solid #B7C5D9; - height: 0px; + height: 0; clear: left; } div.boardlist { @@ -349,7 +352,7 @@ table.modlog { } table.modlog tr td { text-align: left; - margin: 0px; + margin: 0; padding: 4px 15px 0 0; } table.modlog tr th { -- cgit v1.3 From 54862246cda6e0e3acaa5fefa0da532a3778cb3b Mon Sep 17 00:00:00 2001 From: Michael Save Date: Sun, 22 Apr 2012 16:52:24 +1000 Subject: Stylesheet change. --- stylesheets/style.css | 2 +- templates/themes/basic/index.html | 6 ++++-- templates/themes/categories/news.html | 5 ++++- templates/themes/frameset/news.html | 6 ++++-- templates/themes/recent/recent.html | 6 ++++-- 5 files changed, 17 insertions(+), 8 deletions(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index edebf0c1..0c71ff7c 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -44,7 +44,7 @@ h2 { header { margin: 1em 0; } -header h1 { +h1 { font-family: tahoma; letter-spacing: -2px; font-size: 20pt; diff --git a/templates/themes/basic/index.html b/templates/themes/basic/index.html index 8426e736..89022420 100644 --- a/templates/themes/basic/index.html +++ b/templates/themes/basic/index.html @@ -8,8 +8,10 @@ {{ boardlist.top }} -

{{ settings.title }}

-
{{ settings.subtitle }}
+
+

{{ settings.title }}

+
{{ settings.subtitle }}
+
{% if news|count == 0 %} diff --git a/templates/themes/categories/news.html b/templates/themes/categories/news.html index 56ddfabb..9c7d8340 100644 --- a/templates/themes/categories/news.html +++ b/templates/themes/categories/news.html @@ -8,7 +8,10 @@

{{ settings.title }}

-
{{ settings.subtitle }}
+
+

{{ settings.title }}

+
{{ settings.subtitle }}
+
{% if news|count == 0 %} diff --git a/templates/themes/frameset/news.html b/templates/themes/frameset/news.html index 56ddfabb..2af5e10d 100644 --- a/templates/themes/frameset/news.html +++ b/templates/themes/frameset/news.html @@ -7,8 +7,10 @@ -

{{ settings.title }}

-
{{ settings.subtitle }}
+
+

{{ settings.title }}

+
{{ settings.subtitle }}
+
{% if news|count == 0 %} diff --git a/templates/themes/recent/recent.html b/templates/themes/recent/recent.html index a6daa9e7..a42024c0 100644 --- a/templates/themes/recent/recent.html +++ b/templates/themes/recent/recent.html @@ -9,8 +9,10 @@ {{ boardlist.top }} -

{{ settings.title }}

-
{{ settings.subtitle }}
+
+

{{ settings.title }}

+
{{ settings.subtitle }}
+
-- cgit v1.3 From aeff0a69b100d2cfa5896d043aa1891b993a7a5f Mon Sep 17 00:00:00 2001 From: Michael Save Date: Fri, 4 May 2012 00:21:16 +1000 Subject: minor CSS fixes --- inc/config.php | 8 ++++---- stylesheets/style.css | 28 +++++++++++++++++++++++----- templates/post_thread.html | 8 ++------ 3 files changed, 29 insertions(+), 15 deletions(-) (limited to 'stylesheets/style.css') diff --git a/inc/config.php b/inc/config.php index 06e100ea..eb70f932 100644 --- a/inc/config.php +++ b/inc/config.php @@ -786,22 +786,22 @@ $config['mod']['link_move'] = '[Move]'; // Moderator capcodes - $config['capcode'] = ' ## %s'; + $config['capcode'] = ' ## %s'; // Custom capcodes, by example: // "## Custom" becomes lightgreen, italic and bold - //$config['custom_capcode']['Custom'] =' ## %s'; + //$config['custom_capcode']['Custom'] =' ## %s'; // "## Mod" makes everything purple, including the name and tripcode //$config['custom_capcode']['Mod'] = array( - // ' ## %s', + // ' ## %s', // 'color:purple', // Change name style; optional // 'color:purple' // Change tripcode style; optional //); // "## Admin" makes everything red and bold, including the name and tripcode //$config['custom_capcode']['Admin'] = array( - // ' ## %s', + // ' ## %s', // 'color:red;font-weight:bold', // Change name style; optional // 'color:red;font-weight:bold' // Change tripcode style; optional //); diff --git a/stylesheets/style.css b/stylesheets/style.css index 0c71ff7c..a46ca3fb 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -10,19 +10,21 @@ body { table * { margin: 0; } -a:link, a:visited { +a, a:visited { text-decoration: underline; color: #34345C; } -a:link:hover, a:visited:hover { +a:hover { color: #ff0000; } a.post_no { - color: black; text-decoration: none; margin: 0; padding: 0; } +a.post_no:not(:hover) { + color: black; +} p.intro a.post_no, p.intro a.email { margin: 0; } @@ -167,7 +169,7 @@ p.intro span.name { color: #117743; font-weight: bold; } -p.intro a.capcode, p.intro a.nametag { +p.intro span.capcode, p.intro a.capcode, p.intro a.nametag { color: #F00000; margin-left: 0; } @@ -314,7 +316,7 @@ div.pages a.selected { color: black; font-weight: bolder; } -div.pages a:link { +div.pages a { text-decoration: none; } div.pages form { @@ -386,3 +388,19 @@ div.blotter { font-weight: bold; text-align: center; } + +/* Uboachan stuff */ +div.styles-sidebar { + text-align: center; + padding-bottom: 0px; +} +div.styles-sidebar a { + margin: 0 5px; +} +div.styles-sidebar a.selected { + text-decoration: none; +} +.category { + background: #98E; + color: black; +} diff --git a/templates/post_thread.html b/templates/post_thread.html index 095c53f9..ac5c786b 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -1,9 +1,7 @@ {% filter remove_whitespace %} {# tabs and new lines will be ignored #} -{% if index %} -
-{% endif %} +
{% if post.embed %} {{ post.embed }} @@ -136,6 +134,4 @@ {% include 'post_reply.html' %} {% endfor %}
{% if hr %}
{% endif %} -{% if index %} -
-{% endif %} +
-- cgit v1.3 From 8ceb19a60a8f9a100a680dce1652d69951c1f4d1 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Fri, 11 May 2012 00:17:49 +1000 Subject: small CSS bug --- stylesheets/style.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index a46ca3fb..16da419c 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -14,7 +14,7 @@ a, a:visited { text-decoration: underline; color: #34345C; } -a:hover { +a:hover, p.intro a.post_no:hover { color: #ff0000; } a.post_no { @@ -22,8 +22,8 @@ a.post_no { margin: 0; padding: 0; } -a.post_no:not(:hover) { - color: black; +p.intro a.post_no { + color: inherit; } p.intro a.post_no, p.intro a.email { margin: 0; -- cgit v1.3 From d3739c48c2c2deec83e6abf74ed8e03470581750 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Sun, 20 May 2012 20:20:50 +1000 Subject: Config editort --- inc/mod/pages.php | 85 ++++++++++++++++++++++++++++++++++++++++ inc/template.php | 2 +- mod.php | 2 + stylesheets/style.css | 22 +++++------ templates/mod/config-editor.html | 56 ++++++++++++++++++++++++++ templates/mod/view_ip.html | 8 ++-- 6 files changed, 158 insertions(+), 17 deletions(-) create mode 100644 templates/mod/config-editor.html (limited to 'stylesheets/style.css') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 6b644867..a4e2eae1 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1539,6 +1539,91 @@ function mod_report_dismiss($id, $all = false) { header('Location: ?/reports', true, $config['redirect_http']); } + +function mod_config() { + global $config, $mod; + + if (!hasPermission($config['mod']['edit_config'])) + error($config['error']['noaccess']); + + require_once 'inc/mod/config-editor.php'; + + $conf = config_vars(); + + foreach ($conf as &$var) { + if (is_array($var['name'])) { + $c = &$config; + foreach ($var['name'] as $n) + $c = &$c[$n]; + } else { + $c = $config[$var['name']]; + } + + $var['value'] = $c; + } + unset($var); + + if (isset($_POST['save'])) { + $config_append = ''; + + foreach ($conf as $var) { + $field_name = 'cf_' . (is_array($var['name']) ? implode('/', $var['name']) : $var['name']); + + if ($var['type'] == 'boolean') + $value = isset($_POST[$field_name]); + elseif (isset($_POST[$field_name])) + $value = $_POST[$field_name]; + else + continue; // ??? + + if (!settype($value, $var['type'])) + continue; // invalid + + if ($value != $var['value']) { + // This value has been changed. + + $config_append .= '$config'; + + if (is_array($var['name'])) { + foreach ($var['name'] as $name) + $config_append .= '[' . var_export($name, true) . ']'; + } else { + $config_append .= '[' . var_export($var['name'], true) . ']'; + } + + $config_append .= ' = ' . var_export($value, true) . ";\n"; + } + } + + if(!empty($config_append)) { + $config_append = "\n// Changes made via web editor by \"" . $mod['username'] . "\" @ " . date('r') . ":\n" . $config_append . "\n"; + + if(!@file_put_contents('inc/instance-config.php', $config_append, FILE_APPEND)) { + $config_append = htmlentities($config_append); + + if($config['minify_html']) + $config_append = str_replace("\n", ' ', $config_append); + $page = array(); + $page['title'] = 'Cannot write to file!'; + $page['config'] = $config; + $page['body'] = ' +

Tinyboard could not write to inc/instance-config.php with the ammended configuration, probably due to a permissions error.

+

You may proceed with these changes manually by copying and pasting the following code to the end of inc/instance-config.php:

+ + '; + echo Element('page.html', $page); + exit; + } + } + + header('Location: ?/', true, $config['redirect_http']); + + exit; + } + + mod_page('Config editor', 'mod/config-editor.html', array('conf' => $conf)); +} + function mod_debug_antispam() { global $pdo, $config; diff --git a/inc/template.php b/inc/template.php index 5355e18c..351bde62 100644 --- a/inc/template.php +++ b/inc/template.php @@ -27,7 +27,7 @@ function load_twig() { $twig = new Twig_Environment($loader, array( 'autoescape' => false, 'cache' => "{$config['dir']['template']}/cache", - 'debug' => ($config['debug'] ? true : false), + 'debug' => $config['debug'] )); $twig->addExtension(new Twig_Extensions_Extension_Tinyboard()); $twig->addExtension(new Twig_Extensions_Extension_I18n()); diff --git a/mod.php b/mod.php index 23cacc11..5fa040ee 100644 --- a/mod.php +++ b/mod.php @@ -65,6 +65,8 @@ $pages = array( '/(\w+)/bump(un)?lock/(\d+)' => 'bumplock', // "bumplock" thread '/(\w+)/move/(\d+)' => 'move', // move thread + '/config' => 'config', // config editor + // these pages aren't listed in the dashboard without $config['debug'] '/debug/antispam' => 'debug_antispam', diff --git a/stylesheets/style.css b/stylesheets/style.css index 16da419c..1913f60a 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -388,19 +388,15 @@ div.blotter { font-weight: bold; text-align: center; } - -/* Uboachan stuff */ -div.styles-sidebar { - text-align: center; - padding-bottom: 0px; -} -div.styles-sidebar a { - margin: 0 5px; +table.mod.config-editor { + font-size: 9pt; + width: 100%; } -div.styles-sidebar a.selected { - text-decoration: none; +table.mod.config-editor td { + text-align: left; + padding: 5px; + border-bottom: 1px solid #98e; } -.category { - background: #98E; - color: black; +table.mod.config-editor input[type="text"] { + width: 98%; } diff --git a/templates/mod/config-editor.html b/templates/mod/config-editor.html new file mode 100644 index 00000000..ec7213bb --- /dev/null +++ b/templates/mod/config-editor.html @@ -0,0 +1,56 @@ +
+ + + + + + + + {% for var in conf if var.type != 'array' %} + {% if var.name|count == 1 %} + {% set name = 'cf_' ~ var.name %} + {% else %} + {% set name = 'cf_' ~ var.name|join('/') %} + {% endif %} + + + + + + + + + + + {% endfor %} +
NameValueTypeDescription
+ {% if var.name|count == 1 %} + {{ var.name }} + {% else %} + {{ var.name|join(' → ') }} + {% endif %} + + {% if var.type == 'string' %} + + {% elseif var.type == 'integer' %} + + {% elseif var.type == 'boolean' %} + + {% else %} + ? + {% endif %} + + {% if var.type == 'integer' or var.type == 'boolean' %} + Default: {{ var.default }} + {% endif %} + + {{ var.type|e }} + + {{ var.comment|join('
') }} +
+ +
    +
  • +
+
+ diff --git a/templates/mod/view_ip.html b/templates/mod/view_ip.html index e69301fd..c49880ae 100644 --- a/templates/mod/view_ip.html +++ b/templates/mod/view_ip.html @@ -1,9 +1,11 @@ {% for board_posts in posts %}
- {{ config.board_abbreviation|sprintf(board_posts.board.uri) }} - - - {{ board_posts.board.title|e }} + + {{ config.board_abbreviation|sprintf(board_posts.board.uri) }} + - + {{ board_posts.board.title|e }} + {{ board_posts.posts|join('
') }}
-- cgit v1.3 From 77efe28e9edd717aad844fff52e46e5b0b3b5951 Mon Sep 17 00:00:00 2001 From: thegentoo Date: Wed, 11 Jul 2012 16:10:53 -0300 Subject: Added 1px spacing to spoiler tags (fixes issue with some characters clipping out of the spoiler). --- stylesheets/style.css | 1 + 1 file changed, 1 insertion(+) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index 1913f60a..2111a942 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -271,6 +271,7 @@ span.heading { span.spoiler { background: black; color: black; + padding: 0px 1px; } div.post.reply p.body span.spoiler a { color: black; -- cgit v1.3 From 06c293217d167e80cef8252eea0d6dd04a1f552f Mon Sep 17 00:00:00 2001 From: thegentoo Date: Wed, 11 Jul 2012 16:14:33 -0300 Subject: Removed display:block; from span.heading --- stylesheets/style.css | 1 - 1 file changed, 1 deletion(-) (limited to 'stylesheets/style.css') diff --git a/stylesheets/style.css b/stylesheets/style.css index 2111a942..80042bd6 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -266,7 +266,6 @@ span.heading { color: #AF0A0F; font-size: 11pt; font-weight: bold; - display: block; } span.spoiler { background: black; -- cgit v1.3