Web Messaging Professional 98 for WINS, version F.2
Original archive name: WMP98F2?.ZIP

Author:       Earl Borah          earl.borah@bbs.chemek.cc.or.us
Home Site:    Chemeketa Online    http://bbs.chemek.cc.or.us

WMP98 Home Page:     http://bbs.chemek.cc.or.us/public/ring/sysop.htm#wmp
WMP98 Listserve:     http://bbs.chemek.cc.or.us/public/ring/subscribe.htm




DHTML CODES

If you look at any of the template files (either from WMP98 or from MSI's
default templates), you'll see several places where there are words enclosed
in @ characters. This is similar to the way SSL (Server-Side Includes) work,
if you are familiar with that term. These are special DHTML codes, and they're
what make DHMTL in WINS actually work.

This document is intended to clarify the new codes used by WMP98, what they
do, and why they are critical. If you understand the purpose and use of the @
codes, you can safely modify the template files to change the look and even
the functionality of WMP98. An understanding of HTML in general and the use of
forms in particular will be very helpful in following the descriptions
included in this document.

First off, it's important to understand that any @ code will be replaced by
the program with text (or, possibly, with nothing at all), as long as it is
able to recognize the @ code. If it cannot recognize the @ code, it will
remain in the document unchanged. So you cannot make up your own @ codes and
enter them into the template -- they must be supported by the .wcx program
that uses the template.

Secondly, note that in many cases, capitalization and spacing *ARE* important.
You must not split a two-word @ code between lines (that is, no return
character is allowed between the portions of the @ code). You must not add
extra spaces, or change the spelling or capitalization of these codes.

Finally, note that WMP98 actually runs multiple times as a user enters a
message, spell checks their message, attaches a file, saves their message, and
sends out carbon copies of their message. During this process, each page the
user sees contains hidden information about their message, even before the
message has been saved to the system. This hidden information allows WMP98 to
avoid the use of temp files for saving data, which can cause a variety of
headaches for the system administrator. It also means that proper use of the @
codes is critical, and making the wrong change to a template file can keep
WMP98 from working.




CODES USED BY Web Messaging Professional 98
--- Many of these are already internal to WINS. New codes are marked with a **


@IF newmail@
  USED: Most any template
  - Anything appearing between this line and its corresponding @ELSE@ (or
    @ENDIF@ if there is no @ELSE@) tag will only be displayed if the user has
    new mail in their inbox. Anything between the @ELSE@ and the @ENDIF@ tag
    will only be displayed if there is no new mail in the user's inbox.
  SEE ALSO: @IF something@, below.

@IF something@
  USED: Most any template
  - This allows you to have conditionals, so a page may be displayed one way
    if the condition is true, and another way if it is false. The conditional,
    in this case "something", must be defined in the .wcx -- under some
    conditions, you can use expressions (like @IF something="YES"@) and expect
    them to work, but don't be surprised if they don't. An @IF something@ is
    always followed by an @ENDIF@, and there may be an @ELSE@ included in
    between. For more information on how If/Else/EndIf functions work, read
    any programming book.

@IF thread@   **
  USED: Message_read.htm
  - Anything appearing between this line and its corresponding @ELSE@ (or
    @ENDIF@ if there is no @ELSE@) tag will only be displayed if the user is
    in "thread mode" (that is, they have clicked on one of the "thread"
    buttons). Anything between the @ELSE@ and the @ENDIF@ tag will only be
    displayed if the user is NOT in thread mode. Note that in the default
    template, there are embedded IF/ELSE/ENDIF tags inside the thread
    conditions -- be careful editing this template, because you may need to
    make the same change in several places.
  SEE ALSO: @IF something@, above.

@MSG.something@
  USED: Carbon_OK.htm, Inbox.htm, Message_Attachment_OK.htm, Message_Read.htm,
        Message_OK.htm, Thread_Index.htm
  - This contains information from the header of the recently saved message.
    You'll notice that hidden fields have been filled with data from the
    message -- this is to make sure the Carbon Copy program works properly.
    When you send a carbon, the original recipient of the message is
    "remembered," and will be listed as part of every single message that is
    sent as a carbon copy (try it and you'll see what I mean -- there will be
    a comment at the top of the message, which will be identical regardless of
    how many copies you send out).

