Roxen.git / server / modules / tags / sqltag.pike

version» Context lines:

Roxen.git/server/modules/tags/sqltag.pike:1:   /* -  * $Id: sqltag.pike,v 1.5 1997/08/31 02:49:27 peter Exp $ +  * $Id: sqltag.pike,v 1.6 1997/09/05 16:57:07 grubba Exp $    *    * A module for Roxen Challenger, which gives the tags    * <SQLQUERY> and <SQLOUTPUT>.    *    * Henrik Grubbström 1997-01-12    */    - constant cvs_version="$Id: sqltag.pike,v 1.5 1997/08/31 02:49:27 peter Exp $"; + constant cvs_version="$Id: sqltag.pike,v 1.6 1997/09/05 16:57:07 grubba Exp $";   constant thread_safe=1;   #include <module.h>      inherit "module";   inherit "roxenlib";      import Array;   import Sql;      /*    * Module interface functions    */      array register_module()   {    return( ({ MODULE_PARSER,    "SQL-module",    "This module gives the three tags &lt;SQLQUERY&gt;, " -  "&lt;SQLOUTPUT&gt; and &lt;SQLTABLE&gt;.", +  "&lt;SQLOUTPUT&gt; and &lt;SQLTABLE&gt;.<br>\n" +  "Usage:<ul>\n" +  "<table border=0>\n" +  "<tr><td valign=top><b>&lt;sqloutput&gt;</b></td>" +  "<td>Executes an SQL-query, and " +  "replaces #-quoted fieldnames with the results. # is " +  "quoted as ##. The content inbetween &lt;sqloutput&gt; and " +  "&lt;/sqloutput&gt; is repeated once for every row in the " +  "result.</td></tr>\n" +  "<tr><td valign=top><b>&lt;sqlquery&gt;</b></td>\n" +  "<td>Executes an SQL-query, but " +  "doesn't do anything with the result. This is usefull if " +  "you do queries like INSERT and CREATE.</td></tr>\n" +  "<tr><td valign=top><b>&lt;sqltable&gt;</td>" +  "<td>Executes an SQL-query, and makes " +  "an HTML-table from the result.</td></tr>\n" +  "</table></ul>\n" +  "The following attributes are used by the above tags:<ul>\n" +  "<table border=0>\n" +  "<tr><td valign=top><b>query</b></td>" +  "<td>The actual SQL-query. (<b>REQUIERED</b>)</td></tr>\n" +  "<tr><td valign=top><b>host<b></td>" +  "<td>The hostname of the machine the SQL-server runs on.<br>\n" +  "This argument can also be used to specify which SQL-server " +  "to use by specifying an \"SQL-URL\":<br><ul>\n" +  "<pre>[<i>sqlserver</i>://][[<i>user</i>][:<i>password</i>]@]" +  "[<i>host</i>[:<i>port</i>]]/<i>database</i></pre><br>\n" +  "</ul>Valid values for \"sqlserver\" depend on which " +  "sql-servers your pike has support for, but the following " +  "might exist: msql, mysql, odbc, oracle, postgres.</td></tr>\n" +  "<tr><td valign=top><b>database</b></td>" +  "<td>The name of the database to use.</td></tr>\n" +  "<tr><td valign=top><b>user</b></td>" +  "<td>The name of the user to access the database with.</td></tr>\n" +  "<tr><td valign=top><b>password</b></td>" +  "<td>The password to access the database.</td></tr>\n" +  "</table></ul><p>\n" +  "\n" +  "<b>NOTE</b>: Specifying passwords in the documents may prove " +  "to be a security hole if the module is not loaded for some " +  "reason.<br>\n",    0,    1 }) );   }      /*    * Tag handlers    */      string sqloutput_tag(string tag_name, mapping args, string contents,    object request_id, mapping defines)
Roxen.git/server/modules/tags/sqltag.pike:264:    return( ([ "sqloutput":sqloutput_tag ]) );   }      /*    * Setting the defaults    */      void create()   {    defvar("hostname", "localhost", "Default SQL-database host", -  TYPE_STRING, "Specifies the default host to use for SQL-queries"); +  TYPE_STRING, "Specifies the default host to use for SQL-queries.\n" +  "This argument can also be used to specify which SQL-server to " +  "use by specifying an \"SQL-URL\":<ul>\n" +  "<pre>[<i>sqlserver</i>://][[<i>user</i>][:<i>password</i>]@]" +  "[<i>host</i>[:<i>port</i>]]/<i>database</i></pre></ul><br>\n" +  "</ul>Valid values for \"sqlserver\" depend on which " +  "sql-servers your pike has support for, but the following " +  "might exist: msql, mysql, odbc, oracle, postgres.\n");    defvar("database", "", "Default SQL-database", -  TYPE_STRING, "Specifies the name of the default SQL-database"); +  TYPE_STRING, "Specifies the name of the default SQL-database.\n");    defvar("user", "", "Default username", -  TYPE_STRING, "Specifies the default username to use for access"); +  TYPE_STRING, "Specifies the default username to use for access.\n");    defvar("password", "", "Default password", -  TYPE_STRING, "Specifies the default password to use for access"); +  TYPE_STRING, "Specifies the default password to use for access.\n");   }      /*    * More interface functions    */      void start()   {   }