Post a longer subject length?

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
dherder75
Registered User
Posts: 6
Joined: Thu Sep 29, 2011 11:09 pm
Contact:

Re: Post a longer subject length?

Post by dherder75 »

It seems as if the workaround of modifying the posting_editor.html does not work in 3.0.9, but does work in 3.0.8. I've made the same modification in prosilver...

from:

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>
to:

Code: Select all

<dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->196<!-- ELSE -->200<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
and have updated includes/functions_posting.php from:

Code: Select all

	$subject = truncate_string($subject);
	$data['topic_title'] = truncate_string($data['topic_title']);
to:

Code: Select all

	$subject = truncate_string($subject, 200);
	$data['topic_title'] = truncate_string($data['topic_title'], 200);
I've also changed functions_content.php from:

function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')

to:

Code: Select all

function truncate_string($string, $max_length = 200, $max_store_length = 255, $allow_reply = false, $append = '')
... and no love. In 3.0.8, all I did was modify the posting_editor.html and I was able to at least enter more than 60 characters to the text input box. In 3.0.9, no matter what, I cannot even enter the value into the html input. My changes to the .html were made through the ACP editor, and the changes to the .php were made in Notepad++ on the web server itself. Did a flush cache and reload templates... no change.
Last edited by dherder75 on Fri Sep 30, 2011 4:06 pm, edited 1 time in total.
User avatar
doktornotor
Registered User
Posts: 608
Joined: Fri Sep 09, 2011 7:41 am

Re: Post a longer subject length?

Post by doktornotor »

You need to alter the DB tables as well! Read this, works 100%: Increase Subject Length.
Support requests via PM go straight to /dev/null!
dherder75
Registered User
Posts: 6
Joined: Thu Sep 29, 2011 11:09 pm
Contact:

Re: Post a longer subject length?

Post by dherder75 »

All of the values in that old post apply to phpbb pre 3.0.4. After 3.0.4, all of these values are set to varchar(255) by default. There is no need to alter the db after 3.0.4.
User avatar
doktornotor
Registered User
Posts: 608
Joined: Fri Sep 09, 2011 7:41 am

Re: Post a longer subject length?

Post by doktornotor »

dherder75 wrote:All of the values in that old post apply to phpbb pre 3.0.4. After 3.0.4, all of these values are set to varchar(255) by default. There is no need to alter the db after 3.0.4.
Do as you wish. I tell you that the howto works 100% fine. Provided you DO run the SQL alter commands.
Support requests via PM go straight to /dev/null!
dherder75
Registered User
Posts: 6
Joined: Thu Sep 29, 2011 11:09 pm
Contact:

Re: Post a longer subject length?

Post by dherder75 »

As I mentioned in my original email, the instructions work fine on v3.0.8, but on a 3.0.9 system, the behaviour is such that I cannot even enter a subject length in excess of 60 characters. With this type of behaviour, I would think that something is limiting the .html entry, not the database insert maximum limit. If it was a database problem, I would expect the behaviour that after entering a subject greater than 60 characters in length, it would return a value that is truncated.

My problem is that I can't even enter a value greater than 60 characters as input. Again, only in 3.0.9 do I experience this issue.
User avatar
doktornotor
Registered User
Posts: 608
Joined: Fri Sep 09, 2011 7:41 am

Re: Post a longer subject length?

Post by doktornotor »

dherder75 wrote:As I mentioned in my original email, the instructions work fine on v3.0.8, but on a 3.0.9 system, the behaviour is such that I cannot even enter a subject length in excess of 60 characters.
If you go to the forum mentioned in my profile, you will see that it works perfectly fine on 3.0.9. You simply are doing something wrong.
Support requests via PM go straight to /dev/null!
simochi
Registered User
Posts: 1
Joined: Sat Jun 09, 2012 9:08 pm

Re: Post a longer subject length?

Post by simochi »

Hi. I really need your help.

I can't find the includes/functions_posting.php
where is that located ?
please help. thank you.
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: Post a longer subject length?

Post by Jessica »

simochi wrote:Hi. I really need your help.

I can't find the includes/functions_posting.php
where is that located ?
please help. thank you.
should be in the includes folder.
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
User avatar
FloridaMan339
Registered User
Posts: 112
Joined: Thu Jan 07, 2010 11:58 pm
Location: Fort Myers, Florida
Name: Randy Wood
Contact:

Re: Post a longer subject length?

Post by FloridaMan339 »

In 3.0.10, the subject length is split between first post and replies. To change it to 90 characters (more than that will start to run into the poster's avatar), change the instructions in the first post to make the changes twice, like below:

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 -->90<!-- ELSE -->90<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
	</dl>
Notice the length changed BEFORE and AFTER the

Code: Select all

<!-- ELSE -->
.

Rest of the instructions on page one are the same.
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: Post a longer subject length?

Post by Jessica »

or you can just use this snippet in this topic: http://www.phpbb.com/community/viewtopi ... &t=2111996

you'll be able to set the length in the ACP
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Post a longer subject length?

Post by Oyabun1 »

FloridaMan339 wrote:... (more than that will start to run into the poster's avatar)
No it won't, it will just wrap onto another line.
FloridaMan339 wrote:... change the instructions in the first post to make the changes twice, like below:

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 -->90<!-- ELSE -->90<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
	</dl>
You really want the number after the <!-- ELSE --> to be 4 higher than the previous number to allow for the additional 4 characters taken up by the default "Re: " in replies. Otherwise, the last 4 characters of a 90 character subject in a reply would just be truncated.

Also, if your members often post long subjects you may want to increase the size of the subject box displayed, the id="subject" size="45" part.

So, for your example, the line in styles/prosilver/template/posting_editor.html would be:

Code: Select all

<dd><input type="text" name="subject" id="subject" size="80" maxlength="<!-- IF S_NEW_MESSAGE -->86<!-- ELSE -->90<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
FloridaMan339
Registered User
Posts: 112
Joined: Thu Jan 07, 2010 11:58 pm
Location: Fort Myers, Florida
Name: Randy Wood
Contact:

Re: Post a longer subject length?

Post by FloridaMan339 »

Oyabun1 wrote:
FloridaMan339 wrote:... (more than that will start to run into the poster's avatar)
No it won't, it will just wrap onto another line.
Interesting. When I tried it on my board, it didn't word wrap.
This image is from the portal, but the regular post looked the same:

Image
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Post a longer subject length?

Post by Oyabun1 »

Yes, you're correct if the subject is one word of 90+ characters. But in the real world, where users of Western languages follow the usual grammatical convention of separating words with spaces, such overlapping won't occur.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
Locked

Return to “[3.0.x] MOD Requests”