Increase thread title character 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.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
timeforhelp
Registered User
Posts: 29
Joined: Sun Jul 13, 2008 9:17 pm

Increase thread title character limit.

Post by timeforhelp »

How do I up the amount of characters i can have in a thread title,i've looked in the ACP and can't find it.

Ta
timeforhelp
Registered User
Posts: 29
Joined: Sun Jul 13, 2008 9:17 pm

Re: Increase thread title character limit.

Post by timeforhelp »

Anyone? This must be easy peasy to most of you.
User avatar
Suyu
Registered User
Posts: 56
Joined: Sun Nov 02, 2008 7:39 pm

Re: Increase thread title character limit.

Post by Suyu »

Good evening,

Your feature is located in template/*yourtemplate*/posting_editor.html
At the line 100, it is in maxlength="".


:!: Ensure to put your number like this format ! :!:

Code: Select all

maxlength="<!-- IF S_NEW_MESSAGE -->X<!-- ELSE -->X+4<!-- ENDIF -->"
It's to ensure that on reply, the title of the post could contain the "Re: " characters !



Default code in maxlength=""

Code: Select all

maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->"
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51529
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Increase thread title character limit.

Post by stevemaury »

How long do you want it to be? The limit of 60 is set here, in includes/function_content.php:

Code: Select all

function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = true, $append = '')
You can increase the 60, but if you increase it very much, you will have to increase the 255 as well, which would then require that you increase the data type of topic_title in the topics table of the database, which is 255 by default.

EDIT - Suyu is also correct that you would need to edit that template as well.
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
Suyu
Registered User
Posts: 56
Joined: Sun Nov 02, 2008 7:39 pm

Re: Increase thread title character limit.

Post by Suyu »

So you have 2 modifications to do?

The truncate_string(); function is called before putting the post/topic's subject in the database? (just wanna know :p)
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51529
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Increase thread title character limit.

Post by stevemaury »

Yes, you would need to do both.

The title is stored in the db at up to 255 chars, by default.

See this comment in functions_content.php:

Code: Select all

/**
* Truncates string while retaining special characters if going over the max length
* The default max length is 60 at the moment
* The maximum storage length is there to fit the string within the given length. The string may be further truncated due to html entities.
* For example: string given is 'a "quote"' (length: 9), would be a stored as 'a "quote"' (length: 19)
*
* @param string $string The text to truncate to the given length. String is specialchared.
* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
* @param bool $allow_reply Allow Re: in front of string
* @param string $append String to be appended
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)
giorgiogio48
Registered User
Posts: 49
Joined: Sat May 07, 2005 4:41 pm

Re: Increase thread title character limit.

Post by giorgiogio48 »

Thanks to all! I solved my problem succesfully setting the length at 80 and 80+4 characters. I edited template posting_body.html instead of posting_editor.html, wich doesn't exist in my template.
alienbabeltech
Registered User
Posts: 415
Joined: Mon Sep 17, 2007 12:54 pm

Re: Increase thread title character limit.

Post by alienbabeltech »

I managed to solve a similar problem because of this thread, thanks



For AeroBlue I edited the posting_body.html file

In line 188

Code: Select all

	<td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="90" tabindex="2" value="{SUBJECT}" /></td>
I changed the maxlength to 90.

For Prosilver_se i edited the file posting_editor.html

Code: Select all

maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->"
changed the 60 and 64 to 94 and 98.
This is the best and most helpful community I have been on. You are some of the best people I have met. GOD Bless You ALL !
My Forum - http://alienbabeltech.com/abt/index.php
Locked

Return to “[3.0.x] Support Forum”