|
From: Benjamin C. <bc...@us...> - 2001-10-08 04:53:49
|
Update of /cvsroot/phpbt/phpbt/docs/sgml
In directory usw-pr-cvs1:/tmp/cvs-serv29139/sgml
Modified Files:
dependencies.sgml primer.sgml
Log Message:
Tweak, tweak, tweak
Index: dependencies.sgml
===================================================================
RCS file: /cvsroot/phpbt/phpbt/docs/sgml/dependencies.sgml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dependencies.sgml 2001/10/08 03:59:51 1.4
+++ dependencies.sgml 2001/10/08 04:53:46 1.5
@@ -14,6 +14,8 @@
<title>Database Abstraction</title>
<para>Instead of using PHP's database functions directly, interactions are done via database objects, which extend PHPlib's <classname>DB_Sql</classname> class.</para>
<para>The global variable <varname>$q</varname> is available as an instance of the class <classname>dbclass</classname>. This class adds two functions to the <classname>DB_Sql</classname> class, <function>grab()</function> and <function>grab_field()</function>. If they are called with an argument, the argument is passed as a query to the database and the results are returned from that query. If no argument is passed, they return results from the previous call to <function>query()</function>. Here are some examples:</para>
+ <example>
+ <title>Using the database class</title>
<programlisting>
// Grab one field from one record in the database
$user_email = $q->grab_field("select email from ".TBL_AUTH_USER." where user_id = 1");
@@ -29,10 +31,13 @@
echo $row['email'].'<br>';
}
</programlisting>
+ </example>
</sect3>
<sect3>
<title>Templates</title>
<para>Instead of outputting HTML from the scripts, templates are used to separate the code from the HTML. The templates contain tokens that are replaced by the scripts with values. The general process for using templates is as follows:</para>
+ <example>
+ <title>Using the template class</title>
<programlisting>
// Set up the file to be used
$t->set_file('content', 'bugdisplay.html');
@@ -47,6 +52,7 @@
// Parse the template and print it out (inside a wrap template)
$t->pparse('main', array('content', 'wrap', 'main'));
</programlisting>
+ </example>
</sect3>
<sect3>
<title>Session and Authentication</title>
Index: primer.sgml
===================================================================
RCS file: /cvsroot/phpbt/phpbt/docs/sgml/primer.sgml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- primer.sgml 2001/10/08 01:59:15 1.3
+++ primer.sgml 2001/10/08 04:53:46 1.4
@@ -18,7 +18,7 @@
<screeninfo>Project selection</screeninfo>
<mediaobject>
<imageobject>
- <imagedata fileref="images/shots/user/enterbug-chooseproject.png" format="PNG" align="center">
+ <imagedata fileref="images/shots/user/enterbug-chooseproject.png" format="PNG" align="middle">
</imageobject>
<imageobject>
<imagedata fileref="images/shots/user/enterbug-chooseproject.jpg" format="JPG" align="center">
@@ -56,6 +56,7 @@
<para>Entering a bug report.</para>
</caption>
</mediaobject>
+ </screenshot>
<para>That's it! The bug has been entered, and it's ready to be reviewed and fixed by the developers.</para>
</sect2>
|