Version 2.1
As you've seen, you can show and hide portions of your pages based on a wide range of variables within NetCloak. This gives you a great deal of flexibility and you can create fairly complex conditions in which each part of a page will be visible. There is, however, and additional variation available in every <SHOW> and <HIDE> command which allows you to conditionally show and hide in all cases except when the condition is true.
For example, assume you wanted to have a portion of your page visible during the normal business week, Monday through Friday. You could write...
<HIDE><SHOW_DAY MON TUE WED THU FRI>
This text is visible during the week only.
But there is another way to make this same statement. Instead of saying "show text on Monday, Tuesday, Wednesday, Thursday, and Friday" (as we did above), you could say "show text on all days except Saturday and Sunday". To do this, you would use...
<HIDE><SHOW_DAY# SAT SUN>
This text is visible during the week only.
To be honest, this isn't really much easier, at least in this example. But what if you wanted to show text based on <SHOW_DOMAIN> to all users except those at a certain address. You certainly wouldn't want to list every domain on the Internet, so <SHOW_DOMAIN# 192.1.2.3> could be very handy when you want to show a section of your page to everyone except "192.1.2.3".
Of course, you could, in many cases, also use the <HIDE> commands instead. For example, the "192.1.2.3" example could have been written as:
<SHOW><HIDE_DOMAIN 192.1.2.3>
When building more complicated conditionals, this is no longer an option. Remember that <SHOW> and <HIDE> are fundamentally different in that <SHOW> will never "hide" text, and <HIDE> will never cause text to be seen. So, if we wanted to have a portion of text visible only to "JOE" from domain "192.1.", we could not use...
<HIDE><SHOW_USERNAME JOE><SHOW_DOMAIN
192.1.>
This text would be visible to "JOE" and to users coming
from "192.1"!
In this case, as long as the user's name was Joe, it wouldn't matter what their domain was, because the <SHOW_DOMAIN 192.1.> command would never turn the "faucet" off. "Joe"s all over the Internet would have access to the text. Similarly, anyone at domain "192.1" would also see the text, no matter what their name.
In general, any time you have two conditions that both need to be met, you will encounter this problem. The "except" variation solves this. In this example, you could use the except variation like this...
<HIDE><SHOW_USERNAME JOE><HIDE_DOMAIN#
192.1.>
This is what we wanted! Only Joe can see this, and only if he's
at 192.1.
The first part of this is simple enough... Hide text, then let "Joe" see it again. The command <HIDE_DOMAIN# 192.1.> is really saying "OK, text is on, so it's Joe. Now hide the text unless he is in the '192.1' domain".
To combine the effect of two commands to hide the HTML on Saturday between 8:00 and 9:00, use the except variation on the second command:
<SHOW><HIDE_DAY SAT><SHOW_TIME# 08>
The HIDE_DAY command will hide the HTML all day on Saturday, but the SHOW_TIME# ("show_time except") command will cancel out the effect of the HIDE_DAY except between 8:00 and 9:00. This results in the HTML being hidden only on Saturday between 8:00 and 9:00.
Another common use for this technique is with username and password commands. These commands each work on the username or password, but not both. To show based on the username and password, use:
<HIDE><SHOW_USERNAME clarus><HIDE_PASSWORD# moof>
The SHOW_USERNAME will only show HTML following it if the username is "clarus", and the HIDE_PASSWORD# will hide it again except when the password is also "moof". This results in the HTML following the show/hide-except commands being shown only when the username and password are correct.
Copyright © 1996 Maxum Development Corporation
820 South Bartlett Road - Suite 104
Streamwood, IL 60107
http://www.maxum.com/