How to Modify Flarum Theme Post-Related Properties

6,886 0

First, I also created a Flarum site. However, when many users post, they enter titles carelessly, sometimes with only one or two characters, making the entire site look unattractive. Therefore, post properties must be restricted. This article mainly explains how to restrict properties related to discussion topics.

Discussion Title Length

Modify the following file:

Plain Text
vendor/flarum/core/src/Core/Validator/DiscussionValidator.php

Set min:3 and max:80 to require a minimum of 3 characters and a maximum of 80 characters. Modify them according to your needs.

Post Content Length

Modify the following file:

Plain Text
vendor/flarum/core/src/Core/Validator/PostValidator.php

Change max:65535 to max:2147483647, so the post content limit changes from 21845 Chinese characters to being essentially unlimited.

Warning: Excessively long posts may sometimes cause unnecessary errors.

Posting Interval

Modify the following file:

Plain Text
vendor/flarum/core/src/Core/Post/Floodgate.php

Change -10 seconds to the interval you need (the default is 10 seconds).

Comments

(0)

No comments yet. Start the conversation.

Leave a comment