{\rtf1\ansi\deff1{\fonttbl{\f1\fnil \fcharset0 \cpg1252 ;}{\f2\fnil \fcharset0 \cpg1252 Verdana;}{\f3\fnil \fcharset0 \cpg1252 Arial;}{\f4\fnil \fcharset0 \cpg1252 Courier New;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue0;\red255\green255\blue255;\red221\green0\blue0;\red0\green128\blue64;\red0\green0\blue255;}\plain \pard\tx0\f1\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf2\cb3\fi0\ri0\li0\ql\sb0\sl0 {\*\bkmkstart top}{\*\bkmkend top}\f2\b\fs32 Internet Services Script Commands\par \pard\f2\b\i0\ul0\strike0\fcqt0\nosupersub\fs24\cf1\cb3\fi0\ri0\li0\ql\sb180\sl0 Contents\par \f1\b0\fs20\sb0 {\field\fldedit{\*\fldinst {HYPERLINK "#styling"}}{\fldrslt\f2\cf6 Styling conventions}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#commands"}}{\fldrslt\f2\cf6 Commands}}\pard\f2\b\i0\ul0\strike0\fcqt0\nosupersub\fs24\cf1\cb3\fi0\ri0\li0\ql\sb0\sl0 \par \f1\b0\fs20\li400 {\field\fldedit{\*\fldinst {HYPERLINK "#config"}}{\fldrslt\f2\cf6 #config}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#echo"}}{\fldrslt\f2\cf6 #echo}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#ifelseelifendif"}}{\fldrslt\f2\cf6 #elif}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#ifelseelifendif"}}{\fldrslt\f2\cf6 #else}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#ifelseelifendif"}}{\fldrslt\f2\cf6 #endif}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#endwhile"}}{\fldrslt\f2\cf6 #endwhile}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#exec"}}{\fldrslt\f2\cf6 #exec}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#flastmod"}}{\fldrslt\f2\cf6 #flastmod}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#fsize"}}{\fldrslt\f2\cf6 #fsize}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#ifelseelifendif"}}{\fldrslt\f2\cf6 #if}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#include"}}{\fldrslt\f2\cf6 #include}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#printenv"}}{\fldrslt\f2\cf6 #printenv}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1\cf2 {\field\fldedit{\*\fldinst {HYPERLINK "#rem"}}{\fldrslt\f2\cf6 #rem}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf2\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#set"}}{\fldrslt\f2\cf6 #set}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf2\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \f1\cf1 {\field\fldedit{\*\fldinst {HYPERLINK "#endwhile"}}{\fldrslt\f2\cf6 #while}}\pard\f2\b\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li400\ql\sb0\sl0 \par \b0\cf2\li0\sb60 \par \cf1 Internet Services Script commands are based on the Apache XSSI commands, and are designed to give a measure of flow control, dynamic storage and mathematical calculation to template processing. Additionally, some of these commands can be use to read or set some configuration data for the IS HTTP module.\par \f1\sb180 {\*\bkmkstart styling}{\*\bkmkend styling}\f2\b\fs24 Styling conventions\b0\ul\fs20 \par \ul0\sb60 Templates produced by Centrinity use \cf4 red\cf1 for all Internet Services Script commands except #rem (See below.) to differentiate them from static code or other Internet Services Script constructs. Like all our other styling conventions, this is just for convenience as it greatly improves the readability of the templates. There is no need for other editors to follow this convention, though we recommend it as it greatly simplifies template debugging.\par All command and argument names are case sensitive.\par \f1\sb180 {\*\bkmkstart commands}{\*\bkmkend commands}\f2\b\fs24 Commands\f3\fs20 \par \f2\b0\sb60 The following is the list of Internet Services Script commands along with a brief description of their syntax and function:\f3\b \par \f1\b0\sb100 {\*\bkmkstart config}{\*\bkmkend config}\f2\b #config\b0 \par \sb60 This command is used to configure various aspects of IS' Script processing engine. There are 4 variants, each used to configure a different aspect of IS Script's functionality.\par \i Syntax\i0 \par \fi-240\li240 \bullet \tab \f4 \f1 {\*\bkmkstart configtimefmt}{\*\bkmkend configtimefmt}\f2 \par \sb0 \tab Used to configure the output of the Internet Services Script dates, which do not support inline formatting options. Examples are the #flastmod command and some of Internet Services Script's global constants (for example, DATE_LOCAL, DATE_GMT). \par \sb100 \tab \ul Note\ul0 \par \sb0 \tab Dates retrieved using X-FC tags all support inline formatting so they remain unaffected by this configuration option. The formatting options available for the \f4 TimeFormat\f2 are the augmented C strftime formats defined for tag date formats (see X-FC-FIELD DATE tag for a list of possible options in the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "Internet%20Services%20X-FC%20tags"}}{\fldrslt\f2\cf6 Internet Services Script X-FC Tags}}\pard\tx240\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi-240\ri0\li240\ql\sb0\sl0 document). \par \sb60 \tab The default date format is the Internet fixed width date format (without timezone): "%a, %d %b %Y %H:%M:%S" (ie: Mon, 01 Apr 2002 18:00:00).\par \bullet \tab \f4 \f2 \par \tab Used to configure additional characters to be escaped by the Internet Services Script '@escape()' function. The default set consists of quote ('), double-quote ("), carriage return (ASCII 13), line feed (ASCII 10), and backslash (\\) (see the @escape function in the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "IS%20Script%20Functions"}}{\fldrslt\f2\cf6 Internet Services Script Functions}}\pard\tx240\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi-240\ri0\li240\ql\sb60\sl0 document).\par \bullet \tab \f4 \f2 \par \tab Used to set a user defined error message to be inserted into the rendered HTML stream when an IS Script error occurs. \par \tab New error messages must be <= 255 characters in length.\par \sb100 \tab \ul Note\ul0 \par \sb0 \tab The default error message is "SSI Error", but if you are using a lot of Javascript or other scripting language in your template or server parsed files, you could define a less HTML-centric error message, or perhaps just turn off error messages entirely in your production templates.\par \sb60 \bullet \tab \f4 \f1 {\*\bkmkstart configsizefmt}{\*\bkmkend configsizefmt}\f2 \par \fi0\li0\sb0 This command is used to control the output format of the #fsize command. Currently, the only valid options are "bytes" and "scaled". "Bytes" outputs the current file's size in bytes. "Scaled" selects an appropriate scaling factor (ie K, M, G, T etc...) for the output. The default format is "Scaled".\par \f1\sb100 {\*\bkmkstart echo}{\*\bkmkend echo}\f2\b #echo\b0 \par \sb0 This command is used to insert a variable value or the result of a mathematical computation into the rendering stream.\par \i\sb60 Syntax\i0 \par \fi-240\li240 \bullet \tab \f4 \f2 \par \tab Inserts the value of VariableName into the rendering stream. Unlike most variable references, you don't need the $ prefix here.\par \bullet \tab \f4 \f2 \par \tab Calculates the result of \i Expression\i0 and inserts it into the rendering stream.\par \f1\fi0\li0\sb100 {\*\bkmkstart exec}{\*\bkmkend exec}\f2\b #exec\b0 \par \sb60 Executes the specified CGI. See \i FirstClass\i0 \i Internet Services Administrator's Guide\i0 for information on GGIs.\i \par Syntax\i0 \par \f4 \f2 \par \f1\sb100 {\*\bkmkstart flastmod}{\*\bkmkend flastmod}\f2\b #flastmod\b0 \par \sb60 Outputs the last modified date of a specified file.\par Outputted format can be controlled by using \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#configtimefmt"}}{\fldrslt\f2\cf6 }}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb60\sl0 .\par \ul Note\ul0 \par This command should not be used to access the size of the current context object or sub-object it contains. The X-FC tags \f4 \f2 and \f4 \f2 are more efficient for this purpose (see \f4 X-FC-ITEM \f2 and\f4 X-FC-LIST-ITEM\f2 in the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "Internet%20Services%20X-FC%20tags"}}{\fldrslt\f2\cf6 Internet Services Script X-FC Tags}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb60\sl0 document).\par \i Syntax\i0 \par \fi-240\li240 \bullet \tab \f4 \f2 \par \fi0\li0 This syntax is used to output the last modified date of a file located using an absolute path (ie, one relative to the site root)\par \fi-240\li240 \bullet \tab \f4 \f2 \par \fi0\li0\sb0 This syntax is used to output the last modified date of a file located using a relative path (ie, one relative to the current object)\par \f1\sb100 {\*\bkmkstart fsize}{\*\bkmkend fsize}\f2\b #fsize\b0 \par \sb60 Outputs the size of a specified file. \par The format of the output can be controlled by using the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "#configsizefmt"}}{\fldrslt\f4\cf6 }}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb60\sl0 command. \par \ul Note\ul0 \par This command should not be used to access the size of the current context object or sub-object it contains. The X-FC tags \f4 \f2 and \f4 \f2 are more efficient for this purpose (see \f4 X-FC-ITEM \f2 and\f4 X-FC-LIST-ITEM\f2 in the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "Internet%20Services%20X-FC%20tags"}}{\fldrslt\f2\cf6 Internet Services Script X-FC Tags}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb60\sl0 document).\par \i Syntax\i0 \par \fi-240\li240 \bullet \tab \par \fi0\li0\sb0 This syntax is used to output the size of a file located using an absolute path (ie, one relative to the site root)\par \fi-240\li240\sb60 \bullet \tab \par \fi0\li0\sb0 This syntax is used to output the size of a file located using a relative path (ie, one relative to the current object)\par \f1\sb100 {\*\bkmkstart ifelseelifendif}{\*\bkmkend ifelseelifendif}\f2\b #if\par \sb60 #else\par #elif\par #endif\par \b0 Provides basic branching functionality for your templates and server-parsed files. \par An Internet Services Script 'if' block consists of the \f4 #if\f2 statement (with an expression), followed by zero or more \f4 #elif\f2 statements (each with an expression), followed by zero or one \f4 #else\f2 statement followed by the \f4 #endif \f2 statement. \par Between any two consecutive stamens, you can have a data block of arbitrary complexity and length. Of the entire \f4 #if\f2 block, at most one of these data blocks is inserted into the rendering stream based on the conditions of the expressions. If the expression of the \f4 #if\f2 stamen evaluates to 'true', the block following it is the one inserted. Otherwise, Internet Services will consecutively check each \f4 #elif\f2 stamen expressions (if any), and if any of them are true, the next block will be inserted.\par If none of the expressions are true, and there is an \f4 #else\f2 statement, the block inserted will be the one between the \f4 #else\f2 and the #endif. If none of the expressions are true and there is no \f4 #else\f2 command, nothing will be inserted.\par For further details of what can be put in an expression and the rules Internet Services uses to determine the truth or fallacy of a given expression, see the section on Internet Services Script expressions, in the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "Internet%20Services%20X-FC%20tags"}}{\fldrslt\f2\cf6 Internet Services Script X-FC tags}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb60\sl0 document .\b \par \b0\i Syntax\i0 \par \f4 \par \i\sb0 \i0 \par (\par \i \i0 )*\par [\par \i \i0 ]\par \f2 \par \f1\sb100 {\*\bkmkstart include}{\*\bkmkend include}\f2\b #include\b0 \par \sb60 Inserts the contents of another file into the rendering stream. \par Some common uses of this are to include a highly volatile collection of data placed in a separate file so it can be easily updated, or to include sections of "common" code used in several files or templates\par Most modern template sets use included files for toolbars, which are common between many templates. \cf2 If the included file is server parsed, then it will inherit the context of the including file (for example, if you included a toolbar into a message template) that toolbar will appear in the message context for the use of X-FC tags. \par \cf1 This means, if you use X-FC tags that extract data about the current object the object used for the data will be the including file not the included one. For example, if the document template included a file called "title.inc" and title.inc used the \f4 \f2 tag, then when the page was rendered, Internet Services would replace that tag with the name of the current document (for example, the template's scope), not the name of the include ("title.inc"). This allows template designers to use include files as a form of macro.\par \i Syntax\i0 \par \fi-240\li240 \bullet \tab \f4 \f2 \par \fi0\li0\sb0 This syntax is used to insert a file located using an absolute path (ie, one relative to the site root)\par \fi-240\li240\sb60 \bullet \tab \f4 \f2 \par \fi0\li0 This syntax is used to insert a file located using a relative path (for example, one relative to the current object).\par \f1\sb100 {\*\bkmkstart printenv}{\*\bkmkend printenv}\f2\b #printenv\b0 \par \sb60 Provided solely for compatibility with Apache's XSSI command set. This command has no function in Internet Services Script.\par \i Syntax\i0 \par \f4 \f2 \par \f1\sb100 {\*\bkmkstart rem}{\*\bkmkend rem}\f2\b #rem\par \b0\sb60 Inserts a comment in your templates and server-parsed files.\par Comments are "compiled out" when this file is first loaded, and not sent to the browser. This allows you to insert comments of arbitrary length without incurring the performance penalty of sending them over the wire to the browser, allowing for templates that have much better internal documentation. Comments can be as long as desired, and can contain any sequence of characters except (obviously) "-->". \par \ul\sb100 Warning\ul0 \par \sb0 Never end a file with an unclosed comment, as this can render the whole file inoperative.\par \ul\sb100 Styling conventions for commented code\ul0 \par \sb60 In FirstClass web templates, we use \b\cf5 green\b0\cf1 for all comments (for example, Internet Services Script's , HTML's and JavaScript's // and /* */) to differentiate them from active code. As is the case with all our styling conventions, this is just for convenience as it greatly improves the readability of the templates. Although not necessary, we recommend you follow this convention, as it simplifies template debugging. \par \i Syntax\i0 \par \f4\sb0 \f2 \par \f1\sb100 {\*\bkmkstart set}{\*\bkmkend set}\f2\b #set\b0 \par \sb60 Creates a new Internet Services Script variable and/or stores a value in this variable for later retrieval. \par If the name you specify is for a variable already defined, the new value replaces the old one. The name of the variable cannot be the same as that of one of the pre-defined Internet Services global constants. The value stored can be either a static value or the result of a mathematical expression.\par \ul\sb100 Note\par \ul0\sb0 Do not include the '$' prefix for the variable name specified in the 'var' argument. If you do, the command will not function correctly.\par \i\sb60 Syntax\i0 \par \fi-240\li240 \bullet \tab \f4 \f2 \par \fi0\li0 Use this syntax to set the variable to a static value. Static values include constants (either numeric or string), X-FC tags, the values of other IS Script variables and IS Script global constants.\par \fi-240\li240 \bullet \tab \f4 \f2 \par \fi0\li0 Use this syntax to set the variable to the result of the mathematical expression in the expr arg. \par For information on what can be put in an expression and the rules Internet Services uses to determine the truth or fallacy of a given expression, see the section on Internet Services Script expressions, in the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "Internet%20Services%20X-FC%20tags"}}{\fldrslt\f2\cf6 Internet Services Script X-FC tags}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb60\sl0 document. \par \f1\sb100 {\*\bkmkstart endwhile}{\*\bkmkend endwhile}\f2\b #while\par \sb60 #endwhile\par \b0 Provides looping functionality for templates and server-parsed files. \par During the rendering process, the block of data between the \f4 #while\f2 and \f4 #endwhile\f2 is executed an arbitrary number of times as long as the expression argument for the \f4 #while\f2 command evaluates to true. \par For information on what can be put in an expression and the rules Internet Services uses to determine the truth or fallacy of a given expression, see the section on Internet Services Script expressions, in the \f1 {\field\fldedit{\*\fldinst {HYPERLINK "Internet%20Services%20X-FC%20tags"}}{\fldrslt\f2\cf6 Internet Services Script X-FC tags}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf1\cb3\fi0\ri0\li0\ql\sb60\sl0 document. \b \par \b0\i Syntax\par \f4\i0 \par \i\sb0 <>\i0 \par \f2 \par \f1\cf2\sb60 {\field\fldedit{\*\fldinst {HYPERLINK "#top"}}{\fldrslt\f2\cf6 Top}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf2\cb3\fi0\ri0\li0\ql\sb60\sl0 \par \f1\sb0 {\field\fldedit{\*\fldinst {HYPERLINK "IS%20Script%20Functions"}}{\fldrslt\f2\cf6 Internet Services Script Functions}}\pard\f2\b0\i0\ul0\strike0\fcqt0\nosupersub\fs20\cf2\cb3\fi0\ri0\li0\ql\sb0\sl0 \par }