TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 488
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 87
  • Total: 87

Shoutbox Character Limit

Started by nomadic, September 30, 2011, 10:48:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nomadic

Link to my site: http://www.thecbg.org
SMF version: 1.1.15
TP version: TinyPortal 1.0 RC1.1
Default Forum Language: English
Theme name and version: Silverplus
Browser Name and Version: Firefox 7.0.1

I've had some complaints from users on my site that the shoutbox character limit is too low and I'd like to up it from where it's at (about 300 I think) to a higher limit so it doesn't cut people off as quickly (my members are very verbose people heh). There doesn't seem to be a setting in the admin CP and looking through the shoutbox code I haven't been able to track down where it is truncating the shouts. If someone could tell me how to increase the character limit on the shoutbox I would be most grateful :)

IchBin

In the tp-files/tp-modules/TPShout/Sources/TPshout.php file find this line and change it to what you need.

$oldshout = strip_tags(substr($_POST['tp_shout'], 0, 300));

nomadic

#2
Quote from: IchBinâ,,¢ on October 01, 2011, 01:22:24 AM
In the tp-files/tp-modules/TPShout/Sources/TPshout.php file find this line and change it to what you need.

$oldshout = strip_tags(substr($_POST['tp_shout'], 0, 300));

I had tried this, unfortunately it didn't change anything.

Edit: talked with people some more and they said they would be happy with just having the textbox cut them off instead of letting them write more characters than is actually allowed. So then where would I go to find the stylesheet for the textarea (id=tp_shout)? I looked in the shoutbox.css file and it is not inside that.

IchBin

The line I said to change works exactly as stated. I just checked it myself. You can allow or restrict more characters that way. But there's currently no way to limit the characters of a textarea by changing the HTML or CSS. The only way you could probably do that is to put some javascript in there that will count the characters and let them know if they've gone over the amount you are allowing.

nomadic

Quote from: IchBinâ,,¢ on October 01, 2011, 08:34:33 PM
The line I said to change works exactly as stated. I just checked it myself. You can allow or restrict more characters that way. But there's currently no way to limit the characters of a textarea by changing the HTML or CSS. The only way you could probably do that is to put some javascript in there that will count the characters and let them know if they've gone over the amount you are allowing.

I tried it by setting it to 1000 and the limit still remained at 300 when I reloaded the page and tested. Anyhow could you perhaps tell me where the code is that generates the textarea?

IchBin

TPShout.template.php file is where the code for it is at.

This website is proudly hosted on Crocweb Cloud Website Hosting.