1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
<HTML><HEAD>
<TITLE>Tcl API Reference -- ns_adp_registertag</TITLE>
<LINK rel=Previous href="tapi-c16.htm">
<LINK rel=ToC href="toc.htm">
<LINK rel=Index href="master.htm">
<LINK rel=Next href="tapi-c18.htm">
</HEAD><BODY BGCOLOR="#ffffff"><A NAME="topofpage"></A>
<TABLE WIDTH=100%>
<TR>
<TD ALIGN=LEFT>
<A NAME="topofpage"></A> <IMG SRC="as-c-sm.gif">
</TD>
<TD ALIGN=RIGHT>
<A href="tapi-c16.htm"><IMG BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm> <IMG BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm> <IMG BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="tapi-c18.htm"> <IMG BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<A name="7983"> </A>
</TD>
</TR>
</TABLE>
<a name="221672">
</a><h3>ns_adp_registertag</h3>
<a name="225450">
</a><h4>Overview</h4>
<p><a name="225460">
</a>Register an ADP tag</p>
<a name="225452">
</a><h4>Syntax</h4>
<p><a name="225455">
</a><b>ns_adp_registertag</b> <i>tag</i> ?<i>endtag</i>? <i>adpstring</i></p>
<a name="225453">
</a><h4>Description</h4>
<p><a name="225468">
</a><b>ns_register_adptag</b> registers a procedure to be called when the specified beginning and ending tags are used in an ADP. The <i>tag</i> is the beginning tag to look for, and the <i>endtag</i> is the ending tag to look for. The <i>adpstring</i> is an ADP that will be called when AOLserver encounters the specified tags when processing an ADP.</p>
<p><a name="225469">
</a>There are two ways to use <b>ns_register_adptag</b>, with and without the <i>endtag</i> parameter:</p>
<ul><li>If the <i>endtag</i> parameter is specified, the string of characters between the beginning tag (<i>tag</i>) and the ending tag (<i>endtag</i>) is passed to the <i>adpstring</i>. The return value of the ADP will be sent to the browser in place of the string of text that was specified between the beginning and ending tags.<a name="225470">
</a>
<p></ul><p><a name="225473">
</a>The <code>string</code> is not parsed, which means that you cannot include ADP tags in the <code>string</code> unless you execute <b>ns_adp_parse</b> on the string inside the ADP that processes the registered ADP tag.</p>
<ul><li>If <i>endtag</i> is not specified, then no closing tag is required. The ADP will be called every time the specified <i>tag</i> is encountered.<a name="225474">
</a>
<p></ul><p><a name="225524">
</a><b>Note:</b> This function is best used in a .tcl file rather than an .adp file, because the parser will be confused by the <% ... %> syntax even though they are in braces.</p>
<a name="225458">
</a><h4>Example</h4>
<pre> <a name="225528"></a>ns_adp_registertag printdate {
<a name="225530"></a> The current date is:
<a name="225531"></a> <%
<a name="225532"></a> ns_adp_puts [ns_httptime [ns_time]]
<a name="225533"></a> %>
<a name="225534"></a>}
</pre><p>
<TABLE BORDER="2" CELLPADDING="1" width="100%">
<TR><TD COLSPAN=3><P ALIGN=Center>
<IMG SRC="bluebult.gif">
<A HREF="#topofpage">
<FONT SIZE=-1>Top of Page</FONT></A>
<IMG SRC="bluebult.gif">
</TD></TR>
<TR><TD COLSPAN=3><P ALIGN=Center>
<A href="tapi-c16.htm">
<IMG BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm>
<IMG BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm>
<IMG BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="tapi-c18.htm">
<IMG BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<BR align=center>
<FONT size=-1>Copyright © 1998-99 America Online,
Inc.</FONT>
</TD></TR></TABLE></BODY></HTML>
|