Topic: Make maximum post lengths longer?

I was wondering if it is possible to change the maximum amount of characters in a post. I tried changing the number 65535  in post.php to a number like 9999999 which would almost be unlimited. By doing this though, I screwed things up. Now I have a clean install and was wondering if it is possible to change the limit.

Thanks in advance for any help.

The following errors need to be corrected before the message can be posted:
    * Posts cannot be longer that 65535 characters (64 KB).

Re: Make maximum post lengths longer?

why would you want to? 65535 is massive

3

Re: Make maximum post lengths longer?

try changing it to something a little lower than 9999999 but higher than what it is at now.

Re: Make maximum post lengths longer?

Connorhd wrote:

why would you want to? 65535 is massive

For a large music list.

mark36ph wrote:

try changing it to something a little lower than 9999999 but higher than what it is at now.

I will try that. Thank you.

Re: Make maximum post lengths longer?

I changed 65535 to 80000 but it still gives me "Posts cannot be longer that 65535 characters (64 KB)."

I tried editing it hear in post.php.

    if ($message == '')
        message($lang_post['No message']);
    else if (strlen($message) > 80000)
        message($lang_post['Too long message']);
    else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $cur_user['status'] < PUN_MOD)
        message($lang_post['No caps message']);

I am not good with php, so I am probably doing this completely wrong.

6

Re: Make maximum post lengths longer?

In punbb_post, the message field is type Text, you'd have to change the database field to another type to hold more information.

TEXT
String length + 2 bytes
A string with a maximum length of 65,535 characters.

MEDIUMTEXT
String length + 3 bytes
A string with a maximum length of 16,777,215 characters.

LONGTEXT
String length + 4 bytes
A string with a maximum length of 4,294,967,295 characters.

Re: Make maximum post lengths longer?

You would also have to change the datatype of the message column in the database. Change it from text to mediumtext.

Changing that in post.php (and in edit.php if you want it to apply to editing as well) and changing the column type in the database should do it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8 (edited by a63548 2004-12-31 02:01)

Re: Make maximum post lengths longer?

Thanks a lot. I will give that a try. I also wanted to say thank you for the great forum software. smile

EDIT: Worked perfectly. Thanks