You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 127 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Firefox incompatibility re: bbcode [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Syenna
Private
Private


Joined: Aug 27, 2004
Posts: 47


PostPosted: Mon Oct 11, 2004 2:07 pm Reply with quoteBack to top

I've wondered about this for a while.

Using Firefox, it doesn't seem that the buttons to insert bbcode work properly. When I highlight text and hit (for example) the (bold) button, it will stick a [/b] at the end of the post, but nothing anywhere near the text I just selected.

This was never a problem for me, as I learned to just type my tags. It became a problem when I recommended that everyone who comes to my site give Firefox a try. After going on and on about how much better it was, how much more stable and secure, etc., of course one of the first comments was how our site didn't work with Firefox because the bbcode buttons were broken. Embarassed

I finally found several threads on the Mozilla forums that indicate that this is not a Firefox bug, per se. Apparently PHP-Nuke (and other CMS's that implement WYSIWYG editors) use some Javascript functions that are IE-proprietary, and implemented differently in Firefox (I think it was document.selection.createRange().text that's causing the problem, but I'm not certain).

There is a Firefox extension to create a workaround for this problem, but IMO, my users shouldn't have to install a browser add-in in order to use my site properly.

Has anyone heard of a workaround for this problem? Maybe outputting one chunk of javascript if the user is using IE, and another if they're using Firefox? Seems to me that it's an issue with the bbstyle function, and wouldn't be that hard to fix for someone who knows what they're doing. I unfortunately know very little about Javascript, but I'm tempted to learn just so that my site works properly for those users who have heeded my advice to try Firefox -- the more converts I can get, the better off we'll all be.

Anyways, thanks for listening, and thanks for any advice anyone can provide.

Syenna
Find all posts by SyennaView user's profileSend private message
BrainSmashR
Support Mod
Support Mod


Joined: Jan 05, 2004
Posts: 1390

Location: Louisiana, USA

PostPosted: Tue Oct 12, 2004 4:11 am Reply with quoteBack to top

http://nukecops.com/postt35686.html

2 incidents now that are Firefox exclusive.

My opinion, firefox is crap (at least the current version).

In short, my problem is Firefox won't display a simple table that works in the other big 3 browsers, AND alters the default language for everything below that block.

_________________
ImageImage
USE THE FORUM. If you contact me via messenger for support I will add you to my ignore list.
Find all posts by BrainSmashRView user's profileSend private messageVisit poster's websiteYahoo MessengerMSN MessengerICQ Number
edubb
Nuke Soldier
Nuke Soldier


Joined: Jul 23, 2004
Posts: 19


PostPosted: Tue Oct 12, 2004 5:07 am Reply with quoteBack to top

Just experienced this myself as well. Installed phpbb template and my friend was using FireFox, IE myself, and he couldn't see the forum at all except the head image.
Find all posts by edubbView user's profileSend private messageSend e-mailVisit poster's website
Syenna
Private
Private


Joined: Aug 27, 2004
Posts: 47


PostPosted: Wed Oct 13, 2004 2:59 am Reply with quoteBack to top

Well, I'm not sure about your problem, but from what I understand, the problem that I describe is not technically a problem with Firefox, but a problem with the BBtoNuke package making use of a non-standard Javascript function. Given all of the other advantages Firefox offers, I don't think that two problems with PHP-Nuke makes Firefox crap, especially given what a total piece of horses* IE is, security- and functionality-wise.

[sort of off-topic]
Here's my opinion; I think that MS has IE use non-standard functionality like this not because it makes the browsing experience better, but because it leads to people who try an alternative browser coming to the conclusion that the browser is broken because it won't render certain pages properly because the designers have only designed it for IE (that is, not compliant with standards). I'd say that most of the web pages that don't render properly in Firefox are because the coders have used IE-native functions -- not because Firefox is broken.
[/sort of off-topic]

Anyways, back to topic. I think this is a BBtoNuke issue in its use of a non-standard JS function that only works in IE. Is there anyone who knows of a fix to get this to work in Firefox and other browsers who actually do make use of standard JS?

(BTW Brain, I've got the utmost respect for all the support you offer here, and I don't want to turn this into a "my browser is bigger than your browser" thing -- I just want to get this problem fixed)

Syenna
Find all posts by SyennaView user's profileSend private message
BrainSmashR
Support Mod
Support Mod


Joined: Jan 05, 2004
Posts: 1390

Location: Louisiana, USA

PostPosted: Fri Oct 15, 2004 3:13 pm Reply with quoteBack to top

Quote:
problem that I describe is not technically a problem with Firefox, but a problem with the BBtoNuke package making use of a non-standard Javascript function.


LOl, in English, we call that a problem exclusive to Firefox.

Quote:
Given all of the other advantages Firefox offers, I don't think that two problems with PHP-Nuke makes Firefox crap, especially given what a total piece of horses* IE is, security- and functionality-wise.


IE is not the only other browser out there, and not being able to properly view either of our own websites without tweaking the browser is a BIG problem for Firefox, since:
1) I do not have access to edit all browsers for all users.

2) All other browsers seem to handle this "problem" just fine.

