diff --git a/inc/8chan-mod-pages.php b/inc/8chan-mod-pages.php index 9d1479bd..03aea763 100644 --- a/inc/8chan-mod-pages.php +++ b/inc/8chan-mod-pages.php @@ -524,6 +524,28 @@ OEKAKI; $hour_max_threads = 'false'; } + if (isset($_POST['max_pages'])) { + $mp = (int)$_POST['max_pages']; + if ($mp > 25 || $mp < 2) { + $max_pages = 15; + } else { + $max_pages = $mp; + } + } else { + $max_pages = 15; + } + + if (isset($_POST['reply_limit'])) { + $rl = (int)$_POST['reply_limit']; + if ($rl > 750 || $rl < 250 || $rl % 25) { + $reply_limit = 250; + } else { + $reply_limit = $rl; + } + } else { + $reply_limit = 250; + } + if (!(strlen($title) < 40)) error('Invalid title'); if (!(strlen($subtitle) < 200)) @@ -564,6 +586,8 @@ OEKAKI; \$config['tor_posting'] = $tor_posting; \$config['new_thread_capt'] = $new_thread_capt; \$config['hour_max_threads'] = $hour_max_threads; +\$config['reply_limit'] = $reply_limit; +\$config['max_pages'] = $max_pages; $code_tags $katex $oekaki $replace $multiimage $allow_flash $allow_pdf $user_flags if (\$config['disable_images']) \$config['max_pages'] = 10000; diff --git a/settings.php b/settings.php index f6f6b7f8..2d29a122 100644 --- a/settings.php +++ b/settings.php @@ -41,6 +41,8 @@ $safe_config['user_flags'] = $config['user_flags']; $safe_config['wordfilters'] = $config['wordfilters']; $safe_config['latex'] = $config['katex']; $safe_config['code_tags'] = in_array('js/code_tags/run_prettify.js', $config['additional_javascript']); +$safe_config['max_pages'] = $config['max_pages']; +$safe_config['reply_limit'] = $config['reply_limit']; echo json_encode($safe_config); diff --git a/templates/mod/settings.html b/templates/mod/settings.html index db53a887..22eafea6 100644 --- a/templates/mod/settings.html +++ b/templates/mod/settings.html @@ -50,6 +50,8 @@ {% trans %}Enable CAPTCHA for thread creation only{% endtrans %}
Users must solve a CAPTCHA in order to create new threads,
but do not have to solve a CAPTCHA in order to post replies.
{% trans %}Public bans{% endtrans %}
{% trans %}Displays your bans for the public{% endtrans %} {% trans %}Public action log{% endtrans %}
{% trans %}Displays all actions to the public{% endtrans %}{% for i in range(2, 25) %}{% endfor %} + {% trans %}Bump limit{% endtrans %} {% trans %}Language{% endtrans %}
{% trans %}To contribute translations, register at Transifex{% endtrans %}