[REBOL] [ANN] 'display-messages
From: rchristiansen::pop::isdfa::sei-it::com at: 10-Jan-2001 19:07
The Standard Message Function Library took its greatest leap
forward today with the introduction of the following:
The 'display-messages function
USAGE:
DISPLAY-MESSAGES cgi-input
DESCRIPTION:
Using decoded CGI data containing messageID and
messageType variables, either display a single message
(messageID specified) or a directory of messages
(messageID = none) to the browser, including pre- and post-
markup code for each message value as specified and loaded
in a configuration file.
DISPLAY-MESSAGES is a function value.
ARGUMENTS:
cgi-input -- Decoded CGI data as submitted from an HTML
page, most likely sent using GET with messageType and
messageID sent as an appendage to the url request. (Type: object)
That's it. Now the entire script for displaying message(s) using this
XML standard would look like this:
#!/path/to/rebol -cs
REBOL []
cgi-input: retrieve-user-data
do load %standard-message-function-library.r
do load %configuration-file.r
stylesheet: read %stylesheet.html
print "Content-Type: text/html^/"
print html-page-header
print stylesheet
print pre-messages
display-messages cgi-input
print post-messages
The %configuration-file.r contains only string! values such as 'html-
page-header which contain HTML markup to surround the messages.
Each piece of the message (author, subject, date, content,
messageID, messageType) is marked up with HTML which assumes
the use of a simple cascading style sheet. Values such as 'pre-
author and 'post-author are defined in the configuration file to display
the needed HTML markup of any style before and after each
message element.
I have removed the use of straight HTML for the messaging system.
Browsers are mature enough now so that the system assumes the
use of CSS.
As always, any and all feedback is greatly appreciated.
Read more about the Standared Message Function Library and its
usage at
http://www.dangeroustechnology.com
The code itself is here...
http://www.dangeroustechnology.com/standard-message-function-library.txt
-Ryan