Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: arasahmed on March 20, 2014, 02:07:53 PM

Title: Please how to increase the Subject length
Post by: arasahmed on March 20, 2014, 02:07:53 PM
How to increase the Subject length in SMF 2.0.7
Title: Re: Please how to increase the Subject length
Post by: kat on March 20, 2014, 02:51:48 PM
Never tried this... So, keep a copy of the file, as a backup, in case I'm wrong...

Post.template.php in the default theme's directory...

// Now show the subject box for this post.
echo '
<dt>
<span', isset($context['post_error']['no_subject']) ? ' class="error"' : '', ' id="caption_subject">', $txt['subject'], ':</span>
</dt>
<dd>
<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text" />
</dd>


Change " size="80" maxlength="80" class="input_text" /> to suit you. But, be prepared for things to look rather weird, if it does work. That maximum length's there for some good reasons. ;)
Title: Re: Please how to increase the Subject length
Post by: margarett on March 20, 2014, 02:56:12 PM
It is controlled in several places, actually.

In the database, the field type is VARCHAR(255) which means it can't store more than 255 characters.
In Post.template.php, the max lenght allowed for the input box is 80 characters.
In Post.php, the max lenght allowed is 100 characters (taking in consideration special characters)

So, as long as you don't want to use more than 255, the change is more or less easy to accomplish

edit: ninja'd :P
Title: Re: Please how to increase the Subject length
Post by: kat on March 20, 2014, 03:03:01 PM
I've ever tried my way, Bruno. I may have typed a load of old bollox. :)
Title: Re: Please how to increase the Subject length
Post by: margarett on March 20, 2014, 03:05:09 PM
You did not. That's exactly what to change in my second point. But, there's a bit more to it ;)
Title: Re: Please how to increase the Subject length
Post by: kat on March 20, 2014, 03:41:18 PM
I surprised myself, then. :)
Title: Re: Please how to increase the Subject length
Post by: Toni8 on March 27, 2014, 08:44:21 PM
Quote from: margarett on March 20, 2014, 02:56:12 PM
It is controlled in several places, actually.

In the database, the field type is VARCHAR(255) which means it can't store more than 255 characters.
In Post.template.php, the max lenght allowed for the input box is 80 characters.
In Post.php, the max lenght allowed is 100 characters (taking in consideration special characters)

So, as long as you don't want to use more than 255, the change is more or less easy to accomplish

edit: ninja'd :P

Hi, do you know if there is any mod to do it? I've been searching but find nothing. Thanks.
Title: Re: Please how to increase the Subject length
Post by: kat on March 28, 2014, 06:43:06 AM
Nope. I don't think such a mod exists and I doubt it ever will, because doing such things can cause some pretty serious layout problems.

'course, someone might just go and prove me wrong. You never know. :)
Title: Re: Please how to increase the Subject length
Post by: arasahmed on April 04, 2014, 08:34:10 PM
there is no Post.php in the SMF 2.0.7
Title: Re: Please how to increase the Subject length
Post by: Herman's Mixen on April 04, 2014, 09:03:49 PM
As for as the database tweak is  neccessary, and the theme edit also, but depends on the layout you use, wide screens will do in most cases correct... responsive templates

for the rest there can be some theme tweaking in CSS and your Template files you USE !!

Quote from: arasahmed on March 20, 2014, 02:07:53 PM
How to increase the Subject length in SMF 2.0.7


/Sources/Post.php


FTP / SSH to your folder of SMF within find the /Sources folder... there it is :)
Title: Re: Please how to increase the Subject length
Post by: NekoJonez on April 05, 2014, 06:12:24 AM
There has been a mod made for this.
Title: Re: Please how to increase the Subject length
Post by: arasahmed on April 05, 2014, 03:10:50 PM
Quote from: NekoJonez on April 05, 2014, 06:12:24 AM
There has been a mod made for this.

Can you give us the link of the MOD ?
Title: Re: Please how to increase the Subject length
Post by: NekoJonez on April 07, 2014, 11:26:29 AM
http://custom.simplemachines.org/mods/index.php?mod=328

Well, it's not for 2.X :/