Browse Source

Add support for hiding text until it is hovered over

Use <s>text here</s> or <spoiler>text here</spoiler>
shortcut
Trevor Slocum 1 month ago
parent
commit
e954a78ac5
4 changed files with 26 additions and 0 deletions
  1. +11
    -0
      css/global.css
  2. +7
    -0
      imgboard.php
  3. +6
    -0
      inc/defines.php
  4. +2
    -0
      settings.default.php

+ 11
- 0
css/global.css View File

@ -82,6 +82,17 @@ hr {
border-bottom-color: rgba(0, 0, 0, .5);
}
.spoiler {
text-decoration: none;
color: transparent;
text-shadow: 0 0 10px #000000;
}
.spoiler:hover {
color: inherit;
text-shadow: none;
}
.userdelete {
float: right;
text-align: center;


+ 7
- 0
imgboard.php View File

@ -333,6 +333,13 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name'])
$post['message'] = preg_replace('/([^\s]{' . TINYIB_WORDBREAK . '})(?=[^\s])/', '$1' . TINYIB_WORDBREAK_IDENTIFIER, $post['message']);
}
$post['message'] = str_replace("\n", '<br>', makeLinksClickable(colorQuote(postLink(cleanString(rtrim($post['message']))))));
if (TINYIB_SPOILERTEXT) {
$post['message'] = preg_replace('/&lt;s&gt;(.*?)&lt;\/s&gt;/i', '<span class="spoiler">$1</span>', $post['message']);
$post['message'] = preg_replace('/&lt;spoiler&gt;(.*?)&lt;\/spoiler&gt;/i', '<span class="spoiler">$1</span>', $post['message']);
$post['message'] = preg_replace('/&lt;spoilers&gt;(.*?)&lt;\/spoilers&gt;/i', '<span class="spoiler">$1</span>', $post['message']);
}
if (TINYIB_WORDBREAK > 0) {
$post['message'] = finishWordBreak($post['message']);
}


+ 6
- 0
inc/defines.php View File

@ -79,6 +79,12 @@ if (!defined('TINYIB_AUTOHIDE')) {
if (!defined('TINYIB_REQMOD')) {
define('TINYIB_REQMOD', '');
}
if (!defined('TINYIB_SPOILERTEXT')) {
define('TINYIB_SPOILERTEXT', false);
}
if (!defined('TINYIB_SPOILERIMAGE')) {
define('TINYIB_SPOILERIMAGE', false);
}
if (!defined('TINYIB_AUTOREFRESH')) {
define('TINYIB_AUTOREFRESH', 30);
}


+ 2
- 0
settings.default.php View File

@ -30,6 +30,8 @@ define('TINYIB_MANAGECAPTCHA', ''); // Improve security by requiring users to
define('TINYIB_REPORT', false); // Allow users to report posts
define('TINYIB_AUTOHIDE', 0); // Amount of reports which will cause a post to be hidden until it is approved [0 to disable]
define('TINYIB_REQMOD', ''); // Require moderation before displaying posts: files / all ['' to disable]
define('TINYIB_SPOILERTEXT', false); // Allow users to hide text until it is hovered over using the tags <s>text here</s> or <spoiler>text here</spoiler>
define('TINYIB_SPOILERIMAGE', false); // Allow users to blur thumbnails via a "Spoiler" checkbox
define('TINYIB_AUTOREFRESH', 30); // Delay (in seconds) between attempts to refresh a thread automatically [0 to disable]
define('TINYIB_CLOUDFLARE', false); // Only enable when the site is served via Cloudflare to identify IP addresses correctly
define('TINYIB_DISALLOWTHREADS', ''); // When set, users attempting to post a new thread are shown this message instead ['' to disable]


Loading…
Cancel
Save