Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[vbhacker] Mozilla Text Area Fix Details »»
[vbhacker] Mozilla Text Area Fix
Version: 1.00, by sidhighwind sidhighwind is offline
Developer Last Online: Feb 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-03-2002 Last Update: Never Installs: 28
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 04-05-2003, 11:44 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I've made the instructions very clear in case people were replacing only the commented out line (but surely not) - find that code and REPLACE the WHOLE SECTION.

It should work.
Reply With Quote
  #43  
Old 04-06-2003, 01:29 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It won't work. You got way too many brackets with the eregi stuff now.
Reply With Quote
  #44  
Old 04-06-2003, 01:35 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uh... count the brackets carefully. It does work. Because it's the same code running on my forums for the past 6 months.
Reply With Quote
  #45  
Old 04-06-2003, 01:39 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you muist have a magic site.

One on the left and 2 on the right and it still works?

("Netscape6/",$HTTP_USER_AGENT))
Reply With Quote
  #46  
Old 04-06-2003, 02:24 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo... look at that line of code carefully. COUNT the number of brackets.

Don't confuse the OR bits with the AND bits... The Netscape is joined with the Mozilla variables...

If you can't count, I can't help you.

P.S - vB.org is definitely not magical, but it has this code installed...
Reply With Quote
  #47  
Old 04-06-2003, 02:27 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let me break it down for you, since you obviously can't count, yet insist on trying to be smart.

if (eregi("MSIE",$HTTP_USER_AGENT)

this first part - opens a new bracket, the IE one is open and closed, 1 bracket still needs to be closed...

|| (eregi("Mozilla/5",$HTTP_USER_AGENT) &&

Opens another bracket, the Mozilla is open and closed, so we have 2 brackets to be closed now.

!eregi("Netscape6/",$HTTP_USER_AGENT))) {

The Netscape variables are open and closed, so then we close the 2 brackets.

See?

Next time, count, before trying to criticize code released by others.
Reply With Quote
  #48  
Old 04-06-2003, 02:39 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Erwin, I was counting before you were even born.

This is the line I was referring to.

PHP Code:
} elseif ("Netscape6/",$HTTP_USER_AGENT)) { // browser is NS 6
        
return "40"
And I have looked over at vb.com for this fix and I didn't see it anywhere.

Edit: You're not even using eregi in your new code, by the way.
Reply With Quote
  #49  
Old 04-06-2003, 03:19 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes you must have a magic site because I have done this three time and still get the same error even after you changed your directions. Are you sure you did not change something somewhere else maybe? I don't think I am that bad I have installed mods before.
Reply With Quote
  #50  
Old 04-06-2003, 03:29 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

attroll, try this. I'm not very good at counting so it may not work. Let me know.

[disable]// ###################### 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;

}

}[/disable]
Reply With Quote
  #51  
Old 04-06-2003, 03:48 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup that did it with yours Boofo. I don't know if it actiually works with Mozilla though. I will have to wait until one of my users comes online to find out. But at least I am not getting any errors now.

THanks Boofo
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:09 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04755 seconds
  • Memory Usage 2,306KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete