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

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 01:57:10 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 190
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 211
  • Total: 211

Shoutbox character limit

Started by Kim, March 04, 2021, 12:03:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kim

Hi
I am trying to increase the character limit in the shoutbox but no matter what value I put in the box, it doesn't increase and stays at 300 
What am I doing wrong?  :hmm: :doh:
Thanks for any help

lurkalot

Hi Kim.  What version of SMF and TinyPortal are you running please?

I think 300 is the maximum allowed without modifying the code. There should I guess be a note added to that setting stating this to save confusion.

Kim

I'm running SMF 2.0.17 and TP 1.6.4

How do alter the code please?

lurkalot

Kim you should really upgrade because there was security issues with TinyPortal prior to versions older than 1.6.6

But in answer to your question,  In sources find file TPShout.php

Around line 175 you should find,

$shout = $smcFunc['htmlspecialchars'](substr($_POST['tp_shout'], 0, 300));

Change the 300 on the end of that line to 500 and save

Kim

Thank you and I'll upgrade asap  O0

@rjen

The 300 characters max surprised me a little: we have a setting for it, never realized that there is also a maximum coded. I think it will update that to use the maxlength setting from the shoutbox
Running Latest TP on SMF2.1 at: www.fjr-club.nl

lurkalot

Well to be honest I wasn't sure if the hard coded limit was still supposed to be there since you can enter any number in the shout settings.  But that limit has been in the code for a long time tbh. 

@rjen

Just checked it: you can use any number in the settings, but due to the hard-coded 300 it will always stop at 300, even if the setting is set higher...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

lurkalot

Quote from: @rjen on March 07, 2021, 08:15:03 PM
Just checked it: you can use any number in the settings, but due to the hard-coded 300 it will always stop at 300, even if the setting is set higher...

Yep, that's why I mentioned the workaround edit to the line above.  Pretty sure changing that line worked for me when I tried it. 

@rjen

Running Latest TP on SMF2.1 at: www.fjr-club.nl