In short, like you, I too was in love with Firefox, but have now found a total of 4 users (3 on this topic alone) here on Nukecops, that are having problems or know of issues that are specific to Firefox.

Good luck in your search for the cure, and be sure to post it so we can both go back to Firefox.

_________________
ImageImage
USE THE FORUM. If you contact me via messenger for support I will add you to my ignore list.
Find all posts by BrainSmashRView user's profileSend private messageVisit poster's websiteYahoo MessengerMSN MessengerICQ Number
Syenna
Private
Private


Joined: Aug 27, 2004
Posts: 47


PostPosted: Sat Oct 16, 2004 6:54 pm Reply with quoteBack to top

Ok, I may have gotten this problem fixed. It was indeed an issue with the use of document.selection.createRange() in the bbstyle Javascript function in the file posting_body.tpl.

(Sidenote: Whee! I can finally highlight and tag text)

I will apologize in advance if this is kludgy or inelegant. I don't know Javascript, and had to cobble together bits and pieces of stuff I found elsewhere. If you can see a way to improve this, I am definitely all ears.

I've also only tested it on Firefox and IE. I'm sure someone who's a little more conversant in JS could make it so the "alternate portion" runs only under Firefox, but that's beyond me at this point.

Replace the following code (around line 140) in the file themes/YourTheme/forums/posting_body.tpl:

Code:
   if ((clientVer >= 4) && is_ie && is_win)
      theSelection = document.selection.createRange().text; // Get text selection
      
   if (theSelection) {
      // Add tags around selection
      document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
      document.post.message.focus();
      theSelection = '';
      return;
   }


with:

Code:
if ((clientVer >= 4) && is_ie && is_win)
   {
   theSelection = document.selection.createRange().text; // Get text selection
   if (theSelection)
      {
      document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
      document.post.message.focus();
      theSelection = '';
      return;
      }
   }
   else  // Firefox part follows
   {
   posttextarea = document.post.message;
   selected=(posttextarea.value).substring(posttextarea.selectionStart,posttextarea.selectionEnd);
   str=bbtags[bbnumber] + selected + bbtags[bbnumber+1];
   posttextarea.focus();
   start=posttextarea.selectionStart;
   end=posttextarea.textLength;
   endtext=posttextarea.value.substring(posttextarea.selectionEnd,end);
   starttext=posttextarea.value.substring(0,start);
   posttextarea.value=starttext + str + endtext;
   posttextarea.selectionStart=start;
   posttextarea.selectionEnd=start;
   return;
   }


Credit goes to the following pages that helped me out in the search for the solution:

http://www.respawned.co.uk/forums/archive/index.php/t-3216
http://randomfoo.net/sandbox/mozilla/getselection/
http://forums.ibf-french.com/lofiversion/index.php/t11415.html (thank heavens the code was in English Very Happy)

Syenna
Find all posts by SyennaView user's profileSend private message
Syenna
Private
Private


Joined: Aug 27, 2004
Posts: 47


PostPosted: Sun Oct 17, 2004 4:08 am Reply with quoteBack to top

Oops. That didn't cover the color and size tags. To get those, change the function bbfontstyle in that same file (around line 105, maybe 15-20 lines long) to read:

Code:
function bbfontstyle(bbopen, bbclose) {
   if ((clientVer >= 4) && is_ie && is_win) {
      theSelection = document.selection.createRange().text;
      if (!theSelection) {
         document.post.message.value += bbopen + bbclose;
         document.post.message.focus();
         return;
      }
      document.selection.createRange().text = bbopen + theSelection + bbclose;
      document.post.message.focus();
      return;
   } else {  // Firefox section follows
      posttextarea = document.post.message;
      selected=(posttextarea.value).substring(posttextarea.selectionStart,posttextarea.selectionEnd);
      str=bbopen + selected + bbclose;
      posttextarea.focus();
      start=posttextarea.selectionStart;
      end=posttextarea.textLength;
      endtext=posttextarea.value.substring(posttextarea.selectionEnd,end);
      starttext=posttextarea.value.substring(0,start);
      posttextarea.value=starttext + str + endtext;
      posttextarea.selectionStart=start;
      posttextarea.selectionEnd=start;
      return;
      }
   storeCaret(document.post.message);
}


Syenna
Find all posts by SyennaView user's profileSend private message
BrainSmashR
Support Mod
Support Mod


Joined: Jan 05, 2004
Posts: 1390

Location: Louisiana, USA

PostPosted: Sun Oct 17, 2004 4:14 am Reply with quoteBack to top

Not really the type of fix I had in mind, seeing as how Nuke now comes with 14 themes in the default setup.

Quote:
I've also only tested it on Firefox and IE.


What's your address, I have Netscape and Mozilla installed as well and would be happy to check for any visible errors with those browsers for you.

_________________
ImageImage
USE THE FORUM. If you contact me via messenger for support I will add you to my ignore list.
Find all posts by BrainSmashRView user's profileSend private messageVisit poster's websiteYahoo MessengerMSN MessengerICQ Number
Syenna
Private
Private


Joined: Aug 27, 2004
Posts: 47


PostPosted: Sun Oct 17, 2004 4:26 am Reply with quoteBack to top

Aye, that's a pain, but since the offending code is in the theme directory, I couldn't figure out how else to do it. It actually took me an hour of beating my head against a wall before I realized that I wasn't supposed to change the version of posting_body.tpl in modules/Forums/templates/subSilver.

PM sent with the site address; I'll set it to allow anonymous posting for the time being so you can test it without having to register.

Also, one last fix for placing the emoticons properly. Same file, change the function emoticon(text) (around line 95) to:

Code:

function emoticon(text) {
   text = ' ' + text + ' ';
   if (document.post.message.createTextRange && document.post.message.caretPos) {
      var caretPos = document.post.message.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
      document.post.message.focus();
   } else {
   posttextarea = document.post.message;
   selected=(posttextarea.value).substring(posttextarea.selectionStart,posttextarea.selectionEnd);
   str=' ' + text + ' ';
   posttextarea.focus();
   start=posttextarea.selectionStart;
   end=posttextarea.textLength;
   endtext=posttextarea.value.substring(posttextarea.selectionEnd,end);
   starttext=posttextarea.value.substring(0,start);
   posttextarea.value=starttext + str + endtext;
   posttextarea.selectionStart=start;
   posttextarea.selectionEnd=start;
   return;
   }
}


Syenna
Find all posts by SyennaView user's profileSend private message
2unreal
Nuke Cadet
Nuke Cadet


Joined: Oct 20, 2004
Posts: 9


PostPosted: Wed Oct 20, 2004 5:01 pm Reply with quoteBack to top

Quote:
Warning: Cannot modify header information - headers already sent by (output started at /home/psychede/public_html/forums/header.php:32) in /home/psychede/public_html/forums/includes/sessions.php on line 222

Warning: Cannot modify header information - headers already sent by (output started at /home/psychede/public_html/forums/header.php:32) in /home/psychede/public_html/forums/includes/sessions.php on line 223


Quote:

Warning: Cannot modify header information - headers already sent by (output started at /home/psychede/public_html/forums/header.php:32) in /home/psychede/public_html/forums/includes/page_header.php on line 492

Warning: Cannot modify header information - headers already sent by (output started at /home/psychede/public_html/forums/header.php:32) in /home/psychede/public_html/forums/includes/page_header.php on line 494

Warning: Cannot modify header information - headers already sent by (output started at /home/psychede/public_html/forums/header.php:32) in /home/psychede/public_html/forums/includes/page_header.php on line 495


Heres my errors.... right on the forums..... firefox suxors! Have no issues with IE... no errors... These are the errors I get straight after installing.... if i view the forums with firefox.... lol... so I havent even begun to tweak nuke yet.... lol.... well... just started today.... but these errors are only in firefox

