Advertisement:

Author Topic: Please how to increase the Subject length  (Read 3684 times)

Offline arasahmed

  • Newbie
  • *
  • Posts: 5
Please how to increase the Subject length
« on: March 20, 2014, 02:07:53 PM »
How to increase the Subject length in SMF 2.0.7

kat

  • Guest
Re: Please how to increase the Subject length
« Reply #1 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...

Code: [Select]
// 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. ;)

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Please how to increase the Subject length
« Reply #2 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
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

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

kat

  • Guest
Re: Please how to increase the Subject length
« Reply #3 on: March 20, 2014, 03:03:01 PM »
I've ever tried my way, Bruno. I may have typed a load of old bollox. :)

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Please how to increase the Subject length
« Reply #4 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 ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

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

kat

  • Guest
Re: Please how to increase the Subject length
« Reply #5 on: March 20, 2014, 03:41:18 PM »
I surprised myself, then. :)

Offline Toni8

  • Newbie
  • *
  • Posts: 5
Re: Please how to increase the Subject length
« Reply #6 on: March 27, 2014, 08:44:21 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

  • Guest
Re: Please how to increase the Subject length
« Reply #7 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. :)

Offline arasahmed

  • Newbie
  • *
  • Posts: 5
Re: Please how to increase the Subject length
« Reply #8 on: April 04, 2014, 08:34:10 PM »
there is no Post.php in the SMF 2.0.7

Offline Herman's Mixen

  • SMF Hero
  • ******
  • Posts: 7,235
    • HermanMixen on Facebook
    • @Hermans_Mixen on Twitter
    • Herman's Mixen
Re: Please how to increase the Subject length
« Reply #9 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 !!

How to increase the Subject length in SMF 2.0.7

Code: [Select]
/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 ;)

Offline NekoJonez

  • Full Member
  • ***
  • Posts: 503
  • Gender: Male
  • Stuff
    • @NekoJonez on Twitter
    • My blog
Re: Please how to increase the Subject length
« Reply #10 on: April 05, 2014, 06:12:24 AM »
There has been a mod made for this.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Offline arasahmed

  • Newbie
  • *
  • Posts: 5
Re: Please how to increase the Subject length
« Reply #11 on: April 05, 2014, 03:10:50 PM »
There has been a mod made for this.

Can you give us the link of the MOD ?

Offline NekoJonez

  • Full Member
  • ***
  • Posts: 503
  • Gender: Male
  • Stuff
    • @NekoJonez on Twitter
    • My blog
Re: Please how to increase the Subject length
« Reply #12 on: April 07, 2014, 11:26:29 AM »
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog