News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Please how to increase the Subject length

Started by arasahmed, March 20, 2014, 02:07:53 PM

Previous topic - Next topic

arasahmed

How to increase the Subject length in SMF 2.0.7

kat

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. ;)

margarett

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
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

kat

I've ever tried my way, Bruno. I may have typed a load of old bollox. :)

margarett

You did not. That's exactly what to change in my second point. But, there's a bit more to it ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair


Toni8

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.

kat

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. :)

arasahmed


Herman's Mixen

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 :)
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

NekoJonez

Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

arasahmed


NekoJonez

Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Advertisement: