MyBB Community Forums

Full Version: previewing post in subject line
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I think the closest thing that is available at the moment is this

http://mods.mybboard.com/view.php?did=296
Try this modification

In newreply.php, find:
	// Set the thread data that came from the input to the $thread array.
Above it, add:
if(empty($mybb->input['subject']))
{
$mybb->input['subject'] = substr($mybb->input['message'], 0, 30);
$mybb->input['subject'] .= (strlen($mybb->input['message']) > 30) ? '...' : '';
}
DennisTT Wrote:Try this modification

In newreply.php, find:
	// Set the thread data that came from the input to the $thread array.
Above it, add:
if(empty($mybb->input['subject']))
{
$mybb->input['subject'] = substr($mybb->input['message'], 0, 30);
$mybb->input['subject'] .= (strlen($mybb->input['message']) > 30) ? '...' : '';
}

I'm sorry, I do not see that comment in newreply.php. The closest I see is // Set the post data that came from the input to the $post array.
I meant newthread.php, please smack me.
DennisTT Wrote:I meant newthread.php, please smack me.

thank you very very much
How would I change the default length of the subject so that I can add more chars using this code?
elodge4 Wrote:How would I change the default length of the subject so that I can add more chars using this code?

Change the two instances of the number 30 in the code modification
DennisTT Wrote:
elodge4 Wrote:How would I change the default length of the subject so that I can add more chars using this code?

Change the two instances of the number 30 in the code modification

right, I get that, but if I change them to a number, say 200, then 200 char's do not get displayed so there must be a limit set somewhere else
thanks
thnks........
elodge4 Wrote:
DennisTT Wrote:
elodge4 Wrote:How would I change the default length of the subject so that I can add more chars using this code?

Change the two instances of the number 30 in the code modification

right, I get that, but if I change them to a number, say 200, then 200 char's do not get displayed so there must be a limit set somewhere else
thanks

There's a hard limit to the length a subject can be (by default): 120 characters. If you want longer ones, you will need to run an SQL query

run this SQL code in phpMyAdmin?
ALTER TABLE `swcforums_threads` CHANGE `subject` `subject` VARCHAR( 120 ) NOT NULL 
(Remember to replace any instance of mybb_ with your forum's database table prefix, if different)
Pages: 1 2