@SUB body@   **
  USED: Most any template
  - This contains the user's original message, as they typed it. In order to
    "hide" this text, it most cases any quotation marks will be converted to
    special HTML code, which the web browser will automatically convert back
    when it sends the message.

    This is used to keep a copy of the message body with all the other data,
    and avoid the use of temp files. Remember that until the user sees the web
    page saying their message was sent successfully, the message has NOT been
    saved in any manner. If they close their web browser partway through this
    process, they will lose their message entirely.

@SUB dispBody@   **
  USED: SpellCheck.htm, Spell_OK.htm
  - This is the body of the message as displayed to the user. If there are any
    misspelled words, this will include all the appropriate HTML codes the web
    browser will need to display the word choices, as well as extra hidden
    fields the spell checker will use to process the user's selections.

@SUB query.whatever@
  USED: Most any template
  - used in any template *EXCEPT* message_attachment_ok.htm. This will return
    the value of the variable "whatever" from the last web page. So if I'm on
    a page and there's a selection box, and I select an option named "EXAMPLE"
    with a value of "TESTING", and I submit the form, and the program opens a
    template with line that includes @SUB query.example@, then that @ code
    will be replaced with the word "TESTING"

    This is used to pass parameters from one form to another. Parameters
    passed this way include the TO field, SUBJECT field, PRIVATE flag, ATTACH
    field, CONFERENCE field, BACKTO field (which is never visibly displayed on
    a web page), REFERENCE field (also never visibly displayed, but critical
    for threaded messaging). The values that are not visibly displayed are
    still passed from one page to another as hidden form values, so they are
    available when WMP98 is ready to send the message.

@SUB questionable@   **
  USED: SpellCheck.htm
  - When spell checking a document, the total number of misspelled words is
    passed using this variable. It is vital that the hidden form item named
    "QUESTIONABLE" contains this value, or WMP98 may not make the user's
    changes properly.

@SUB srcBody@   **
  USED: SpellCheck.htm, Spell_OK.htm
  - Same as @SUB body@




MAKING CHANGES TO THE TEMPLATES

For the most part, you may be best off making only minor changes to the
templates, unless you are familiar with HTML itself and the use of FORM tags
and properties in particular. If you are familiar with HTML, however, you
could allow a user more (or less) control over what happens to their message.
For example, you could force every message to be spell checked, without giving
the user a chance to disable it. Or you could allow the user to change the
conference number on any page, right up to the last minute when they actually
send the message. The choices are quite varied -- and they're all yours to
make.





SPELL CHECKING OPTIONS

One of the places where you can play with the settings quite easily is with
the spell checker settings. You can allow the user's default preferences to
always be used, force your system preferences to always be used, or allow the
user to override the default for each individual message (and you can decide
if the default should be based on the user's preferences or your system
preferences). So there are several options we've covered already, and we
haven't really started! Here's how you'd make them happen:


1. User's default preference ignored. System default of "OFF" always used.
User cannot override the system default.

<INPUT TYPE=hidden NAME="spell" VALUE="OFF">


2. User's default preference ignored. System default of "ON" always used. User
cannot override the system default.

<INPUT TYPE=hidden NAME="spell" VALUE="ON">


3. User's default preferences always used. User cannot override their default
preferences. If the user has not set a default preference, spell check will be
turned ON.

<INPUT TYPE=hidden NAME="spell"
VALUE="@IF user.WMP98SpellCheckDefault="OFF"@OFF@ELSE@ON@ENDIF@">


4. User's default preference ignored. System default is "OFF". User can choose
to override the system default when they send their message.

<B>Spell Check: </B><INPUT TYPE=checkbox NAME="spell">


5. User's default preference ignored. System default is "ON". User can choose
to override the system default when they send their message.

<B>Spell Check: </B><INPUT TYPE=checkbox NAME="spell" CHECKED>


6. User's default preference honored. User can override their default
preference. If the user has not set a default preference, spell checking will
be turned OFF.

<INPUT TYPE=checkbox
NAME="spell"@IF user.WMP98SpellCheckDefault="ON"@ checked@ENDIF@>


7. User's default preference honored. User can override their default
preference. If the user has not set a default preference, spell checking will
be turned ON.

<INPUT TYPE=checkbox
NAME="spell"@IF user.WMP98SpellCheckDefault="OFF"@>@ELSE@ checked>@ENDIF@


Using some of these as guidelines, you could use Yes/No radio buttons instead
of a checkbox, or whatever strikes your fancy. Option number 7 is the one
included with the default template.




Web Messaging Professional 98
copyright 1998, Earl Borah. All rights reserved