How to remove topic title length limit?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
mattpist
Registered User
Posts: 5
Joined: Thu Oct 11, 2007 9:52 pm

Re: How to remove topic title length limit?

Post by mattpist » Fri Nov 02, 2007 12:16 am

ameeck wrote:VARCHAR is not data of any kind, it is a type of collumn for holding relatively small strings(text).

The collumn is called post_subject. It is in the phpbb_posts table. If you access it through an interface like phpMyAdmin, you should see the data type in the Structure tab of the table page.
found it, thanks!

Captain Tinrib
Registered User
Posts: 8
Joined: Sat Mar 08, 2008 7:06 am

Re: How to remove topic title length limit?

Post by Captain Tinrib » Sun Mar 09, 2008 2:05 pm

Can someone please write an easy step through for doing this? Need 120 chars.

DOne the mysql VARCHAR.

The rest of the code isn't playing game..

Many thanks

User avatar
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: How to remove topic title length limit?

Post by ameeck » Sun Mar 09, 2008 4:04 pm

Edit the PHP files as described here(just replace 100 with your 120):
http://www.phpbb.com/community/viewtopi ... 5#p4065205
and edit the template as discussed here(again, just supply your desired values):
http://www.phpbb.com/community/viewtopi ... 5#p4557305

User avatar
wtf-bollos
Registered User
Posts: 26
Joined: Mon Aug 21, 2006 3:33 pm
Location: the garden of england

Re: How to remove topic title length limit?

Post by wtf-bollos » Thu Jun 19, 2008 5:17 pm

hi,

just popped in to say that this helped me.

i am running 2.0.21

i changed maxlength of the input box in posting_body.tpl from 60 to 100...

...and the length of the db field topic_title in the phpbb_topics table from 60 to 100.

worked a treat, thx!

User avatar
guardog
Registered User
Posts: 61
Joined: Sun Aug 03, 2008 2:19 pm

Re: How to remove topic title length limit?

Post by guardog » Sun Aug 03, 2008 9:52 pm

I'm running 3.0.2, I've done all the changes mentioned in functions_posting.php , posting_editor.html as well as my database (just for your information, the varchar max length is now set at 255 by default), but it didn't work.

Something is preventing the maxlength to be altered, as can be seen (60) in the source of the post.php page generated.
Last edited by guardog on Sun Aug 03, 2008 9:56 pm, edited 1 time in total.
Dream and reality...
What's the difference?...

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50892
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: How to remove topic title length limit?

Post by stevemaury » Sun Aug 03, 2008 9:55 pm

Did you refresh the template?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
guardog
Registered User
Posts: 61
Joined: Sun Aug 03, 2008 2:19 pm

Re: How to remove topic title length limit?

Post by guardog » Sun Aug 03, 2008 10:01 pm

opps, sorry. I thought purging the cache in the ACP index means refreshing the template.

Refreshed the template, it's working now. But still, having long title doesn't seem that nice, perhaps having a topic description will help (so that topic title don't have to be too long) :P
Dream and reality...
What's the difference?...

User avatar
zombie.47
Registered User
Posts: 40
Joined: Wed Aug 27, 2008 1:07 pm
Contact:

Re: How to remove topic title length limit?

Post by zombie.47 » Mon Mar 30, 2009 10:37 pm

hi,
i changed this limit before and it worked fine. but now, it doesn't seem to work anymore.

the thing is, after a changed the limit in the template file to 94, when i'm writing a new topic i can write up to 94 characters in the subject field. when i hit "Preview" everything is fine and my 94 characters are there. but whet i hit "Submit" and i view the new topic, there are only the first 60 characters.

as i said, i did it before and it worked fine, so i know how to do it.
but i don't know what's wrong now.
(i'm running phpbb 3.0.4)
thank you in advance.

User avatar
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: How to remove topic title length limit?

Post by ameeck » Tue Mar 31, 2009 7:41 am

Did you change the length of the db field topic_title in the phpbb_topics table from 60 to 100?

User avatar
zombie.47
Registered User
Posts: 40
Joined: Wed Aug 27, 2008 1:07 pm
Contact:

Re: How to remove topic title length limit?

Post by zombie.47 » Tue Mar 31, 2009 8:40 am

the topic_title field it is set to 255

User avatar
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: How to remove topic title length limit?

Post by ameeck » Tue Mar 31, 2009 9:00 am

post_subject in phpbb_posts the same?

User avatar
zombie.47
Registered User
Posts: 40
Joined: Wed Aug 27, 2008 1:07 pm
Contact:

Re: How to remove topic title length limit?

Post by zombie.47 » Tue Mar 31, 2009 9:54 am

yes, it's also set to 255

bloggerme2
Registered User
Posts: 4
Joined: Wed May 27, 2009 5:55 am

Re: How to remove topic title length limit?

Post by bloggerme2 » Mon Jun 01, 2009 6:38 am

ToonArmy wrote:

Code: Select all

$ grep -nRi truncate_string . | grep subject
./includes/functions_posting.php:1506:  $subject = truncate_string($subject);
truncate_string()

Code: Select all

$ grep -nRi truncate_string . | grep "function "
./includes/functions.php:3450:function truncate_string($string, $max_length = 60, $allow_reply = true, $append = '')

OK where is this? An what do I do with this?

It seems to have solved the guys problem but there is no explanation as to what to do with this. I would like to know as I am having the same trouble. Thanks.

User avatar
AdamR
Former Team Member
Posts: 9731
Joined: Tue Mar 02, 2004 5:40 pm
Location: Tampa, Florida
Name: Adam Reyher
Contact:

Re: How to remove topic title length limit?

Post by AdamR » Mon Jun 01, 2009 6:46 am

bloggerme2 wrote:OK where is this? An what do I do with this?

It seems to have solved the guys problem but there is no explanation as to what to do with this. I would like to know as I am having the same trouble. Thanks.
That's a *nix server command. You can do the same thing by manually editing the includes/functions_content.php file:

Find:

Code: Select all

function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = true, $append = '')
Edit the $max_length = 60 part in the line to change the maximum length.

Please note you'll also need to make the necessary changes in the database and template.

- Adam
phpBB Support: Welcome | Userguide | Knowledge Base | Search
Honored supporter of the phpBB Group!
"If I have seen a little further it is by standing on the shoulders of Giants." - Isaac Newton

natong
Registered User
Posts: 25
Joined: Wed Apr 22, 2009 10:54 am

Re: How to remove topic title length limit?

Post by natong » Tue Jul 21, 2009 12:06 pm

Thanks for all infos.

For v3.0.5

1. Script

includes/functions_content.php:1102

Code: Select all

function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = true, $append = '')
2. Prosilver template

styles/prosilver/template/posting_editor.html:100

Code: Select all

              <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
styles/prosilver/template/mcp_topic.html:69

Code: Select all

            <dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SPLIT_SUBJECT}" title="{L_SPLIT_SUBJECT}" class="inputbox" /></dd>
3. Subsilver2 template

styles/subsilver2/template/mcp_topic.html:15

Code: Select all

            <td class="row2" colspan="2"><input class="post" style="width: 350px" type="text" size="35" maxlength="64" name="subject" value="{SPLIT_SUBJECT}" /></td>
styles/subsilver2/template/ucp_main_drafts.html:58

Code: Select all

              <td class="row2"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{DRAFT_SUBJECT}" /></td>
styles/subsilver2/template/posting_body.html:176

Code: Select all

        <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
4. Clear template cache

Locked

Return to “[3.0.x] Support Forum”