News:

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

Main Menu

Change the Length of the post title

Started by Aileen, December 10, 2007, 01:36:02 PM

Previous topic - Next topic

Aileen

is it possible to change the length of the post title? I think the characters a re limited to ...honestly I dont know how many characters can we put in the post title


Aileen

I tried it but it cannot extra characters on set the maximum. Hope there are other solutions for this thanks

Bulakbol

I understand what you mean.  If the maximum length is set to 50, typing should stop at 50th character and no need to check the length. The input should look like this: <input type='text' maxlength="50 ....> doesn't it.  Let's hope that someone with knowledge of MSF will come and help.  ;D
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Kays

The maxlength is set at 80 in Post.template.php. As well in Post.php there is a check to see if the length is longer than 100 characters. Search for "subject"

Additionally in BoardIndex.php, MessageIndex.php and Recent.php it gets shortened to 24 characters. Search for "shorten_subject"

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Bulakbol

When you type the topic title, cursor stop at 80th character. Where can I find the 80 character limit?  Can't seem to find it in Post.php. Am I missing something?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Bulakbol

Nevermind. I found it. It's in default/Post.template.php


<input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" />


change the "80" to the length of new topic/subject title you want.

Thanks for the help Kays.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Aileen


Bulakbol

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

SleePy

Please note the subject length was put in to prevent somebody from putting in a huge subject length and making a mess of the boardindex.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Aileen

Thanks, BTW. I tried to place a lenghty subject after changing the length in post.template.php. after saving it...it removed the extra charaters I added. Can we change this?

SleePy

Post.php

// At this point, we want to make sure the subject isn't too long.
if ($func['strlen']($_POST['subject']) > 100)
$_POST['subject'] = addslashes($func['substr'](stripslashes($_POST['subject']), 0, 100));


Also note that the subject may be limited as well in the database. If this is the case you will need to change the size of the subject and boost it some :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: