vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [vbhacker] Mozilla Text Area Fix (https://vborg.vbsupport.ru/showthread.php?t=39428)

sidhighwind 06-03-2002 10:00 PM

[vbhacker] Mozilla Text Area Fix
 
This hack fixes the problem with Mozilla and the text area on the forum. Mozilla reads the width attribute different than netscape and causes the text area's to be narrow and very fustrating to use when you are typing in a lot of code or just a long message.

Description of what was changed:

I changed the function gettextareawidth to have mozilla use the width specified for IE instead of the width specified for Netscape.

I hope you all like my first hack.

SiD

sidhighwind 06-04-2002 02:20 PM

here is a screen shot of the before and after...

Tungsten 06-04-2002 03:13 PM

Installed it and am no worse for the wear. :) I don't get many Netscape users on my site but this will at least make it "friendlier" for them. Thanks.

snyx 06-04-2002 03:19 PM

I donno anyone who uses mozilla?!?

sidhighwind 06-04-2002 03:25 PM

Quote:

Originally posted by snyx
I donno anyone who uses mozilla?!?
I know a bunch of people that do. That is the only browser I use.

Floris 06-04-2002 05:36 PM

Besides IE6 I use Mozilla 1.0 rcX (nightly builds every weekend)
As soon as it goes gold, I will drop IE6 :)

Smoothie 06-04-2002 05:59 PM

Excuse please! Can't this be done by going to admin cp, styles, modify, text width areas? I changed mine to 70 for NS 6.0 to 70 and the text area looks the same as IE now. I'm using Mozilla ver 1 RC3 and the text area looks the same on both IE and Moz.

sidhighwind 06-04-2002 06:04 PM

Yes it can be done that way but if you get people that come to your forum with netscape 4.x it will look very wierd. That is why I did this hack.

Smoothie 06-04-2002 06:08 PM

But you can set the text width separately for Nutscrape 4.xx

MarkG 06-04-2002 06:36 PM

works, thanks!

Webmasta XT 06-05-2002 01:10 AM

what the heck is mozilla?

sidhighwind 06-05-2002 01:58 AM

Quote:

Originally posted by Webmasta XT
what the heck is mozilla?
It is the browser that Netscape is based off it. It is the most standards complient browser out on the market today. go check it out at http://www.mozilla.org

Smoothie 06-05-2002 02:06 AM

It is extremely fast. Blows the doors off Internet Exploiter.

Boofo 06-05-2002 06:18 AM

What would you recommend for the setting for Netscape 6 and 7 and Netscape 4? Set them all to 70 like IE is?

Quote:

Originally posted by Smoothie
Excuse please! Can't this be done by going to admin cp, styles, modify, text width areas? I changed mine to 70 for NS 6.0 to 70 and the text area looks the same as IE now. I'm using Mozilla ver 1 RC3 and the text area looks the same on both IE and Moz.

Smoothie 06-05-2002 07:42 AM

Quote:

Originally posted by Boofo
What would you recommend for the setting for Netscape 6 and 7 and Netscape 4? Set them all to 70 like IE is?


That's how I have mine set.

Boofo 06-05-2002 07:48 AM

Done, thanks! :)

Boofo 06-05-2002 08:00 AM

If you can change these settings in the Styles > Modify, why would you need to install this hack? I have them all set to 70 (Thanks goes out to Smoothie for this one). Isn't that basically what your hack does? :)

Internet Explorer 4+
Netscape Navigator 4.x
Netscape Navigator 6.0



Quote:

Originally posted by sidhighwind
Yes it can be done that way but if you get people that come to your forum with netscape 4.x it will look very wierd. That is why I did this hack.

Smoothie 06-05-2002 08:15 AM

I didn't add the hack because the changes in the admin cp/styles/text input area took care of the width problems.

Boofo 06-05-2002 08:18 AM

Anytime I can change a setting that will do what installing a hack does, then I'm with you on this one. :)

Quote:

Originally posted by Smoothie
I didn't add the hack because the changes in the admin cp/styles/text input area took care of the width problems.

Thomas P 06-06-2002 01:14 PM

Thanks, great mod - especially now when Mozilla went Gold,
10x,
-Tom

eiSecure 06-06-2002 01:17 PM

Quote:

Originally posted by Smoothie
I didn't add the hack because the changes in the admin cp/styles/text input area took care of the width problems.
That won't work, because Mozilla is not Netscape, so what you're doing is changing the widths for Netscape, and not Mozilla.

The default settings for all the browsers in the admin cp is correct. If you look at the code changes for this hack, you'll see that there is extra code that detects if the browser is indeed Mozilla, not Netscape or MSIE.

Then, it changes the text widths accordingly.

Smoothie 06-06-2002 04:57 PM

A screen shot of the Mozilla text window, after adjusting the text width in the style section, without the hack added. Actually, Mozilla is Netscape.

eiSecure 06-06-2002 05:13 PM

Quote:

Originally posted by Smoothie
A screen shot of the Mozilla text window, after adjusting the text width in the style section, without the hack added. Actually, Mozilla is Netscape.
Is that 1.0 Final? It doesn't work on mine...

Smoothie 06-06-2002 05:17 PM

