Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Aileen on December 10, 2007, 01:36:02 PM

Title: Change the Length of the post title
Post by: Aileen on December 10, 2007, 01:36:02 PM
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
Title: Re: Change the Lenght of the post title
Post by: Bulakbol on December 10, 2007, 06:46:49 PM
This might help you.

http://www.simplemachines.org/community/index.php?topic=84144.0
Title: Re: Change the Length of the post title
Post by: Aileen on December 10, 2007, 07:41:29 PM
I tried it but it cannot extra characters on set the maximum. Hope there are other solutions for this thanks
Title: Re: Change the Length of the post title
Post by: Bulakbol on December 10, 2007, 08:06:45 PM
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
Title: Re: Change the Length of the post title
Post by: Kays on December 10, 2007, 08:31:32 PM
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"
Title: Re: Change the Length of the post title
Post by: Bulakbol on December 11, 2007, 01:07:53 AM
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?
Title: Re: Change the Length of the post title
Post by: Bulakbol on December 11, 2007, 05:55:12 AM
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.
Title: Re: Change the Length of the post title
Post by: Aileen on December 11, 2007, 09:14:09 AM
thank you so much
Title: Re: Change the Length of the post title
Post by: Bulakbol on December 11, 2007, 10:44:22 AM
My pleasure.  ;)
Title: Re: Change the Length of the post title
Post by: SleePy on December 11, 2007, 01:36:54 PM
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.
Title: Re: Change the Length of the post title
Post by: Aileen on December 11, 2007, 02:33:58 PM
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?
Title: Re: Change the Length of the post title
Post by: SleePy on December 11, 2007, 03:30:17 PM
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 :)