Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Gryzor on December 23, 2008, 11:24:08 AM

Title: Modify reply/quick reply text box size?
Post by: Gryzor on December 23, 2008, 11:24:08 AM
Exactly as asked in subject: how do I make the text box bigger? I bet it's simple but I must be missing something...

Using 2.0b4. Thanks so much for the wonderful software - and merry Christmas!!!
Title: Re: Modify reply/quick reply text box size?
Post by: Oldiesmann on December 23, 2008, 11:37:36 AM
For the main reply box:

Sources/Post.php

Find
Code: (Lines 1039-1048) [Select]
// Now create the editor.
$editorOptions = array(
'id' => 'message',
'value' => $context['message'],
'labels' => array(
'post_button' => $context['submit_label'],
),
// We do XML preview here.
'preview_type' => 2,
);

Replace
Code: [Select]
// Now create the editor.
$editorOptions = array(
'id' => 'message',
'value' => $context['message'],
'labels' => array(
'post_button' => $context['submit_label'],
),
'columns' => 60,
'rows' => 12,
// We do XML preview here.
'preview_type' => 2,
);

Change the values for columns and rows to your liking.

For the quick reply, you'll need to edit Display.template.php:

Find
Code: (Line 638) [Select]
<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
Title: Re: Modify reply/quick reply text box size?
Post by: Gryzor on December 23, 2008, 12:04:20 PM
Ahhh it's a PHP thing. Darn, and I spent so much time looking around in options and stuff :D Thanks lots, appreciate the ultra-fast reply!

Hmmm, neither seems to work...? :(
Title: Re: Modify reply/quick reply text box size?
Post by: Oldiesmann on December 23, 2008, 12:33:15 PM
Try clearing the file cache.

Admin -> Maintenance -> Forum Maintenance
Scroll down and click on "Empty the file cache".
Title: Re: Modify reply/quick reply text box size?
Post by: Gryzor on December 23, 2008, 12:38:54 PM
Didn't work... How strange! Could it have something to do with Apache serving out old versions of the script? Nah, what am I talking about, Apache gets PHP's output anyway...
Title: Re: Modify reply/quick reply text box size?
Post by: SlammedDime on December 23, 2008, 12:39:33 PM
settings rows and columns won't work, you have to set the 'width' and 'height' attributes. (just like rows and columns above, but use 'width' and 'height' instead.
Title: Re: Modify reply/quick reply text box size?
Post by: Gryzor on December 23, 2008, 12:51:00 PM
Hmm... I'm trying:

Code: [Select]
// Now create the editor.
$editorOptions = array(
'id' => 'message',
'value' => $context['message'],
'labels' => array(
'post_button' => $context['submit_label'],
),
'width' => 120,
'height' => 80,
// We do XML preview here.
'preview_type' => 2,
);
create_control_richedit($editorOptions);

I take it 'width' defines columns, 'height' is rows. I've also tried other, less extreme figures, but it still doesn't work...
Title: Re: Modify reply/quick reply text box size?
Post by: Oldiesmann on December 23, 2008, 01:01:57 PM
You need to specify the unit for the width and height.

The default width is 150px and the default height is 70%.

Doing this would make the box twice as wide and 25% higher:

Code: [Select]
   // Now create the editor.
   $editorOptions = array(
      'id' => 'message',
      'value' => $context['message'],
      'labels' => array(
         'post_button' => $context['submit_label'],
      ),
      'width' => '300px',
      'height' => '95%',
      // We do XML preview here.
      'preview_type' => 2,
   );
   create_control_richedit($editorOptions);

Just play with those values til you find something you like.
Title: Re: Modify reply/quick reply text box size?
Post by: Gryzor on December 23, 2008, 01:15:23 PM
Ah, and I suspected it might be something like that (not the % thing though, but px is easy to guess). However, I seem to be hitting some kind of hard limit. Right now, for instance, I have set it up to 1000px, 1000%. And it still won't go over 12 lines deep (which is my main concern). If I lower the values it does become smaller, but not bigger.

Maybe look someplace else as well?
Title: Re: Modify reply/quick reply text box size?
Post by: Oldiesmann on December 23, 2008, 01:40:29 PM
Once you hit 100% height, it's displaying all the rows, so you'll need to increase the number of rows at that point.
Title: Re: Modify reply/quick reply text box size?
Post by: Gryzor on December 23, 2008, 02:22:30 PM
Wait - so I have to set the height to 100% and THEN the number of rows to whatever I need it to be?
Title: Re: Modify reply/quick reply text box size?
Post by: SlammedDime on December 23, 2008, 02:30:54 PM
Set the width in percent, set the height in pixels.  Don't even worry about rows and columns.  When you set width and height with CSS, they become pointless.  Right now oldies is directing you backwards on it. :)
Title: Re: Modify reply/quick reply text box size?
Post by: Gryzor on December 23, 2008, 02:37:35 PM
Width in %, height in px, not the opposite as described above in the quoted code. Ok, will try it and report...

[edit]Yup! That did it. Thanks guys :)