home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / srev13h.zip / REPSTRGS.DOC < prev    next >
Text File  |  1999-06-18  |  5KB  |  143 lines

  1. 12 June 1999.  The SRE-http replacement strings file.
  2.  
  3. I.      Introduction
  4. I.a     The replacement strings file 
  5. I.a.1     Specifying host specific replacements
  6. I.a.2     Note on multi-line replacements  
  7. I.a.3     Providing arguments to custom replacement strings 
  8. I.a.4     Notes  
  9.  
  10.                 ----------------------------------------
  11.  
  12. I. Introduction
  13.  
  14. SRE-https REPSTRGS.IN file is used to specify "replacement strings"
  15. for use with the <!-- REPLACE astring --> server side include.
  16.  
  17. Note that replacement strings can also be specified in the ATTRIBS.CFG
  18. file (see IN_FILES.DOC for the details).
  19.  
  20.                 ----------------------------------------
  21.  
  22.  
  23. I.a) Replacement strings file (REPSTRGS.IN)
  24.  
  25. The replacement strings file contains "custom" replacement strings that can be 
  26. used by the REPLACE keyphrase. 
  27.  
  28. Each line of this file (except lines beginning with a semi-colon, which are 
  29. treated as comments) has two fields: 
  30.  
  31.    @ A variable_name . The variable_name can be any length, but must have NO 
  32.      embedded spaces. 
  33.  
  34.    @ A REPLACEMENT STRING . The REPLACEMENT STRING is the string to be used when 
  35.      a REPLACE keyphrase with an argument of variable_name is found. 
  36.  
  37. Example: CONTACT CONTACT ME SOON!
  38.  
  39.   #  CONTACT is the variable_name
  40.  
  41.   #  CONTACT ME SOON! is the REPLACEMENT STRING
  42.  
  43.   #  When a <!-- REPLACE CONTACT -- > keyphrase is encountered, it is replaced 
  44.      by CONTACT ME SOON! 
  45.  
  46.  
  47. I.a.1) Note on host specfic requests:
  48.  
  49.   To specify a host specific replacement, append a .host_nickname,
  50.   For example, to specify :
  51.     a)  a value for CONTACT that will be used for non-host specific requests.
  52.            CONTACT Contact me soon
  53.         and use the ssi keyphrase
  54.     b) To specify a value for CONTACT that will be used for the LAKES host:
  55.           CONTACT.LAKES Contact me (the lake master) soon
  56.  
  57.     In both cases, you would use the SSI keyphrase: <!-- replace contact -->
  58.  
  59.     That is, do NOT include the .host_nickname in the SSI keyphrase.
  60.  
  61.     Note that when finding a replacement string,  "superceding hosts"
  62.     and "strict-superceding hosts" are  treated the same as "non-superceding 
  63.     hosts". In other words, a host-specific value is used if it has been 
  64.     defined; otherwise, a non-host specific value will be used.
  65.  
  66.  
  67. Technical note: If you were to use
  68.        <!-- replace contact.lakes -->
  69.      in a document in the default (the non-host specific) data directory,
  70.      then "Contact me (the lake master) soon" would be inserted.
  71.  
  72.  
  73. I.a.2)  Note on multi-line replacements  
  74.  
  75. The REPLACE keyphrase can be used for multi-line replacements (note that for 
  76. replacements of more then a few lines it is probably wiser to use the INCLUDE 
  77. keyphrase). 
  78.  
  79. To specify a multi line replacement, just enter multiple occurences of the same 
  80. label -- the values will be appended. 
  81.  
  82. Example: 
  83.  
  84.   #  MYADDRESS <address> My address is:</address>
  85.  
  86.   #  MYADDRESS 1800 M St NW <br>
  87.  
  88.   #  MYADDRESS Washington, DC <br>
  89.  
  90. would generate 3 lines (when a <!-- REPLACE MYADDRESS --> keyphrase is 
  91. encountered). 
  92.  
  93. I.a.3)  Providing arguments to custom replacement strings 
  94.  
  95. You can provide arguments in the REPLACE KEYPHRASE that will be substituted into 
  96. the replacement string. These arguments should follow the varname, with each 
  97. ⌠URL encoded⌡ word being an argument. For example: 
  98.  
  99.    @ <!-- REPLACE ODOM MYFILE1 -->
  100.     the argument is MYFILE1.
  101.  
  102.    @ <!-- REPLACE GREETING PARENTS SECOND+GRADE -->
  103.     the first argument is PARENTS and the second argument is SECOND+GRADE. Note 
  104.     that the + will be converted to a space before being substituted into the 
  105.     replacement string. 
  106.  
  107. To be substituted, the replacment string should contain %N substrings, where n 
  108. is an integer. For example: 
  109.  
  110.    @ ODOM <!-- INTERPRET FILE COUNTER.RXX FILE=%1 IMGTYPE=MBC -->
  111.     The first argument would replace the %1. Thus, <!-- REPLACE ODOM MYFILE1 --> 
  112.     would yield: 
  113.     <!-- INTERPRET FILE COUNTER.RXX FILE=MYFILE1 IMGTYPE=MBC -->
  114.     ... a fairly simple way of invoking a graphical hit counter. ⌠This ODOM 
  115.     replacement string is included in the default REPSTRGS.IN file⌡ 
  116.  
  117.    @ GREETINGS A BIG <FONT SIZE=+2> HELLO </FONT>TO %1 OF CHILDREN IN THE %2
  118.     Using <!-- REPLACE GREETING PARENTS SECOND+GRADE --> would yield:
  119.     A big hello to parents of children in the second grade.
  120.  
  121. Note that a maximum of 9 arguments should be supplied. All unused %n substrings 
  122. will be removed from the replacment string. Thus, if a %6 is included in the 
  123. replacment string, and only 5 arguments are provided, the %6 is removed. 
  124.  
  125. I.a.4)  Notes  
  126.  
  127.    @ The replacement strings file is REPSTRGS.IN. You can change this by 
  128.      modifying the REPSTRGS_FILE variable in INITFILT.80.
  129.      Note: you can also specify replacement strings in ATTRIBS.CFG. 
  130.  
  131.    @ These replacement stringss are only checked if the variable_name does not 
  132.      match one of  the "built in" variables. 
  133.  
  134.    @ Replacement strings can contain other SSI keyphrases (which will processed 
  135.      recursively). 
  136.  
  137.    @ Replacement strings can contain HTML elements.
  138.  
  139.    @ The variable_name can contain any printable character (including periods). 
  140.  
  141.  
  142.  
  143.