Added a bit of logging to the searches to get a better idea of what's
asked for, Daniel
diff --git a/doc/search.php b/doc/search.php
index d406998..7be0055 100644
--- a/doc/search.php
+++ b/doc/search.php
@@ -92,7 +92,7 @@
// We handle only the first argument so far
$query = ltrim ($query);
if (! $query) {
- echo "<h1 align='center'>Search the documentation on XMLSoft.org</h1>";
+ echo "<h1 align='center'>Search the X documentation on XMLSoft.org</h1>";
}
?>
<p> The search service indexes only the XML API at the moment. To use it
@@ -104,6 +104,23 @@
<input name=submit type=submit value="Search ...">
</form>
<?php
+ function logQueryWord($word) {
+ $result = mysql_query ("SELECT ID,Count FROM Queries WHERE Value='$word'");
+ if ($result) {
+ $i = mysql_num_rows($result);
+ if ($i == 0) {
+ mysql_free_result($result);
+ mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
+ } else {
+ $id = mysql_result($result, 0, 0);
+ $count = mysql_result($result, 0, 1);
+ $count ++;
+ mysql_query ("UPDATE Queries SET Count=$count WHERE ID=$id");
+ }
+ } else {
+ mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
+ }
+ }
function queryWord($word) {
$result = NULL;
$j = 0;
@@ -114,6 +131,7 @@
if ($j == 0)
mysql_free_result($result);
}
+ logQueryWord($word);
}
return array($result, $j);
}