Advertisement:

Author Topic: Change the Length of the post title  (Read 2229 times)

Offline Aileen

  • Full Member
  • ***
  • Posts: 474
  • Gender: Female
Change the Length of the post title
« 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
« Last Edit: December 10, 2007, 07:37:04 PM by Aileen »

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Change the Lenght of the post title
« Reply #1 on: December 10, 2007, 06:46:49 PM »
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline Aileen

  • Full Member
  • ***
  • Posts: 474
  • Gender: Female
Re: Change the Length of the post title
« Reply #2 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

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Change the Length of the post title
« Reply #3 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
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Change the Length of the post title
« Reply #4 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"

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

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Change the Length of the post title
« Reply #5 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?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Change the Length of the post title
« Reply #6 on: December 11, 2007, 05:55:12 AM »
Nevermind. I found it. It's in default/Post.template.php

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

Offline Aileen

  • Full Member
  • ***
  • Posts: 474
  • Gender: Female
Re: Change the Length of the post title
« Reply #7 on: December 11, 2007, 09:14:09 AM »
thank you so much

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Change the Length of the post title
« Reply #8 on: December 11, 2007, 10:44:22 AM »
My pleasure.  ;)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,321
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Change the Length of the post title
« Reply #9 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.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Aileen

  • Full Member
  • ***
  • Posts: 474
  • Gender: Female
Re: Change the Length of the post title
« Reply #10 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?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,321
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Change the Length of the post title
« Reply #11 on: December 11, 2007, 03:30:17 PM »
Post.php

Code: [Select]
// 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
Support the SMF Support team!
Profiles:
GitHub