Forum Moderators: open

Message Too Old, No Replies

Suggesting two new style tags

a "broken pipe warning" and a "welcome" tag

         

andreasfriedrich

3:29 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As a lot of you will already know and as Jim summarized so nicely here [webmasterworld.com]:

Note: The WebmasterWorld posting software deletes spaces preceding the exclamation point "!" character. It also replaces a solid vertical pipe symbol with a broken vertical pipe "¦" symbol. Both of these changes will need to be undone in any code you copy from WebmasterWorld. Make sure to include a space preceding the "!" in mod_rewrite code, and always replace "¦" with a solid vertical pipe.

This is an excellent note that should be present in all threads about mod_rewrite. Sometimes I wrote a warning to this effect, sometimes I forgot to do so. When I did forget it, it turned out to be a problem for a lot of new users.

Perhaps Brett could make this note available as a style tag. Then all one would need to do is add [ bpn ] for broken pipe notice to one´s post.

Another useful tag would be [ wc ]name[ /wc ] which would expand to Welcome to WebmasterWorld [webmasterworld.com] name. That would be so much easier and one would not have to search for paynt´s welcome thread anymore ;)

Andreas

Nick_W

3:31 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Certainly like the [wc] idea, that would be great ;)

Nick

Brett_Tabke

3:51 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



>It also replaces a solid vertical pipe symbol with a broken vertical pipe "¦"

I have no idea what that is in reference too. What's a vertical line? What's the chr code? Or how do you make one from the kb?

The exclaimation point is intentional.

Dante_Maure

4:08 pm on Dec 2, 2002 (gmt 0)

10+ Year Member



The welcome tag suggestion is fabulous! :)

andreasfriedrich

4:24 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In no way was this meant to criticise the way the software works. It is well understood that the exclamation mark behaviour is intentional. It is great to enforce proper use of it. However, when you use the exclamation mark to negate a regular expression in RewriteRules or RewriteConds this will cause the code to be displayed wrong. Hence the note to users to manually add the space before the exclamation mark after they copied the code.

The broken pipe is ASCII 166. The solid vertical pipe symbol, that´s the one you need to syntactically separate alternatives in regular expressions is ASCII 124. On a German keyboard you get it by pressing Alt Gr + <.

perl -e '$_="Aaron"; print /aaron¦nick/i;'
If you copy this code and try to execute it this will print nothing, since it will look for the string aaron¦nick which isn´t there. What you really want is this:
perl -e '$_="Aaron";$pat=join(chr(124),'aaron','nick');print /$pat/io;'
Of course this could be simply written as
perl -e '$_="Aaron"; print /aaron¦nick/i;'
but then there is the problem again that there seems to be no way to express chr(124) using the forum software.

Hope this helps.

Andreas

Brett_Tabke

4:27 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
¦ Seems to work? ¦
¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦

perl -e '$_="Aaron";$pat=join(chr(124),'aaron¦nick');print /$pat/io;'

Macguru

4:33 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>That would be so much easier and one would not have to search for paynt´s welcome thread anymore

