Picnic Website Code Tutorials

phpBB How To Increase Subject Line Max Character Limit

5/17/2013 phpBB long Subject Line

Default is 60. Thats too short for most forums. If we only raise it to max 100 characters or less we don't have to mess with any SQL queries. Need more than 100 character limit? Find another tut. The following is for the default prosilver template. Other templates code will be similar but not identical. But the steps the same.

Step One

Open includes/functions_posting.php and find the line thats says... $subject = truncate_string($subject); $data['topic_title'] = truncate_string($data['topic_title']); and add 100 (or less) to it in two places as so.

$subject = truncate_string($subject, 100);
$data['topic_title'] = truncate_string($data['topic_title'], 100);
		

Step Two

Open styles/prosilver/template/posting_editor.html and find the line thats says... <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> and change 60 to 100 and 64 to 104 in one place as so.

<dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->100<!-- ELSE -->104<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
		

That's it! Enjoy a longer subject line.

Sponsors

Top Donators

Friends of Mine