If anyone knows how to fix this error that would be great... I have visited alot of nuke forums, and I havent seen these errors in anyone elses forum header....lol

anyways, if you want to check out the errors visit:

http://www.psychedelica.com.au/forums -the site still looks like crap, but hopefully I will get it to look more like my website..., is my first time ever attempting to change a theme in nuke... some reason i cant alter subsilver.css, boxes dont change colors to the ones I specify... lol
Find all posts by 2unrealView user's profileSend private message
Syenna
Private
Private


Joined: Aug 27, 2004
Posts: 47


PostPosted: Thu Oct 21, 2004 4:03 am Reply with quoteBack to top

This should solve your problem. Looks like another instance of PHP-Nuke having instructions to "do this if the user has IE," but without any kind of handling for users with other browsers.

http://www.nukecops.com/PHP-Nuke_cannot-add-header-information-in-forums.html

Sy
Find all posts by SyennaView user's profileSend private message
gknight
Nuke Cadet
Nuke Cadet


Joined: Mar 17, 2005
Posts: 2


PostPosted: Thu Mar 17, 2005 8:19 am Reply with quoteBack to top

Thanx for the fixes Syenna! I was also able to fix the BBcode placement bug by copying the bbfontstyle & bbstyle functions from the standalone version of phpBB.

Your smilie fix works, I put it on my site! But I have a bit of a problem with it. It only works for regular smilies, the additional ones (from the "View more Emoticons" popup) still don't work properly. Unfortunately I don't know much about PHP or Javascript, so I can't even try to figure it out...
Find all posts by gknightView user's profileSend private message
BreeeZe
Nuke Cadet
Nuke Cadet


Joined: Oct 16, 2004
Posts: 4


PostPosted: Thu May 12, 2005 8:13 am Reply with quoteBack to top

gknight wrote:
Thanx for the fixes Syenna! I was also able to fix the BBcode placement bug by copying the bbfontstyle & bbstyle functions from the standalone version of phpBB.

Your smilie fix works, I put it on my site! But I have a bit of a problem with it. It only works for regular smilies, the additional ones (from the "View more Emoticons" popup) still don't work properly. Unfortunately I don't know much about PHP or Javascript, so I can't even try to figure it out...


Bit of a late reply, but better late then never Wink

Open posting_smilies.tpl
and replace the javascript with:
Code:

<!--
function emoticon(text) {
   text = ' ' + text + ' ';
   if (opener.document.forms['post'].message.createTextRange && opener.document.forms['post'].message.caretPos) {
      var caretPos = opener.document.forms['post'].message.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
      opener.document.forms['post'].message.focus();
   } else {
   posttextarea = opener.document.forms['post'].message;
   selected=(posttextarea.value).substring(posttextarea.selectionStart,posttextarea.selectionEnd);
   str=' ' + text + ' ';
   posttextarea.focus();
   start=posttextarea.selectionStart;
   end=posttextarea.textLength;
   endtext=posttextarea.value.substring(posttextarea.selectionEnd,end);
   starttext=posttextarea.value.substring(0,start);
   posttextarea.value=starttext + str + endtext;
   posttextarea.selectionStart=start;
   posttextarea.selectionEnd=start;
   return;
   }
}
//-->

Works for me Smile
Find all posts by BreeeZeView user's profileSend private message
gknight
Nuke Cadet
Nuke Cadet


Joined: Mar 17, 2005
Posts: 2


PostPosted: Tue May 17, 2005 8:37 am Reply with quoteBack to top

@ BreeeZe - thanx for the tip! I'm gonna edit the file as you suggested.
Find all posts by gknightView user's profileSend private message
BreeeZe
Nuke Cadet
Nuke Cadet


Joined: Oct 16, 2004
Posts: 4


PostPosted: Sat May 21, 2005 2:48 pm Reply with quoteBack to top

gknight wrote:
@ BreeeZe - thanx for the tip! I'm gonna edit the file as you suggested.


Hope it fixes your problem Smile

I have a new question for everyone, when using the smilie popup window in firefox it remains the active window after you klick on a smilie, if you use IE, the main window gets back focus so you have to select the smilie window on the taskbar again if you want to add more.

Is there a way to keep focus in IE also ?
Find all posts by BreeeZeView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.662 Seconds - 101 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::