I have pasted the following code here control panel/System Preferences/Custom Code Insert Bottom? field : <p>[*url=http://www.webmasterworld.com/forum19/542.htm]Welcome to WebmasterWorld, [/url] </p> (without the "*")

This keeps paynt's welcome post handy.

If any miss any other button on top or at bottom of pages, we are allowed up to 1000 characters to customise at will.

jdMorgan

4:37 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Brett,

I can't tell you what the ASCII codes are, but this "¦" character was typed as a standard, keyboard-entered pipe symbol on my keyboard, and originally appeared in the edit window as a solid (unbroken) vertical pipe symbol. When I clicked Preview, it then appeared in modified form as a broken vertical pipe (what you see now) in both the preview screen at top and the edit box below. If the post is directly Submitted without Previewing, the change also occurs.

If a user cuts and pastes the text into a file, and then edits it, typing that same keyboard key to replace it will fix it. This is mostly a problem for posting code here; For example, it will blow up a PERL script to have the wrong character in there.

The space-exclamation-point problem makes it impossible to correctly quote a previously-posted .htaccess directive containing "..HOST} !^mydomain.." or similar, because it will strip the space and make the syntax illegal. I type them with two spaces now, so one remains in the original post. However, it's easy to forget to do that work-around. I would beg for the suspension of this space-eating rule inside bbcode

[code]
tags when the space precedes any printable (non-whitespace) character. Trimming multiple spaces preceding exclamation point down to one space in this case would be fine, but trimming to zero spaces causes the syntax problem.

Thanks!
Jim

andreasfriedrich

4:37 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



perl -e '$_="Aaron";$pat=join(chr(124),'aaron¦nick');print /$pat/io;'
won´t work since the single quote before aaron will end the code that perl executes.

perl -e '$_="Aaron";$pat=join(chr(124),"aaron¦nick");print /$pat/io;'
does work but will print nothing. It is the same as
perl -e '$_="Aaron";print /aaron¦nick/io;'
since there is nothing to join. We do not get the vertical bar character.

Only this will print 1 since only this code tells the regular expression engine to look for a string of either aaron or nick:

perl -e '$_="Aaron";$pat=join(chr(124),"aaron","nick");print /$pat/io;'

Andreas

andreasfriedrich

10:09 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is for all those that find the welcome and notice tags useful. Add the following code as Custom Code Insert Top/Bottom:

<script src="http://server/ww_js.js"></script> 
<a href="#" onclick="wc();">Welcome</a>
<a href="#" onclick="bpn();">BPN</a>

Your ww_js.js needs to look like this.

function wc() {
document.forms[0].post.value='[ url=http://www.webmasterworld.com/forum19/542.htm ]Welcome to WebmasterWorld[ /url ] '+document.forms[0].post.value;
return false;
}

function bpn() {
document.forms[0].post.value=document.forms[0].post.value+'Note: The WebmasterWorld posting software deletes spaces preceding the exclamation point "!" character. It also replaces a solid vertical pipe symbol with a broken vertical pipe "&" symbol. Both of these changes will need to be undone in any code you copy from WebmasterWorld. Make sure to include a space preceding the "!" in mod_rewrite code, and always replace "&" with a solid vertical pipe.';
return false;
}

The external JavaScript is just used to overcome the 500 character limitation of the Custom Code fields.

The welcome will be added to the top of the post. The broken pipe notice will be added at the bottom of the post.

You will need to remove the spaces around the [ url ] tag.

Andreas

mivox

10:50 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The Welcome tag is a great idea, but I'm also confused by your broken pipe problem. I'm seeing a solid vertical pipe in all your posts in this thread...

¦testing¦

The pipes on either side of the word "testing" were typed in as solid pipes...
<added>and after I clicked submit on the post, they appear as solid pipes in my post...</added>

Nick_W

10:52 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I get broken ones on your test Mivox...

Nick

mivox

10:58 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How strange... I tried copying and pasting it into a text editor, to see if it was a font thing, but they appeared unbroken in the editor window also!

jdMorgan

11:06 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Different OS'es? Browsers?

Mine were WinME and NN7 while reporting that problem.

Cool script Andreas!

Jim

Nick_W

11:07 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Opera 6 on Linux...

Nick

mivox

11:12 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Opera 5/Mac

andreasfriedrich

3:34 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Jim.

I used various browsers (IE6, Moz1.2, NS6, NS7, Op5, Op6, Lynx both under WindowsNT, Win98, Linux) and always get the brocken bar (ASCII 166 - Unicode 00A6 [unicode.org]) instead of the vertical bar (ASCII 124 - Unicode 007C [unicode.org]).

If you try to validate this page [validator.w3.org] the validator complains about the missing character encoding.

When Latin-1, which is the HTTP default character encoding, is choosen manually [validator.w3.org], the validator sees the brocken bar as well. Never mind the actual validation error. This is just because of my javascript code.

How do I know that this (the broken bar) is really what the validator sees? When you choose UTF-8 the server will turn the brocken bar into the named entity &brvbar; which is the broken vertical bar.

Brett, do you see only the normal not broken bar as well?

Brett and Mivox, what do you get when you copy perl -e 'print ord("¦")' to the command line and execute it?

Before posting I get 124, after posting this will show 166.

Andreas

Brett_Tabke

4:21 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Ya, it is a browser auto-detect character set issue. Depends on which font/char set your browser decides to use for textareas.

Nah, I'm not doing the unicode thing here at all. We've tried and it was nothing but trouble - there are no fixes for that in sight when you are dealing with no less than 14 major browsers and regular members from 55 countries that visit daily. It would take two months of solid work to even come close to getting it right. I'm not opening myself or the board up to those problems. I'll let the browsers figure it out.

jdMorgan

4:46 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm...

Would this problem go away if WebmasterWorld declared a character set in the server headers or on the pages themselves using http-equiv? From a view-page-source and server header check on this page, it appears that no character set is declared, so I'm guessing that all of our different browser and default charset selections may lead to the seemingly-random "works/doesn't work for me" results.

Some of the mystery has been revealed, at least! :)

Jim

Brett_Tabke

8:29 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That's what we tried for several days JD. It doesn't work in a form environment with so many different browsers. I heard about problems for weeks as a result. Just because you set a char set, is no indication that the user will have that charset. Even if they do, there is no garantee that they support it in forms. When you get a form submission back expecting it in that charset - your sol and have to guess what they meant. It's a mess. You have to not set a charset and let the browsers see the ascii and default to it. That's as far as I'm going with this at this time...

mivox

8:33 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So what about the automatic welcome [wc] tag idea? I thought that was a good one. :)

Woz

10:33 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it's great as well, except I am not sure about sending new members to the "wc" ...

Onya
Woz

Nick_W

10:35 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Woz -- Classic!
;););)

Nick

andreasfriedrich

10:39 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I thought that was called a bathroom?!

If you don´t like wc it could always be called [aaron] ;)

Andreas

[edited by: andreasfriedrich at 10:42 pm (utc) on Dec. 3, 2002]

digitalghost

10:42 pm on Dec 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Took this silly American a minute to recall "water closet" as a term for the loo...