View Full Version : Message Area Width
Kiint
10-15-2007, 02:16 PM
I'm having a few problems creating a customised "Message Area Width" for a page I'm creating.
I've tried the following method but the width of the form is restricted by the style i'm using, yet I don't want to change the style as this will mess up the rest of the site, I only want it on this particular form
// bring up empty VBform to insert text
$article["message"] = 'Enter your first step here';
$stylevar['messagewidth'] = 580;
$show['wysiwyg'] = ($setting['allow_bbcode'] ? is_wysiwyg_compatible() : 0);
$istyles_js = construct_editor_styles_js();
$show['qr_require_click'] = 0;
$editorid = construct_edit_toolbar($article["message"], 0, '', ($setting['allow_smilies'] ? 1 : 0), 1, false, 'fe');
$messagearea = "
<script type=\"text/javascript\">
<!--
var require_click = false;
var threaded_mode = 1;
var is_last_page = false;
// -->
</script>
$messagearea
";
I'd like to have the form resize to the width of the table it's in, but no matter what I change $stylevar['messagewidth'] to, the style over-rides it. If I remove that line the style will set the width :(
so is it possible to use the code above to make the message area resize to the size of the table that I want to display it in?
Please help
RobDog888
10-15-2007, 05:55 PM
Try...
$textareacols = fetch_textarea_width();
Kiint
10-16-2007, 02:28 PM
I'm not quite sure how that would apply when I'm using just $messageares within my template?
I've found your post on the subject regarding the Quick Reply editor which does go full width, but without all the editing options which I want to keep.
Do you know how to make this work on the full editor?
--------------- Added 16 Oct 2007 at 17:47 ---------------
discovered that I can alter the message width by using the following:
$stylevar['messagewidth'] = '750px';
which is fine if I want a fixed width, but have tried various methods with % but nothing seems to work...
$stylevar['messagewidth'] = '100%'; //doesn't do anything
$stylevar['messagewidth'] = 100%; //brings up error
$stylevar['messagewidth'] = 'auto'; //doesn't do anything
$stylevar['messagewidth'] = auto; //doesn't do anything
Surely there must be a way?
RobDog888
10-16-2007, 06:55 PM
<font color="darkgreen">Changing the style var will change the messagearea width for all your areas with a messagearea on it. Yes, I have had issues with setting the width as I would get different widths in different browsers and such. I was albel to get it right without using the built in text editor but thats not what I wanted.
Did you make the plugin for it too to hook the hook?</font>
Kiint
10-16-2007, 07:06 PM
Changing the style var will change the messagearea width for all your areas with a messagearea on it. Yes, I have had issues with setting the width as I would get different widths in different browsers and such. I was albel to get it right without using the built in text editor but thats not what I wanted.
Did you make the plugin for it too to hook the hook?
I'm not using a plugin for this at the moment, although I may change to that in the future (when i learn how) now that I've got it mostly working, I'm using a seperate php page that uses the vbulletin templates and database with the built in editor to edit each part.
It's mainly the width of the editor that is holding me back now, My style is not fixed width so I want the message area to reflect that....
I can change the "message width" style for each form that I wish to display, but can only make it a fixed width, not dynamic with percentages....and I don't want to edit the main template style as you mentioned, it will change all forms to change.
I can change it for each form to a fixed width using the code below.
$article["message"] = 'Enter your first step here';
$stylevar['messagewidth'] = '750px';
$show['wysiwyg'] = ($setting['allow_bbcode'] ? is_wysiwyg_compatible() : 0);
$istyles_js = construct_editor_styles_js();
$show['qr_require_click'] = 0;
$editorid = construct_edit_toolbar($article["message"], 0, '', ($setting['allow_smilies'] ? 1 : 0), 1, false, 'fe');
$messagearea = "
<script type=\"text/javascript\">
<!--
var require_click = false;
var threaded_mode = 1;
var is_last_page = false;
// -->
</script>
$messagearea
";
RobDog888
10-16-2007, 08:09 PM
Not sure if you have seen this?
https://vborg.vbsupport.ru/showthread.php?t=135708
Kiint
10-17-2007, 01:34 PM
Not sure if you have seen this?
https://vborg.vbsupport.ru/showthread.php?t=135708 (https://vborg.vbsupport.ru/showthread.php?t=135708)
Yep, this was where I originally got the message form from, She did a good job of explaining it all, and those downloadable files sure helped. Nothing on changing the width though sadly.
Thanks for your help, its' appreciated.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.