home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
srev13g.zip
/
REPSTRGS.DOC
< prev
next >
Wrap
Text File
|
1999-06-18
|
5KB
|
143 lines
12 June 1999. The SRE-http replacement strings file.
I. Introduction
I.a The replacement strings file
I.a.1 Specifying host specific replacements
I.a.2 Note on multi-line replacements
I.a.3 Providing arguments to custom replacement strings
I.a.4 Notes
----------------------------------------
I. Introduction
SRE-https REPSTRGS.IN file is used to specify "replacement strings"
for use with the <!-- REPLACE astring --> server side include.
Note that replacement strings can also be specified in the ATTRIBS.CFG
file (see IN_FILES.DOC for the details).
----------------------------------------
I.a) Replacement strings file (REPSTRGS.IN)
The replacement strings file contains "custom" replacement strings that can be
used by the REPLACE keyphrase.
Each line of this file (except lines beginning with a semi-colon, which are
treated as comments) has two fields:
@ A variable_name . The variable_name can be any length, but must have NO
embedded spaces.
@ A REPLACEMENT STRING . The REPLACEMENT STRING is the string to be used when
a REPLACE keyphrase with an argument of variable_name is found.
Example: CONTACT CONTACT ME SOON!
# CONTACT is the variable_name
# CONTACT ME SOON! is the REPLACEMENT STRING
# When a <!-- REPLACE CONTACT -- > keyphrase is encountered, it is replaced
by CONTACT ME SOON!
I.a.1) Note on host specfic requests:
To specify a host specific replacement, append a .host_nickname,
For example, to specify :
a) a value for CONTACT that will be used for non-host specific requests.
CONTACT Contact me soon
and use the ssi keyphrase
b) To specify a value for CONTACT that will be used for the LAKES host:
CONTACT.LAKES Contact me (the lake master) soon
In both cases, you would use the SSI keyphrase: <!-- replace contact -->
That is, do NOT include the .host_nickname in the SSI keyphrase.
Note that when finding a replacement string, "superceding hosts"
and "strict-superceding hosts" are treated the same as "non-superceding
hosts". In other words, a host-specific value is used if it has been
defined; otherwise, a non-host specific value will be used.
Technical note: If you were to use
<!-- replace contact.lakes -->
in a document in the default (the non-host specific) data directory,
then "Contact me (the lake master) soon" would be inserted.
I.a.2) Note on multi-line replacements
The REPLACE keyphrase can be used for multi-line replacements (note that for
replacements of more then a few lines it is probably wiser to use the INCLUDE
keyphrase).
To specify a multi line replacement, just enter multiple occurences of the same
label -- the values will be appended.
Example:
# MYADDRESS <address> My address is:</address>
# MYADDRESS 1800 M St NW <br>
# MYADDRESS Washington, DC <br>
would generate 3 lines (when a <!-- REPLACE MYADDRESS --> keyphrase is
encountered).
I.a.3) Providing arguments to custom replacement strings
You can provide arguments in the REPLACE KEYPHRASE that will be substituted into
the replacement string. These arguments should follow the varname, with each
⌠URL encoded⌡ word being an argument. For example:
@ <!-- REPLACE ODOM MYFILE1 -->
the argument is MYFILE1.
@ <!-- REPLACE GREETING PARENTS SECOND+GRADE -->
the first argument is PARENTS and the second argument is SECOND+GRADE. Note
that the + will be converted to a space before being substituted into the
replacement string.
To be substituted, the replacment string should contain %N substrings, where n
is an integer. For example:
@ ODOM <!-- INTERPRET FILE COUNTER.RXX FILE=%1 IMGTYPE=MBC -->
The first argument would replace the %1. Thus, <!-- REPLACE ODOM MYFILE1 -->
would yield:
<!-- INTERPRET FILE COUNTER.RXX FILE=MYFILE1 IMGTYPE=MBC -->
... a fairly simple way of invoking a graphical hit counter. ⌠This ODOM
replacement string is included in the default REPSTRGS.IN file⌡
@ GREETINGS A BIG <FONT SIZE=+2> HELLO </FONT>TO %1 OF CHILDREN IN THE %2
Using <!-- REPLACE GREETING PARENTS SECOND+GRADE --> would yield:
A big hello to parents of children in the second grade.
Note that a maximum of 9 arguments should be supplied. All unused %n substrings
will be removed from the replacment string. Thus, if a %6 is included in the
replacment string, and only 5 arguments are provided, the %6 is removed.
I.a.4) Notes
@ The replacement strings file is REPSTRGS.IN. You can change this by
modifying the REPSTRGS_FILE variable in INITFILT.80.
Note: you can also specify replacement strings in ATTRIBS.CFG.
@ These replacement stringss are only checked if the variable_name does not
match one of the "built in" variables.
@ Replacement strings can contain other SSI keyphrases (which will processed
recursively).
@ Replacement strings can contain HTML elements.
@ The variable_name can contain any printable character (including periods).