post title

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
living199
Registered User
Posts: 65
Joined: Thu Oct 19, 2006 7:48 pm
Contact:

post title

Post by living199 » Sun Jan 27, 2008 1:39 pm

how do i change the maximum size of a post title?

thanks

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

Re: post title

Post by ameeck » Sun Jan 27, 2008 3:10 pm

Find this in includes/functions_posting.php:

Code: Select all

$subject = truncate_string($subject);
$data['topic_title'] = truncate_string($data['topic_title']); 
and replace it with this:

Code: Select all

  $subject = truncate_string($subject, 100);
$data['topic_title'] = truncate_string($data['topic_title'], 100); 
'100' is the max number of chars, you can safely change it up to ~200.

You will also have to change the data type for the title fields in the database.

post_subject in phpbb_posts
topic_title in phpbb_topics
from VARCHAR(100) to VARCHAR(255).

You can do this with these two queries:

Code: Select all

ALTER TABLE phpbb_posts MODIFY post_subject VARCHAR(255) NOT NULL;
ALTER TABLE phpbb_topics MODIFY topic_title VARCHAR(255) NOT NULL;

living199
Registered User
Posts: 65
Joined: Thu Oct 19, 2006 7:48 pm
Contact:

Re: post title

Post by living199 » Mon Feb 04, 2008 4:19 pm

thanks.

sorry it took so long to reply

davidm_nodeo
Registered User
Posts: 6
Joined: Wed Feb 13, 2008 9:09 pm

Re: post title

Post by davidm_nodeo » Sun Feb 17, 2008 8:24 pm

Thanks for this, as I needed it... crystal clear instructions, 2mns implemented :)

User avatar
TheHighwayman
Registered User
Posts: 28
Joined: Wed Jun 06, 2007 5:05 pm

Re: post title

Post by TheHighwayman » Tue Mar 18, 2008 12:17 pm

Thank you ameeck, for the answer.
I'm looking for it.

However, I have noticed there are other database fields must be modified, that are topic_last_post_subject e forum_last_post_subject.
Besides also charset and collation must be added.

So queries to be done, are:

Code: Select all

ALTER TABLE phpbb_posts MODIFY post_subject VARCHAR(255) character set utf8 collate utf8_unicode_ci NOT NULL default '';
ALTER TABLE phpbb_topics MODIFY topic_title VARCHAR(255) character set utf8 collate utf8_unicode_ci NOT NULL default '';
ALTER TABLE phpbb_topics MODIFY topic_last_post_subject VARCHAR(255) collate utf8_bin NOT NULL default '';
ALTER TABLE phpbb_forums MODIFY forum_last_post_subject VARCHAR(255) collate utf8_bin NOT NULL default '';
Change charset and collation, if you use other ones.

Regards
The Highwayman
"The wind was a torrent of darkness among the gusty trees
The moon was a ghostly galleon tossed upon the cloudy seas
The road was a ribbon of moonlight over the purple moor
And the highwayman came riding, riding, riding,
The highwayman came riding, up to the old inn-door..."
(Alfred Noyes)

AUDIOMIND
Registered User
Posts: 10
Joined: Wed Jun 20, 2007 4:09 pm
Location: Charlottean, NC
Contact:

Re: post title

Post by AUDIOMIND » Tue Sep 23, 2008 3:34 pm

anyone else did this with success for 3.0x?
http://www.audiomind.us - ABA's Musical Cataclysm

Where DJs and producers unite and share events, stories, musical [ideas] & production techniques:
http://groups.myspace.com/electronicmayhem

You measure a democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

ziplock122940
Registered User
Posts: 36
Joined: Sat Sep 08, 2007 8:57 am

Re: post title

Post by ziplock122940 » Sat Oct 11, 2008 11:26 pm

AUDIOMIND wrote:anyone else did this with success for 3.0x?
nope, just tried. all of my database values were already 255. I have even tried changing the values in posting_editor inside the template but that has not helped. I am building a new site running 3.0.2
Daily Deals & Coupons-Deals, coupons and free stuff for Computer components, electronics and more.
Computer Parts, CPU's, Hard Drives, Video Cards, Memory, RAM

AUDIOMIND
Registered User
Posts: 10
Joined: Wed Jun 20, 2007 4:09 pm
Location: Charlottean, NC
Contact:

Re: post title

Post by AUDIOMIND » Mon Oct 13, 2008 2:52 am

ugh....

there must be a way to lengthen the post title. it is aggravating!
http://www.audiomind.us - ABA's Musical Cataclysm

Where DJs and producers unite and share events, stories, musical [ideas] & production techniques:
http://groups.myspace.com/electronicmayhem

You measure a democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: post title

Post by Linda Carter » Thu Aug 12, 2010 7:11 pm

Is there a way to make this work in the last 3.0.7-PL1 version?

I have tried changing that file and performing both SQL queries but nothing seems to work.
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."

