+In addition, you can find a named element/node using the
mxmlFindElement() function:
- mxml_node_t *node = mxmlFindElement(tree, tree, "name", "attr",
+ mxml_node_t *node = mxmlFindElement(tree, tree, "name", "attr",
"value", MXML_DESCEND);
The name, attr, and value arguments can be
passed as NULL to act as wildcards, e.g.:
/* Find the first "a" element */
- node = mxmlFindElement(tree, tree, "a", NULL, NULL, MXML_DESCEND);
+ node = mxmlFindElement(tree, tree, "a", NULL, NULL, MXML_DESCEND);
/* Find the first "a" element with "href" attribute */
- node = mxmlFindElement(tree, tree, "a", "href", NULL, MXML_DESCEND);
+ node = mxmlFindElement(tree, tree, "a", "href", NULL, MXML_DESCEND);
/* Find the first "a" element with "href" to a URL */
- node = mxmlFindElement(tree, tree, "a", "href",
+ node = mxmlFindElement(tree, tree, "a", "href",
"http://www.easysw.com/~mike/mxml/", MXML_DESCEND);
/* Find the first element with a "src" attribute*/
- node = mxmlFindElement(tree, tree, NULL, "src", NULL, MXML_DESCEND);
+ node = mxmlFindElement(tree, tree, NULL, "src", NULL, MXML_DESCEND);
/* Find the first element with a "src" = "foo.jpg" */
- node = mxmlFindElement(tree, tree, NULL, "src", "foo.jpg", MXML_DESCEND);
+ node = mxmlFindElement(tree, tree, NULL, "src", "foo.jpg", MXML_DESCEND);
You can also iterate with the same function:
- mxml_node_t *node;
+ mxml_node_t *node;
- for (node = mxmlFindElement(tree, tree, "name", NULL, NULL, MXML_DESCEND);
+ for (node = mxmlFindElement(tree, tree, "name", NULL, NULL, MXML_DESCEND);
node != NULL;
- node = mxmlFindElement(node, tree, "name", NULL, NULL, MXML_DESCEND))
+ node = mxmlFindElement(node, tree, "name", NULL, NULL, MXML_DESCEND))
{
... do something ...
}
diff --git a/www/docfiles/LegalStuff.html b/www/docfiles/LegalStuff.html
index 6d9152d..2930e2e 100644
--- a/www/docfiles/LegalStuff.html
+++ b/www/docfiles/LegalStuff.html
@@ -30,8 +30,8 @@ PRE { font-family: monospace }
The Mini-XML library is copyright 2003-2004 by Michael Sweet.
This library is free software; you can redistribute it and/or modify
- it under the terms of the
-GNU Library General Public License as published by the Free Software
+ it under the terms of the GNU Library
+ General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any
later version.
This library is distributed in the hope that it will be useful, but
diff --git a/www/docfiles/LoadingandSavingXMLFiles.html b/www/docfiles/LoadingandSavingXMLFiles.html
index 306ce36..836228d 100644
--- a/www/docfiles/LoadingandSavingXMLFiles.html
+++ b/www/docfiles/LoadingandSavingXMLFiles.html
@@ -28,14 +28,14 @@ PRE { font-family: monospace }
Next
-You load an XML file using the
-mxmlLoadFile() function:
+You load an XML file using the
+mxmlLoadFile() function:
FILE *fp;
- mxml_node_t *tree;
+ mxml_node_t *tree;
fp = fopen("filename.xml", "r");
- tree = mxmlLoadFile(NULL, fp, MXML_NO_CALLBACK);
+ tree = mxmlLoadFile(NULL, fp, MXML_NO_CALLBACK);
fclose(fp);
The third argument specifies a callback function which returns the
@@ -45,14 +45,14 @@ MXML_TEXT. This function is called after the element and its
attributes have been read, so you can look at the element name,
attributes, and attribute values to determine the proper value type to
return. The default value type is MXML_TEXT if no callback is used.
-Similarly, you save an XML file using the
+Similarly, you save an XML file using the
mxmlSaveFile() function:
FILE *fp;
- mxml_node_t *tree;
+ mxml_node_t *tree;
fp = fopen("filename.xml", "w");
- mxmlSaveFile(tree, fp, MXML_NO_CALLBACK);
+ mxmlSaveFile(tree, fp, MXML_NO_CALLBACK);
fclose(fp);
Callback functions for saving are used to optionally insert
@@ -63,24 +63,24 @@ MXML_WS_AFTER_OPEN, MXML_WS_BEFORE_CLOSE, or
MXML_WS_AFTER_CLOSE. The callback function should return NULL
if no whitespace should be added and the string to insert (spaces,
tabs, carriage returns, and newlines) otherwise.
-The mxmlLoadString()
-, mxmlSaveAllocString()
-, and mxmlSaveString()
- functions load XML node trees from and save XML node trees to
- strings:
+The mxmlLoadString()
+,
+mxmlSaveAllocString(), and
+mxmlSaveString() functions load XML node trees from and
+ save XML node trees to strings:
char buffer[8192];
char *ptr;
- mxml_node_t *tree;
+ mxml_node_t *tree;
...
- tree = mxmlLoadString(NULL, buffer, MXML_NO_CALLBACK);
+ tree = mxmlLoadString(NULL, buffer, MXML_NO_CALLBACK);
...
- mxmlSaveString(tree, buffer, sizeof(buffer), MXML_NO_CALLBACK);
+ mxmlSaveString(tree, buffer, sizeof(buffer), MXML_NO_CALLBACK);
...
- ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);
+ ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);
Contents
diff --git a/www/docfiles/Nodes.html b/www/docfiles/Nodes.html
index c15f501..5b2a66c 100644
--- a/www/docfiles/Nodes.html
+++ b/www/docfiles/Nodes.html
@@ -29,16 +29,16 @@ PRE { font-family: monospace }
Every piece of information in an XML file (elements, text, numbers)
- is stored in memory in "nodes". Nodes are defined by the
-mxml_node_t structure. The
+ is stored in memory in "nodes". Nodes are defined by the
+mxml_node_t structure. The
type member defines the node type (element, integer,
opaque, real, or text) which determines which value you want to look at
- in the value union.
-New nodes can be created using the
-mxmlNewElement(),
-mxmlNewInteger(),
-mxmlNewOpaque(),
-mxmlNewReal(), and
+ in the value union.
+New nodes can be created using the
+mxmlNewElement(),
+mxmlNewInteger(),
+mxmlNewOpaque(),
+mxmlNewReal(), and
mxmlNewText() functions. Only elements can have child nodes,
and the top node must be an element, usually "?xml".
Each node has pointers for the node above (parent), below (
@@ -77,7 +77,7 @@ child), to the left (prev), and to the right (next
where "-" is a pointer to the next node and "|" is a pointer to the
first child node.
-Once you are done with the XML data, use the
+Once you are done with the XML data, use the
mxmlDelete() function to recursively free the memory that
is used for a particular node or the entire tree:
diff --git a/www/docfiles/OrganizationofThisDocument.html b/www/docfiles/OrganizationofThisDocument.html
index 71f0de9..41d864d 100644
--- a/www/docfiles/OrganizationofThisDocument.html
+++ b/www/docfiles/OrganizationofThisDocument.html
@@ -30,26 +30,25 @@ PRE { font-family: monospace }
This manual is organized into the following chapters and appendices:
-- Chapter 1, "
-Building, Installing, and Packaging Mini-XML", provides compilation,
- installation, and packaging instructions for Mini-XML.
-- Chapter 2, "Getting
- Started with Mini-XML", shows how to use the Mini-XML library in
- your programs.
-- Chapter 3, "
-More Mini-XML Programming Techniques", shows additional ways to use
- the Mini-XML library.
-- Chapter 4, "Using the
- mxmldoc Utility", describes how to use the mxmldoc(1)
- program to generate software documentation.
-- Appendix A, "
-GNU Library General Public License", provides the terms and
- conditions for using and distributing Mini-XML.
-- Appendix B, "Release Notes
-", lists the changes in each release of Mini-XML.
-- Appendix C, "Library
- Reference", contains a complete reference for Mini-XML, generated
- by mxmldoc.
+- Chapter 1, "Building, Installing, and
+ Packaging Mini-XML", provides compilation, installation, and
+ packaging instructions for Mini-XML.
+- Chapter 2, "Getting Started with
+ Mini-XML", shows how to use the Mini-XML library in your programs.
+- Chapter 3, "More Mini-XML
+ Programming Techniques", shows additional ways to use the Mini-XML
+ library.
+- Chapter 4, "Using the mxmldoc Utility
+", describes how to use the mxmldoc(1) program to generate
+ software documentation.
+- Appendix A, "GNU Library General
+ Public License", provides the terms and conditions for using and
+ distributing Mini-XML.
+- Appendix B, "Release Notes",
+ lists the changes in each release of Mini-XML.
+- Appendix C, "Library Reference",
+ contains a complete reference for Mini-XML, generated by mxmldoc
+.
diff --git a/www/documentation.php b/www/documentation.php
index f6904e8..4e51270 100644
--- a/www/documentation.php
+++ b/www/documentation.php
@@ -1,6 +1,6 @@
\n"
."\n");
- $num_comments = show_comments("documentation.php$path");
+ $num_comments = show_comments("documentation.php$path", "../");
if ($num_comments == 0)
print("No comments for this page.
\n");
@@ -195,6 +195,6 @@ formats on-line:
}
//
-// End of "$Id: documentation.php,v 1.2 2004/05/19 16:34:54 mike Exp $".
+// End of "$Id: documentation.php,v 1.3 2004/05/20 02:04:44 mike Exp $".
//
?>
diff --git a/www/phplib/auth.php b/www/phplib/auth.php
index 7bc5296..1623667 100644
--- a/www/phplib/auth.php
+++ b/www/phplib/auth.php
@@ -1,14 +1,15 @@
//
-// "$Id: auth.php,v 1.7 2004/05/19 21:17:47 mike Exp $"
+// "$Id: auth.php,v 1.8 2004/05/20 02:04:45 mike Exp $"
//
// Authentication functions for PHP pages...
//
// Contents:
//
-// auth_current() - Return the currently logged in user...
-// auth_login() - Log a user into the system.
-// auth_logout() - Logout of the current user by clearing the session ID.
+// auth_current() - Return the currently logged in user...
+// auth_login() - Log a user into the system.
+// auth_logout() - Logout of the current user by clearing the session ID.
+// auth_user_email() - Return the email address of a user...
//
//
@@ -154,6 +155,29 @@ auth_logout()
//
-// End of "$Id: auth.php,v 1.7 2004/05/19 21:17:47 mike Exp $".
+// 'auth_user_email()' - Return the email address of a user...
+//
+
+function // O - Email address
+auth_user_email($username) // I - Username
+{
+ $result = db_query("SELECT * FROM users WHERE "
+ ."name = '" . db_escape($username) . "'");
+ if (db_count($result) == 1)
+ {
+ $row = db_next($result);
+ $email = $row["email"];
+ }
+ else
+ $email = "";
+
+ db_free($result);
+
+ return ($email);
+}
+
+
+//
+// End of "$Id: auth.php,v 1.8 2004/05/20 02:04:45 mike Exp $".
//
?>
diff --git a/www/phplib/common.php b/www/phplib/common.php
index 2d0805f..b390193 100644
--- a/www/phplib/common.php
+++ b/www/phplib/common.php
@@ -1,6 +1,6 @@
//
-// "$Id: common.php,v 1.9 2004/05/19 21:17:47 mike Exp $"
+// "$Id: common.php,v 1.10 2004/05/20 02:04:45 mike Exp $"
//
// Common utility functions for PHP pages...
//
@@ -16,6 +16,7 @@
// sanitize_text() - Sanitize text.
// select_is_published() - Do a