It is. But it worked like that with all of the Mozilla releases, prior to the full release of ver 1.0, including the nightly builds.

eiSecure 06-06-2002 05:19 PM

Hmm....just be my browser settings that messed it up...

Replaced the useragent with AIM/30. ^_^

irc 09-16-2002 06:18 PM

I downloaded this hack, but I'm not exactly sure how to install it.

Do I replace the first version of the function with the second? Do I put it in my main folder and just run the php file?

Me stoopid, but me love mozilla.

irc 09-16-2002 08:41 PM

I manually made the hack. Thanks!

Thomas P 11-14-2002 10:17 PM

Recently upgraded to 2.2.8 and had to rehack.

Works great (I did it manually(!)).

cu,
-Tom

neocorteqz 01-05-2003 10:52 AM

Thanks. Great Idea, I'm surprised I didn't see this earlier. I was starting to get annoyed with the short text box area.

mjames 01-05-2003 02:36 PM

I'm looking to install this. So all you do is replace the gettextareawidth template with the file above?

Sketch 01-07-2003 01:08 AM

ergh....can someone please paste the instructions here. I don't know what's wrong with my PC, but I think I'm getting random screwy characters in downloaded text files. I keep getting T-String errors.... :(

Aaron

Smoothie 01-07-2003 01:59 AM

yea, login to your admin cp, styles, modify, click [fonts/colors/etc], scroll down to the bottom. Textarea Widths, change Netscape Navigator 6.0 to 70, click save changes. Works for me.

Erwin 02-10-2003 09:55 AM

Quote:

Originally posted by Smoothie
yea, login to your admin cp, styles, modify, click [fonts/colors/etc], scroll down to the bottom. Textarea Widths, change Netscape Navigator 6.0 to 70, click save changes. Works for me.
Yes, but the textarea in Netscape 6.0 may then be too big.

Without this hack, by default, vB 2.2.9 Mozilla uses Netscape 6.0 width, which is by default 40.

With this hack, vB 2.2.9 Mozilla uses the IE textarea width instead which is set at 70.

That's the difference.

Smoothie 02-10-2003 04:13 PM

They both (Mozilla, Netscape) appear the same (text area) to me, without this hack

Mr. X 04-05-2003 05:47 AM

Is there ever going to be .txt instructions posted or what? I could use this hack for some of my Moz users. The textarea in IE6 is fine, but in Moz its simply too small, and changing the values in the styles section does nothing.

Erwin 04-05-2003 09:32 AM

EDIT: Updated the instructions to make it clearer...

In functions.php, replace this section:

PHP Code:

// ###################### Start gettextareawidth #######################
function gettextareawidth() {
    
// attempts to fix idiotic Nutscrape textarea width problems
    
global $HTTP_USER_AGENT;

    if (
eregi("MSIE",$HTTP_USER_AGENT)) { // browser is IE
        
return "{textareacols_IE}";

    } elseif (
eregi("Mozilla/5.0",$HTTP_USER_AGENT)) { // browser is NS 6
        
return "{textareacols_NS6}";

    } elseif (
eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4
        
return "{textareacols_NS4}";

    } else { 
// unknown browser - stick in a sensible value
        
return 60;

    }



with this:

PHP Code:

// ###################### Start gettextareawidth #######################
function gettextareawidth() {
    
// attempts to fix idiotic Nutscrape textarea width problems
    
global $HTTP_USER_AGENT;

    if (
eregi("MSIE",$HTTP_USER_AGENT) || (eregi("Mozilla/5",$HTTP_USER_AGENT) && !eregi("Netscape6/",$HTTP_USER_AGENT))) { // browser is IE
        
return "{textareacols_IE}";
        
    } elseif (
eregi("Netscape6/",$HTTP_USER_AGENT)) { // browser is NS 6
        
return "{textareacols_NS6}";
        
    } elseif (
eregi("Mozilla/4.",$HTTP_USER_AGENT)) { // browser is NS4
        
return "{textareacols_NS4}";


    } else { 
// unknown browser - stick in a sensible value
        
return 60;

    }




attroll 04-05-2003 02:42 PM

Erwin

I did what you said above and I get the foolowing error:

Parse error: parse error, unexpected ',' in /home/attroll/public_html/forum/admin/functions.php on line 334

Fatal error: Call to undefined function: getuserinfo() in /home/attroll/public_html/forum/admin/sessions.php on line 366

Mr. X 04-05-2003 07:49 PM

Hmm, Im getting the same thing.

Erwin 04-05-2003 11:24 PM

When I cut and paste, I only left one / instead of the normal // for commenting out text. Sorry - try it again now. Btw, this is probably different to the code being used by the thread starter - this is code from vB.com developers (from memory).

attroll 04-05-2003 11:40 PM

Nope I get this error now which is pretty much the same one I got before.

Parse error: parse error, unexpected ',' in /home/attroll/public_html/forum/admin/functions.php on line 335

Fatal error: Call to undefined function: getuserinfo() in /home/attroll/public_html/forum/admin/sessions.php on line 366


All times are GMT. The time now is 04:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01268 seconds
  • Memory Usage 1,826KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete