It would be nice to be able to change the lenght of the messages. Cant seem to find it in the codes, eventhough it would be nice to be able to change it in settings

CommentFileSizeAuthor
#3 shoutbox.PNG34.67 KBgnite

Comments

gnite’s picture

In the shoutbox.module file find

  $form['message'] = array(
    '#type' => 'textfield',
    '#default_value' => $default_msg,
    '#size' => 15,
  );

and to that array add

    '#maxlength' => 500,

or any other length you want, the default is 128. Should work fine.

kaspertor’s picture

It doesnt work! - It still cut messages off after 128

gnite’s picture

StatusFileSize
new34.67 KB

I just tried it on an installation I use for testing and it does work, should look like this exactly:

  $form['message'] = array(
    '#type' => 'textfield',
    '#default_value' => $default_msg,
    '#size' => 15,
    '#maxlength' => 500,
  );

And I found another limitation - the field in the database is limited to 255 characters, if the shout is longer it won't be saved at all. You need to edit the 'shout' field in the 'shoutbox' table of your database to allow longer values. Below is a screenshot for proof.

kaspertor’s picture

Just tried that - It works, it dont cut it now. BUT - It just displays the message as one line, doesnt display it like your message (Normal messages)?! (shoutbox.PNG)

mstef’s picture

Status: Active » Closed (duplicate)