Bluesplayer
Registered User
Posts: 8
Joined: Sun Nov 18, 2007 12:02 pm

Re: post title

Post by Bluesplayer » Thu Nov 25, 2010 11:51 pm

I am running version 3.0.8 and I managed to alter the topic length by:

Find this in includes/functions_posting.php (as mentioned by ameeck above):

Code: Select all

$subject = truncate_string($subject);
$data['topic_title'] = truncate_string($data['topic_title']); 
and replace it with this:

Code: Select all

$subject = truncate_string($subject, 200);
$data['topic_title'] = truncate_string($data['topic_title'], 200); 
I then altered this string in posting_body.html:

Code: Select all

<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" />
to this:

Code: Select all

<!-- IF S_NEW_MESSAGE -->80<!-- ELSE -->84<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" />
The above allowed a longer title to be inserted when creating a topic or editing a topic title.

I used the forum admin template editor and I didn't need to refresh the cache, but if you manually alter it I should think you would have to refresh the cache.

Seems to work fine now.

dueller
Registered User
Posts: 13
Joined: Mon Sep 20, 2010 8:54 am

Re: post title

Post by dueller » Sat Dec 25, 2010 7:55 pm

Thank you Bluesplayer. I recently updated my forum to 3.0.8 and your solution works great.

qu4rk
Registered User
Posts: 33
Joined: Sun Mar 13, 2011 4:47 am

Re: post title

Post by qu4rk » Tue Mar 15, 2011 7:57 pm

I am running version 3.0.8 as well. I don't see a includes/functions_posting.php. Did the file change or am I missing something?

Thanks

User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Re: post title

Post by Alien_Time » Sun Jun 26, 2011 11:50 pm

Hi Guys,

I am using phpbb 3.0.8 as well and I tried to do the above steps to increase the length of the post title and nothing seems to change...This is what I did so far:

I added the following code in includes/functions_posting.php:

Find

Code: Select all

$subject = truncate_string($subject);
$data['topic_title'] = truncate_string($data['topic_title']);
And Replaced with:

Code: Select all

$subject = truncate_string($subject, 200);
$data['topic_title'] = truncate_string($data['topic_title'], 200);
I could not find the codes to alter the string in posting_body.html as mentioned by Bluesplayer above. So where is this code? does it need to be changed?

Code: Select all

<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" />
Anyways, after this i went ahead and added the following queries in phpmyadmin:

Code: Select all

ALTER TABLE phpbb_posts MODIFY post_subject VARCHAR(255) NOT NULL;
ALTER TABLE phpbb_topics MODIFY topic_title VARCHAR(255) NOT NULL;
The above sql query was executed successfully showing the below results in the end:

Code: Select all

ALTER TABLE phpbb_posts MODIFY post_subject VARCHAR(255) NOT NULL;# 989 row(s) affected.

ALTER TABLE phpbb_topics MODIFY topic_title VARCHAR(255) NOT NULL;# 231 row(s) affected.
Even with the sql query, I wasnt able to run the query that Bluesplayer mentioned above. The Bluesplayer's sql query gives me an error. So I just did the query as given by ameeck.

Now, even after doing the above, the post title still has a limit of only 60 characters. I cleared the cache and I tried it by creating a new topic and also trying to edit topic titles...its still only 60 characters...How does it work? How to change it??

User avatar
Alien_Time
Registered User
Posts: 389
Joined: Fri Dec 31, 2010 7:08 am

Re: post title

Post by Alien_Time » Mon Jun 27, 2011 12:09 am

HI everyone...

I got it to work now...I was looking around the files and I edited the following in the template/posting_editor.html file:

Find:

Code: Select all

	<!-- IF S_POST_ACTION or S_PRIVMSGS or S_EDIT_DRAFT -->
	<dl style="clear: left;">
		<dt><label for="subject">{L_SUBJECT}:</label></dt>
		<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>
	</dl>
Replaced with:

Code: Select all

	<!-- IF S_POST_ACTION or S_PRIVMSGS or S_EDIT_DRAFT -->
	<dl style="clear: left;">
		<dt><label for="subject">{L_SUBJECT}:</label></dt>
		<dd><input type="text" name="subject" id="subject" size="45" maxlength="200" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
	</dl>
After that I cleared the cache and viola! Its works...

I hope what i did was correct since its working now..But I am too sure if there is something else to edit as well...if someone can confirm this, it would be great!

Cheers...

FreddyGdiP
Registered User
Posts: 48
Joined: Mon Nov 07, 2011 8:52 pm

Re: post title

Post by FreddyGdiP » Wed Nov 09, 2011 4:06 pm

I´m using version 3.0.9 and tried to follow the steps suggested by BluesPlayer but couldn´t find the string in posting_body.html
To summarize, since there seem to be a lot of steps and missteps to increase the length of the post title, what are the correct steps to do this on version 3.0.9? Anyone out there with the same problem?
Thanks!

Locked

Return to “[3.0.x] Support Forum”