Browse Source

Add TINYIB_EXPANDWIDTH

shortcut
Trevor Slocum 1 year ago
parent
commit
7202b733af
  1. 3
      inc/defines.php
  2. 5
      inc/html.php
  3. 1
      settings.default.php

3
inc/defines.php

@ -94,6 +94,9 @@ if (!defined('TINYIB_ALWAYSNOKO')) {
if (!defined('TINYIB_WORDBREAK')) {
define('TINYIB_WORDBREAK', 0);
}
if (!defined('TINYIB_EXPANDWIDTH')) {
define('TINYIB_EXPANDWIDTH', 85);
}
if (!defined('TINYIB_TIMEZONE')) {
define('TINYIB_TIMEZONE', '');
}

5
inc/html.php

@ -424,6 +424,7 @@ function buildPost($post, $res) {
$filesize .= (isEmbed($post['file_hex']) ? __('Embed:') : __('File:')) . ' ';
}
$w = TINYIB_EXPANDWIDTH;
if (isEmbed($post["file_hex"])) {
$expandhtml = $post['file'];
} else if (substr($post['file'], -5) == '.webm' || substr($post['file'], -4) == '.mp4') {
@ -432,12 +433,12 @@ function buildPost($post, $res) {
$dimensions = 'width="' . $post['image_width'] . '" height="' . $post['image_height'] . '"';
}
$expandhtml = <<<EOF
<video $dimensions style="position: static; pointer-events: inherit; display: inline; max-width: 100%; max-height: 100%;" controls autoplay loop>
<video $dimensions style="position: static; pointer-events: inherit; display: inline; max-width: $w%; max-height: 100%;" controls autoplay loop>
<source src="$direct_link"></source>
</video>
EOF;
} else if (in_array(substr($post['file'], -4), array('.jpg', '.png', '.gif'))) {
$expandhtml = "<a href=\"$direct_link\" onclick=\"return expandFile(event, '${post['id']}');\"><img src=\"" . ($res == TINYIB_RESPAGE ? "../" : "") . "src/${post["file"]}\" width=\"${post["image_width"]}\" style=\"max-width: 100%;height: auto;\"></a>";
$expandhtml = "<a href=\"$direct_link\" onclick=\"return expandFile(event, '${post['id']}');\"><img src=\"" . ($res == TINYIB_RESPAGE ? "../" : "") . "src/${post["file"]}\" width=\"${post["image_width"]}\" style=\"max-width: $w%;height: auto;\"></a>";
}
$thumblink = "<a href=\"$direct_link\" target=\"_blank\"" . ((isEmbed($post["file_hex"]) || in_array(substr($post['file'], -4), array('.jpg', '.png', '.gif', 'webm', '.mp4'))) ? " onclick=\"return expandFile(event, '${post['id']}');\"" : "") . ">";

1
settings.default.php

@ -41,6 +41,7 @@ define('TINYIB_THREADSPERPAGE', 10); // Amount of threads shown per index page
define('TINYIB_PREVIEWREPLIES', 3); // Amount of replies previewed on index pages
define('TINYIB_TRUNCATE', 15); // Messages are truncated to this many lines on board index pages [0 to disable]
define('TINYIB_WORDBREAK', 80); // Words longer than this many characters will be broken apart [0 to disable]
define('TINYIB_EXPANDWIDTH', 85); // Expanded content size as a percentage of the screen's width
define('TINYIB_TIMEZONE', 'UTC'); // See https://secure.php.net/manual/en/timezones.php - e.g. America/Los_Angeles
define('TINYIB_CATALOG', true); // Generate catalog page
define('TINYIB_JSON', true); // Generate JSON files

Loading…
Cancel
Save