gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r905 - GNUnet-docs/WWW/test


From: durner
Subject: [GNUnet-SVN] r905 - GNUnet-docs/WWW/test
Date: Mon, 13 Jun 2005 11:33:43 -0700 (PDT)

Author: durner
Date: 2005-06-13 11:33:20 -0700 (Mon, 13 Jun 2005)
New Revision: 905

Added:
   GNUnet-docs/WWW/test/example.php
   GNUnet-docs/WWW/test/example2.php
   GNUnet-docs/WWW/test/hacking_testcases.php3
   GNUnet-docs/WWW/test/i18nhtml.inc.php
   GNUnet-docs/WWW/test/i18nhtml_config.inc.php
   GNUnet-docs/WWW/test/start.php
   GNUnet-docs/WWW/test/update0_1_0.php
   GNUnet-docs/WWW/test/update0_2_0.php
Modified:
   GNUnet-docs/WWW/test/commitMassTranslation.php
   GNUnet-docs/WWW/test/commitTranslation.php
   GNUnet-docs/WWW/test/download.php3
   GNUnet-docs/WWW/test/editor.php
   GNUnet-docs/WWW/test/gnunet.css
   GNUnet-docs/WWW/test/hacking_index.inc
   GNUnet-docs/WWW/test/html_footer.php3
   GNUnet-docs/WWW/test/html_header.php3
   GNUnet-docs/WWW/test/index.php
   GNUnet-docs/WWW/test/mailinglist.php3
   GNUnet-docs/WWW/test/menu.php3
   GNUnet-docs/WWW/test/news_20050404.inc
   GNUnet-docs/WWW/test/news_20050506.inc
   GNUnet-docs/WWW/test/scripts.inc
   GNUnet-docs/WWW/test/status.php
   GNUnet-docs/WWW/test/translate.php
   GNUnet-docs/WWW/test/user_afs.php3
   GNUnet-docs/WWW/test/vote.php
Log:
copy real site to test site

Modified: GNUnet-docs/WWW/test/commitMassTranslation.php
===================================================================
--- GNUnet-docs/WWW/test/commitMassTranslation.php      2005-06-13 12:00:59 UTC 
(rev 904)
+++ GNUnet-docs/WWW/test/commitMassTranslation.php      2005-06-13 18:33:20 UTC 
(rev 905)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -17,38 +17,40 @@
      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
      Boston, MA 02111-1307, USA.
 */
-include("i18nhtml.inc");
+include("i18nhtml.inc.php");
 if (!$connection) {
-  echo "<html><head><title>WWW translation: commit</title></head><body>";
   echo "Database is down. Cannot edit translations.";
-  echo "</body></html>";
   die();
 }
 if ($xlang == "English") {
-  echo "<html><head><title>WWW translation: commit</title></head><body>";
   W("Translating to English currently not allowed.\n");
-  echo "</body></html>";
   die();
 }
-echo "<html><head><title>WWW translation: commit</title></head><body>";
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>";
+TITLE("WWW translation: commit");
+echo "</head><body>";
 W("Processing translations...");
 P();
 $done = 0;
-foreach($_GET as $dec=>$val) {
+foreach($_POST as $dec=>$val) {
   if ($val == "")
     continue;
   if ( ($dec == "xlang") || ($dec == "start") )
     continue;
-  $query = "SELECT c FROM pending WHERE lang=\"$xlang\"";
+  $val = fix($val);
+  $query = "SELECT c FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$xlang\"";
   $result = mysql_query($query, $connection);
   $num = 0;
-  if ($result) 
+  if ($result)
     $num = mysql_numrows($result);
   while ($num > 0) {
     $num--;
     $row = mysql_fetch_array($result);
-    if ($dec == bin2hex(md5(urldecode($row["c"])))) {
-      $enc = $row["c"];
+    $cx_plain = fix($row["c"]);
+    $cx_sql = mysql_real_escape_string($cx_plain);
+    if ($dec == bin2hex(md5($cx_plain))) {
+      $enc_sql = $cx_sql;
       break;
     }
   }
@@ -57,26 +59,36 @@
       $dec);
     P();
     continue;
-  }  
-  $query = "DELETE FROM pending WHERE lang=\"$lang\" AND c=\"$enc\"";
-  mysql_query($query, $connection); 
-  //$t = urlencode($val);
-  $t = urlencode($val);
-  //  $t = urlencode(htmlentities($val, ENT_QUOTES, $charset));
-  $query = "SELECT ranking FROM map WHERE name=\"$enc\" AND lang=\"$lang\" AND 
translation=\"$t\"";
+  }
+  $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" AND 
c=\"$enc_sql\"";
+  mysql_query($query, $connection);
+  $val_sql = mysql_real_escape_string(to_unicode($val));
+  $query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$enc_sql\"" .
+           " AND lang=\"$lang\" AND translation=\"$val_sql\"";
   $result = mysql_query($query, $connection);
   $num = 0;
-  if ($result) 
+  if ($result)
     $num = mysql_numrows($result);
   if ($num == 0) {
-    $query = "INSERT INTO map VALUES(\"$enc\", \"$lang\", \"$t\", 1, \"" . 
$_SERVER['REMOTE_ADDR'] . "\");";
-    mysql_query($query, $connection);
-    $done++;
-    W("Storing translation for &quot;%s&quot = &quot;%s&quot;.",
-      ARRAY(urldecode($enc),
-           urldecode($t)));
-    BR();  
-  }  
+    $txtCnt = count_chars(stripslashes($enc_sql), 1);
+    $tCnt = count_chars(stripslashes($val_sql), 1);
+    if ($txtCnt[ord('%')] != $tCnt[ord('%')]) {
+      W("Commit '%s->%s' failed.", stripslashes($enc_sql), 
stripslashes($val_sql));
+      W("The number of percent signs in source text and translation do not 
match.");
+      W("Note that you must preserve all %%s expressions unchanged.");
+      W("Also, a single displayed %% sign must be translated into two (%%%%) 
such signs.");
+      P();
+    } else {
+      $query = "INSERT INTO ".$i18nHTMLsqlPrefix."map VALUES(\"$enc_sql\", 
\"$lang\", " .
+               "\"$val_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
+      mysql_query($query, $connection);
+      $done++;
+      W("Storing translation for &quot;%s&quot = &quot;%s&quot;.",
+        ARRAY(stripslashes($enc_sql),
+             stripslashes($val_sql)));
+      BR();
+    }
+  }
 }
 P();
 echo "<a href=\"" . $i18nHTMLbase . "editor.php?xlang=" . $lang . "&start=" . 
($start - $done) . "\">";

Modified: GNUnet-docs/WWW/test/commitTranslation.php
===================================================================
--- GNUnet-docs/WWW/test/commitTranslation.php  2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/commitTranslation.php  2005-06-13 18:33:20 UTC (rev 
905)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -17,10 +17,7 @@
      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
      Boston, MA 02111-1307, USA.
 */
-include("i18nhtml.inc");
-$text = $_REQUEST['text'];
-$translation = $_REQUEST['translation'];
-$back = $_REQUEST['back'];
+include("i18nhtml.inc.php");
 if (!$connection) {
   echo "Database is down. Cannot edit translations.";
   die();
@@ -29,37 +26,56 @@
   W("Translating to English is not allowed.\n");
   die();
 }
+$text            = urldecode($_REQUEST['text']);
+$text_sql        = mysql_real_escape_string($text);
+$translation     = fix($_REQUEST['translation']);
+$translation_sql = mysql_real_escape_string(to_unicode($translation));
 
-// note: $text is already urlencoded (by submitting via form) and html 
compatible
-// ensure translation is stored in encoded form and html compatible
-// if (get_magic_quotes_gpc()) $translation = stripslashes($translation);
-
-// $t = urlencode(htmlentities($translation, ENT_QUOTES, $charset));
-$t = urlencode($translation);
+$back            = $_REQUEST['back'];
 // check for identical translation
-$query = "SELECT ranking FROM map WHERE name=\"$text\" AND lang=\"$lang\" AND 
translation=\"$t\"";
+$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
+         " AND lang=\"$lang\" AND translation=\"$translation_sql\"";
 $result = mysql_query($query, $connection);
 $num = 0;
-if ($result) {
+if ($result)
   $num = mysql_numrows($result);
-}
 if ($num > 0) {
-  echo "<html><body>";
-  W("Translation exists.");   
+  echo "<html><head>";
+  TITLE("Translation exists.");
+  echo "</head><body>";
+  W("Translation '%s' of sentence '%s' exists.",
+    ARRAY(fix($translation), $text));
   extlink($back, "Back...");
   generateFooter();
   echo "</body></html>";
 } else {
-  //  if (!get_magic_quotes_gpc()) $t = addslashes($t); // ensure escaped 
before adding to DB
-  $query = "INSERT INTO map VALUES(\"$text\", \"$lang\", \"$t\", 1, \"" . 
$_SERVER['REMOTE_ADDR'] . "\");";
-  $result = mysql_query($query, $connection);
-  if ($result) {
-    header("Location: " . $back); /* Redirect browser */
+  $txtCnt = count_chars($text, 1);
+  $tCnt   = count_chars($translation, 1);
+  if ($txtCnt[ord('%')] != $tCnt[ord('%')]) {
+      echo "<html><head>";
+      TITLE("Commit failed.");
+      echo "</head><body>";
+      W("Commit failed ('%s' and '%s').", ARRAY($text, $translation));
+      W("The number of percent signs in source text and translation does not 
match.");
+      W("Note that you must preserve all %%s expressions unchanged.");
+      W("Also, a single displayed %% sign must be translated into two (%%%%) 
such signs.");
+      echo "</body></html>";
   } else {
-    echo "<html><body>";
-    W("Commit ('%s') failed: ", $query);
-    echo mysql_error();
-    echo "</body></html>";
-  } 
+    $query = "INSERT INTO ".$i18nHTMLsqlPrefix."map VALUES(\"$text_sql\", 
\"$lang\", " .
+             "\"$translation_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
+    $result = mysql_query($query, $connection);
+    if ($result) {
+      $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
AND c=\"$text_sql\"";
+      mysql_query($query, $connection);
+      header("Location: " . $back); /* Redirect browser */
+    } else {
+      echo "<html><head>";
+      TITLE("Commit failed.");
+      echo "</head><body>";
+      W("Commit ('%s') failed: ", $query);
+      echo mysql_error();
+      echo "</body></html>";
+    }
+  }
 }
 ?>

Modified: GNUnet-docs/WWW/test/download.php3
===================================================================
--- GNUnet-docs/WWW/test/download.php3  2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/download.php3  2005-06-13 18:33:20 UTC (rev 905)
@@ -20,13 +20,13 @@
  <li><strong><?php W("Required:"); ?></strong>
      <a href="/libextractor/">libextractor (&gt;= 0.4.2)</a></li>
  <li><strong><?php W("Required:"); ?></strong>
-     <a href="http://www.sqlite.com/";>sqlite</a> (&gt;= 3.0.0) <?php W("or"); 
?>
+     <a href="http://www.sqlite.org/";>sqlite</a> (&gt;= 3.0.0) <?php W("or"); 
?>
      <a href="http://www.mysql.com/";>mysql</a> (&gt;= 4.1)</li>
  <li><strong><?php W("Recommended:"); ?></strong>
      <a href="http://www.gtk.org/";>gtk+ &gt;= 2.4</a></li>
  <li><strong><?php W("Optional:"); ?></strong>
      <a href="http://www.gnu.org/software/gettext/";>GNU gettext (&gt;= 
0.14.1)</a></li>
- <li><strong><?php W("for CVS:");?></strong>
+ <li><strong><?php W("for SVN:");?></strong>
      <a href="http://www.gnu.org/software/autoconf/";>autoconf (&gt;= 2.59)</a> 
<?php W("and"); ?>
      <a href="http://www.gnu.org/software/automake/";>automake (&gt;= 
1.7.6)</a> <?php W("and"); ?>
      <a href="http://www.gnu.org/software/libtool/";>libtool (&gt;= 1.5.6)</a> 
<?php W("and"); ?>
@@ -34,8 +34,8 @@
 <?php
 echo "</ul>\n";
 P();
-H2("CVS access");
-W("You can access the current CVS version of GNUnet using");
+H2("SVN access");
+W("You can access the current SVN version of GNUnet using");
 PRE("$ svn checkout https://gnunet.org/svn/GNUnet/";);
 W("For access to the GNUnet 0.6.x branch use:");
 PRE("$ svn checkout https://gnunet.org/svn/branches/GNUnet06/";);
@@ -62,9 +62,9 @@
   extlink_("https://gnunet.org/mantis/","Mantis";));
 P();
 
-W("RPM binaries for GNUnet and %s (x86 only) can be found %s.",
-  ARRAY(intlink_("/libextractor/index.php", "libextractor"),
-       extlink_("http://ovmj.org/~rpm/";, "here"))); 
+//W("RPM binaries for GNUnet and %s (x86 only) can be found %s.",
+//  ARRAY(intlink_("/libextractor/index.php", "libextractor"),
+//     extlink_("http://ovmj.org/~rpm/";, "here"))); 
 W("OS X binaries are %s.",
   extlink_("http://www.chem.jyu.fi/~eloranta/GNUnet.html";, "here"));
 W("The installer for Win32 Systems is %s (9 MB).",
@@ -74,18 +74,18 @@
 echo "<ul>\n";
 LIV(extlink_("download/GNUnet-0.6.6b.tar.bz2","GNUnet-0.6.6b.tar.bz2 (1291 
kb)"));
 LIV(extlink_("download/GNUnet-0.6.6b.tar.gz","GNUnet-0.6.6b.tar.gz (1737 
kb)"));
-LIV(extlink_("/libextractor/download/libextractor-0.4.2.tar.bz2",
-             "libextractor-0.4.2.tar.bz2 (6245 kb)"));
-LIV(extlink_("/libextractor/download/libextractor-0.4.2.tar.gz",
-             "libextractor-0.4.2.tar.gz (5868 kb)"));
+LIV(extlink_("/libextractor/download/libextractor-0.5.0.tar.bz2",
+             "libextractor-0.5.0.tar.bz2 (6303 kb)"));
+LIV(extlink_("/libextractor/download/libextractor-0.5.0.tar.gz",
+             "libextractor-0.5.0.tar.gz (5893 kb)"));
 echo "</ul>\n";
 P();
 W("The next major release will be %s and is expected %s.",
   ARRAY("0.7.0", "07-2005"));
-W("A pre-release (alpha-quality) is available:");
+W("A pre-release for 0.7.0 is available:");
 echo "<ul>\n";
-LIV(extlink_("download/GNUnet-0.7.0pre0.tar.bz2","GNUnet-0.7.0pre0.tar.bz2 
(1142 kb)"));
-LIV(extlink_("download/GNUnet-0.7.0pre0.tar.gz","GNUnet-0.7.0pre0.tar.gz (1626 
kb)"));
+LIV(extlink_("download/GNUnet-0.7.0pre2.tar.bz2", "GNUnet-0.7.0pre2.tar.bz2 
(1188 kb)"));
+LIV(extlink_("download/GNUnet-0.7.0pre2.tar.gz" , "GNUnet-0.7.0pre2.tar.gz 
(1693 kb)"));
 echo "</ul>\n";
 
 

Modified: GNUnet-docs/WWW/test/editor.php
===================================================================
--- GNUnet-docs/WWW/test/editor.php     2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/editor.php     2005-06-13 18:33:20 UTC (rev 905)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -17,11 +17,12 @@
      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
      Boston, MA 02111-1307, USA.
 */
-include("i18nhtml.inc");
+include("i18nhtml.inc.php");
 if (!$connection) {
   echo "Database is down. Cannot edit translations.";
   die();
 }
+DOCTYPE("HTML", "Transitional");
 echo "<html><head>";
 TITLE("WWW translation");
 echo "</head><body>";
@@ -29,8 +30,8 @@
 if ( (! $xlang) || ($xlang == "English") ) {
   echo "Cannot translate to English.";
   die();
- } 
-$start = $_REQUEST['start']; 
+ }
+$start = $_REQUEST['start'];
 H2("Mass translation to %s", $xlang);
 W("This page is for translating lots of sentences at once.");
 W("The sentences are ordered by the frequency that they are requested by 
users.");
@@ -41,7 +42,7 @@
 W("Do not copy the quotes (&quot;) from the original messages into the 
translations.");
 W("Leave translations that you cannot do blank.");
 
-$query = "SELECT c FROM pending WHERE lang=\"$lang\" ORDER BY count DESC";
+$query = "SELECT c FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
ORDER BY count DESC";
 $result = mysql_query($query, $connection);
 $num = 0;
 if ($result)
@@ -51,12 +52,12 @@
   $start = $end - $max;
   if ($start < 0)
     $start = 0;
- }
+}
 
 if ($num == 0) {
   P();
   W("No missing translations for the selected target language were found.");
- } else {
+} else {
   P();
   W("%s translations to %s have been requested and were not available.",
     ARRAY($num,
@@ -65,51 +66,45 @@
     ARRAY($start, $end));
   P();
 
-  echo "<form action=\"" . $i18nHTMLbase . "commitMassTranslation.php\">";
+  echo "<form method=\"POST\" action=\"" . $i18nHTMLbase . 
"commitMassTranslation.php\">";
   echo "<input type=hidden name=\"xlang\" value=\"$xlang\">";
   $endp = $end + 1;
   echo "<input type=hidden name=\"start\" value=\"$endp\">";
-  
+
   echo "<table border=5>";
-  echo "<tr><th>";
-  W("Original");
-  echo "</th><th>";
-  W("Translation");
-  echo "</th></tr>";
+  echo "<tr>";
+  TH("Original");
+  TH("Translation");
+  echo "</tr>";
   for ($ii=0;$ii<$end;$ii++) {
     $row = mysql_fetch_array($result);
     if ($ii < $start)
       continue;
-    $cx = $row["c"];
-    
-    $query = "SELECT ranking FROM map WHERE name=\"$cx\" AND lang=\"$lang\"";
+    $cx_plain = fix($row["c"]);
+    $cx_sql = mysql_real_escape_string($cx_plain);
+
+    $query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$cx_sql\" AND lang=\"$lang\"";
     $result2 = mysql_query($query, $connection);
     $num2 = 0;
-    if ($result2) 
+    if ($result2)
       $num2 = mysql_numrows($result2);
+    echo "<tr><td width=\"45%\">";
+    echo "&quot;$cx_plain&quot;";
+    echo "</td>\n\t<td width\"50\%\">";
     if ($num2 > 0) {
-      $query = "DELETE FROM pending WHERE lang=\"$lang\" AND c=\"$cx\"";
-      mysql_query($query, $connection); 
-      
-      echo "<tr><td width=\"45%\">";
-      $dec = urldecode($cx);
-      echo "&quot;" . $dec . "&quot;";
-      echo "</td>\n\t<td width\"50\%\">";
+      $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
AND c=\"$cx_sql\"";
+      mysql_query($query, $connection);
       W("Skipped (already translated).");
+    } else {
+      echo "<input size=\"40\" maxlength=\"65535\" name=\"" . 
bin2hex(md5($cx_plain)) . "\"></td></tr>\n";
     }
-    else {
-      echo "<tr><td width=\"45%\">";
-      $dec = urldecode($cx);
-      echo "&quot;" . $dec . "&quot;";
-      echo "</td>\n\t<td width\"50\%\">";
-      echo "<input size=\"40\" maxlength=\"65535\" name=\"" . 
bin2hex(md5($dec)) . "\"></td></tr>\n";
-    }
   }
   echo "</tr></table>";
-  echo "<input type=submit value=\"I hereby give all these translations into 
the Public Domain (commit)\">";
+  echo "<input type=submit value=\"" .
+       TRANSLATE_("I hereby give all these translations into the Public Domain 
(commit)") .
+       "\">";
   echo "</form>";
-  
- }
+}
 if ($end < $num) {
   P();
   echo "<a href=\"" . $i18nHTMLbase . "editor.php?xlang=" . $lang . "&start=" 
. ($end + 1) . "\">";
@@ -117,10 +112,10 @@
   echo "</a>";
   if ($t == 1)
     translateLink($b);
- } else {
+} else {
   W("Statistics about translation progress can be found %s.\n",
     intlink_($i18nHTMLbase . "status.php", "here"));
- }
+}
 P();
 H2("Remarks");
 H3("The percent sign");

Added: GNUnet-docs/WWW/test/example.php
===================================================================
--- GNUnet-docs/WWW/test/example.php    2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/example.php    2005-06-13 18:33:20 UTC (rev 905)
@@ -0,0 +1,29 @@
+<?php
+include("i18nhtml.inc.php");
+DOCTYPE("HTML");
+echo "<html><head>";
+TITLE("Example page");
+echo "</head><body>";
+H1("Some document title");
+W("A sentence to translate.");
+W("A sentence with an argument '%s' that cannot be translated.",
+  "foo");
+W("A sentence with two arguments '%s' and '%s' that cannot be translated.",
+  ARRAY("foo", "bar"));
+P(); // <p>
+W("A sentence with a %s that CAN be translated.",
+  extlink_("http://gnunet.org/i18nHTML/";, "link text"));
+W("A %s to another translatable page.",
+  intlink_("http://gnunet.org/i18nHTML/index";, "link")); // .php is added 
automatically!
+BR(); // <br>
+echo W_("A function returning the translation.");
+W("For more functions, look into i18nhtml.inc.");
+
+HR();
+W("And finally put the language selection bar somewhere:");
+generateLanguageBar(); // allow user to select other languages
+P();
+W("Oh, and put the footer to allow the editor mode:");
+generateFooter();
+echo "</body></html>";
+?>
\ No newline at end of file

Added: GNUnet-docs/WWW/test/example2.php
===================================================================
--- GNUnet-docs/WWW/test/example2.php   2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/example2.php   2005-06-13 18:33:20 UTC (rev 905)
@@ -0,0 +1,61 @@
+<?php
+include("i18nhtml.inc.php");  // do this 1st, add translation support
+DOCTYPE("HTML","Transitional");         // tell the user agent document format
+setTranslateLinkMarker("***");          // make translation marker more visible
+editOnlyUntranslatedText();             // restrict translations to 
untranslated strings
+
+echo "<html><head>";
+TITLE("Another Example Page");
+echo "</head><body>";
+
+HR();
+generateLanguageBar(); // allow user to select other languages
+HR();
+
+H1("header1");
+H2("header2");
+H3("header3");
+H2("header2 again");
+H3("yet another sub header");
+H3("and again, I think you get the idea");
+P(); // <p>
+W("A sentence to translate.");
+W("A sentence with an argument '%s' that cannot be translated.",
+  "foo");
+W("A sentence with two arguments '%s' and '%s' that cannot be translated.",
+  ARRAY("foo", "bar"));
+P(); // <p>
+echo "This is untranslated text\n";
+BR(); // <br>
+echo "another way to translate text, note each W chunk represents a ";
+echo "single translatable chunk so similar to above, but split into ";
+echo "multiple translation chunks.<br>";
+$myvar = W_("A sentence with an argument ");
+$myvar = $myvar . "foo" . W_(" that cannot be translated.");
+echo $myvar;
+P(); // <p>
+echo "here we have text that is translated, but not easily edited";
+echo "unless it happens to match some other text.<br>";
+$myvar = TRANSLATE_("A sentence with an argument ");
+$myvar = $myvar . "foo" . TRANSLATE_(" that is not translatable.");
+echo $myvar;
+W("A sentence with a %s that CAN be translated.",
+  extlink_("http://gnunet.org/i18nHTML/";, "link text"));
+W("A %s to another translatable page.",
+  intlink_("http://gnunet.org/i18nHTML/index";, "link")); // .php is added 
automatically!
+BR(); // <br>
+echo W_("A function returning the translation.");
+W("For more functions, look into i18nhtml.inc.");
+P();
+
+HR();
+$t = "Notice how we don't have to escape or quote(\") ampersands & nor other";
+$t = $t . "HTML entities.  <<<--->>> and such even work. This looks like 
&amp;\n";
+W($t);
+HR();
+
+P();
+W("Insert footer to allow entering translation edit mode:");
+generateFooter();
+echo "</body></html>";
+?>

Modified: GNUnet-docs/WWW/test/gnunet.css
===================================================================
--- GNUnet-docs/WWW/test/gnunet.css     2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/gnunet.css     2005-06-13 18:33:20 UTC (rev 905)
@@ -1,107 +1,23 @@
 /* global css for GNUnet */
 
-ul,ol,li,div,td,th,address,blockquote,b,i,dl,dd,dt,p,h1,h2,h3,h4,h5,font.subtitle,font.lang-menu
 {
-    font-family: "Bitstream Vera Sans", "Lucida Grande", "Trebuchet MS", 
"Lucida Sans Unicode", "Luxi Sans", "Helvetica", arial, helvetica, sans-serif;
-    font-size: 12px;
-}
-     
-dt{
-  font-weight:bold;
-  margin: 10px;
-}
+ul,ol,li,div,td,th,address,blockquote,b,i,dl,dd,dt
+     { font-family:"New Century Schoolbook","Courier","Utopia";color:#000000;}
 
-dd {
-       margin-bottom: 12pt;
-}
+dt{font-weight:bold;}
 
+
 /* font-family = Schriftart fuer Textelemente */
 /* Arial,sans-serif = Arial und serifenlose Schrift, Wert aenderbar */
 
-h1{
-  font-size:3.5ex;
-  text-align:center;
-}
+h1{font-size:4ex;text-align:center;}
+h2{font-size:3.5ex;background-color:#3355EE;color:#FFFFFF;width:99%;border-style:none;border-width:thin;padding:0cm;text-align:center;}
+h3{font-size:3ex;background-color:#0066CC;color:#FFFFFF;width:99%;border-style:none;border-width:thin;padding:0cm;text-align:left;}
+h4{font-size:2.5ex;background-color:#3399FF;color:#000000;width:99%;border-style:none;border-width:thin;padding:0cm;text-align:left;}
+h5{font-size:1.5ex;}
+body{width:95%;background-color:#FEFEFE;color:#000000;}
 
-h2{
-  font-size:3ex;
-  background-color:#0B8AD0;
-  color:#FFFFFF;
-  border-color:#0a6cce;
-  border-style:solid;
-  border-width:1px;
-  padding:0cm;
-  text-align:center;
-}
-
-h3{
-  font-size:2.25ex;
-  background-color:#0C95DE;
-  color:#FFFFFF;
-  border-color:#0B8AD0;
-  border-style:solid;
-  border-width:1px;
-  padding:0cm;
-  text-align:left;
-  padding-left:12pt;
-}
-
-h4{
-  font-size:2ex;
-  background-color:#3399FF;
-  color:#000000;
-  border-style:none;
-  border-width:1px;
-  padding:0cm;
-  text-align:left;
-  padding-left:12pt;
-}
-
-h5{
-  font-size:1.5ex;
-}
-
-p{
-  margin: 10px;
-}
-
-body{
-  background-color:#FEFEFE;
-  color:#000000;
-}
-
 pre{font-family:Courier New,Courier; color:#000000;}
 tt{font-family:Courier New,Courier; color:#0000D0;}
-
-font.title {
-  color:white;
-  font-family: "Arial","Helvetica";
-  font-size:32px;
-  font-weight: bold;
-}
-
-font.subtitle {
-  font-family: "Bitstream Vera Sans", "Lucida Grande", "Trebuchet MS", "Lucida 
Sans Unicode", "Luxi Sans", "Helvetica", arial, helvetica, sans-serif;
-  color:#d3d3d3;
-  font-size:11px;
-}
-
-td.menu {
-  background-color:#E4E4E4;
-  color:#FFFFFF;
-  font-size:11px;
-  font-weight: bold;
-  padding-top:2px;
-  padding-bottom:2px;
-  width: 12.5%;
-  text-align: center;
-}
-
-font.lang-menu {
-  background-color:#FFFFFF;
-  font-size:10px;
-}
-
-/*
 table{background-color:#CCCCFF;color:#0F0F0F;}
 table.plain{background-color:#FEFEFE;color:#000000;}
 tr{background-color:#00FF00;color:#0F0F0F;}
@@ -110,10 +26,8 @@
 tr.plain{background-color:#FEFEFE;color:#000000;}
 td.plain{background-color:#FEFEFE;color:#000000;}
 th.plain{background-color:#FEFEFE;color:#000000;}
-*/
 font.desc{background-color:#FFFFFF;color:#001100;}
 
-a:link{color:#0033FF; text-decoration:none;}
-a.menu:link{color:#FFFFFF; text-decoration:none;}
-a:visited{color:#333366; text-decoration:none;}
+a:link{color:#0033FF; text-decoration:underline;}
+a:visited{color:#333366; text-decoration:underline;}
 a:active{color:#EEEEEE; text-decoration:none;}

Modified: GNUnet-docs/WWW/test/hacking_index.inc
===================================================================
--- GNUnet-docs/WWW/test/hacking_index.inc      2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/hacking_index.inc      2005-06-13 18:33:20 UTC (rev 
905)
@@ -3,6 +3,7 @@
 <li><?php intlink("hacking_util.php3","src/util/"); ?></li>
 <li><?php intlink("hacking_server.php3","Understanding gnunetd"); ?></li>
 <li><?php intlink("hacking_application.php3","Writing applications"); ?></li>
+<li><?php intlink("hacking_testcases.php3","Writing testcases"); ?></li>
 <li><?php intlink("hacking_threading.php3","Threading"); ?></li>
 <li><?php intlink("hacking_rpc.php3","Using the RPC service"); ?></li>
 <li><?php intlink("hacking_win32_build.php3","Building on MS Windows"); ?></li>

Added: GNUnet-docs/WWW/test/hacking_testcases.php3
===================================================================
--- GNUnet-docs/WWW/test/hacking_testcases.php3 2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/hacking_testcases.php3 2005-06-13 18:33:20 UTC (rev 
905)
@@ -0,0 +1,88 @@
+<?php
+include("scripts.php3");
+$title = "GNUnet Documentation: writing testcases";
+$description="GNUnet Documentation - how to write testcases for GNUnet";
+include("html_header.php3");
+
+H2("Writing testcases for GNUnet");
+P();
+H3("Fundamentals");
+W("Ideally, any non-trivial GNUnet code should be covered by automated 
testcases.");
+W("Testcases should reside in the same place as the code that is being 
tested.");
+W("The name of source files implementing tests should contain the word 
<tt>test</tt>.");
+W("Typically it is desireable to have testcases both for low-level functions 
and high-level abstractions.");
+W("For example, while the cryptographic functions would be tested as part of 
the session key exchange, they should also still be tested independently.");
+P();
+H3("Integration with GNU autotools");
+P();
+W("Testcases in GNUnet should be integrated with the autotools build system.");
+W("This way, developers and anyone building binary packages will be able to 
run all testcases simply by running <tt>make check</tt>.");
+W("The final testcases shipped with the distribution should output at most 
some brief progress information and not display debug messages.");
+W("The success or failure of a testcase must be indicated by returning zero 
(success) or non-zero (failure) from the main method of the testcase.");
+W("The integration with the autotools is relatively straightforward and only 
requires modifications to the <tt>Makefile.am</tt> in the directory containing 
the testcase.");
+W("For three testcases testing the code in  <tt>foo.c</tt>, <tt>bar.c</tt> and 
<tt>etc.c</tt>, the <tt>Makefile.am</tt> would contain the following lines:");
+PRE("check_PROGRAMS = footest bartest etctest\n" .
+    "TESTS = $(check_PROGRAMS)\n" .
+    "footest_SOURCES = footest.c\n" .
+    "footest_LDADD = $(top_builddir)/src/util/libgnunetutil.la\n" .
+    "bartest_SOURCES = bartest.c\n" .
+    "bartest_LDADD = $(top_builddir)/src/util/libgnunetutil.la\n" .
+    "etctest_SOURCES = etctest.c\n" .
+    "etctest_LDADD = $(top_builddir)/src/util/libgnunetutil.la\n");
+W("Naturally, other libraries used by the testcase may be specified in the 
<tt>LDADD</tt> directive as necessary.");
+BR();
+W("Often testcases depend on additional input files, such as a configuration 
file.");
+W("These support files have to be listed using the <tt>EXTRA_DIST</tt> 
directive in order to ensure that they are included in the distribution.");
+W("Example:");
+PRE("EXTRA_DIST = check.conf\n");
+P();
+W("Executing <tt>make check</tt> will run all testcases in the current 
directory and all subdirectories.");
+W("Testcases can be compiled individually by running <tt>make footest</tt> and 
then invoked directly using <tt>./footest</tt>.");
+W("Note that due to the use of plugins in GNUnet, it is typically necessary to 
run <tt>make install</tt> before running any testcases.");
+W("Thus the canonical command <tt>make check install</tt> has to be changed to 
<tt>make install check</tt> for GNUnet.");
+P();
+H3("Common problems and solutions");
+W("When testing GNUnet, the splitting of the code into a daemon and clients 
often complicates testing.");
+W("The solution to this is to have the testcase <tt>fork</tt> a 
<tt>gnunetd</tt> process and then execute appropriate client actions (to test 
the client APIs or the core module or both).");
+W("If necessary, multiple daemons can be forked using different ports (!) to 
simulate a network.");
+W("However, most of the time only one <tt>gnunetd</tt> process is needed.");
+W("Also note that some client libraries were not written to communicate with 
multiple daemons over multiple trusted TCP connections at the same time, which 
may complicate testing in such situations.");
+W("Note that on exit, the testcase should shutdown <tt>gnunetd</tt> with a 
kill signal.");
+W("The following code illustrates spawning and killing a <tt>gnunetd</tt> 
process from a testcase:");
+PRE("pid_t daemon; \n" .
+    "daemon = fork();\n" .
+    "if (daemon == 0) {\n" .
+    "  if (0 != execlp(\"gnunetd\",\n" .
+    "                 \"gnunetd\",\n" .
+    "                 \"-d\",\n" .
+    "                 \"-c\", \"check.conf\",\n" .
+    "                 NULL)) {\n" .
+    "    fprintf(stderr,\n" .
+    "            _(\"'%s' failed: %s\\n\"),\n" .
+    "            \"execlp\",\n" .
+    "            STRERROR(errno));\n" .
+    "    return -1;\n" . 
+    "  }\n" .
+    "}\n" .
+    "/* put actual testcode here */\n" .
+    "if (daemon != -1) {\n" .
+    "  if (0 != kill(daemon, SIGTERM))\n" .
+    "    DIE_STRERROR(\"kill\");\n" .
+    "  if (daemon != waitpid(daemon, &status, 0))\n" .
+    "    DIE_STRERROR(\"waitpid\");\n" .
+    "  if (WEXITSTATUS(status) == 0)\n" .
+    "    return -1; /* server had error */\n" .
+    "}\n");
+P();
+W("An alternative way to just test modules (in particular if there is no 
client API to start with) is to implement a mock-version of the GNUnet core API 
and emulate a <tt>gnunetd</tt> environment for the module.");
+W("An example for this is the %s.",
+  extlink_("doxygen/html/fragmentationtest_8c.html", "fragmentationtest.c"));
+BR();
+W("Another uncommonly used alternative is to have the testcase process itself 
load the modules by initiating the full <tt>gnunetd</tt> startup sequence.");
+W("For that, the testcase must link against <tt>libgnunetcore</tt>.");
+W("For an example see %s.",
+  extlink_("doxygen/html/gnunet-transport-check_8c.html", 
"gnunet-transport-check.c"));
+
+include("html_footer.php3");
+?>
+

Modified: GNUnet-docs/WWW/test/html_footer.php3
===================================================================
--- GNUnet-docs/WWW/test/html_footer.php3       2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/html_footer.php3       2005-06-13 18:33:20 UTC (rev 
905)
@@ -1,11 +1,10 @@
 <?php
-
 if (! $no_footer) {
   P();
   if ($menu != "NO") {
     HR();
     $menu_once = 0;
-    menu_bar();
+    include("menu.php3");
   }
   HR();
   PRE("Copyright (C) 2002, 2003, 2004, 2005 Christian Grothoff.\n" .

Modified: GNUnet-docs/WWW/test/html_header.php3
===================================================================
--- GNUnet-docs/WWW/test/html_header.php3       2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/html_header.php3       2005-06-13 18:33:20 UTC (rev 
905)
@@ -3,9 +3,9 @@
 echo "<html><head>\n";
 $haveNBO = 0;
 if ($title) {
-  echo "<title>";
-  TRANSLATE($title);
-  echo "</title>";
+  TITLE($title);
+ } else {
+  TITLE("GNUnet");
  }
 if ($description) {
   echo "<meta name=\"description\" content=\"";
@@ -34,16 +34,10 @@
 <meta http-equiv="Content-Style-Type" content="text/css">
 <link rel=stylesheet type="text/css" href="gnunet.css">
 </head>
-<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
+<body>
 <?php
  if ($menu != "NO") {
    include("menu.php3");
-?>
-<font class="lang-menu">
-<?php
    generateLanguageBar();
-?>
-</font>
-<?php
  }
 ?>

Added: GNUnet-docs/WWW/test/i18nhtml.inc.php
===================================================================
--- GNUnet-docs/WWW/test/i18nhtml.inc.php       2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/i18nhtml.inc.php       2005-06-13 18:33:20 UTC (rev 
905)
@@ -0,0 +1,885 @@
+<?php
+/*
+     (C) 2003, 2004, 2005 Christian Grothoff and other contributing authors.
+
+     This code is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     The code is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with the code; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+  // This file defines the functions that will be used
+  // to build the webpage.  The set may not contain everything
+  // you might want, so feel free to define your own extensions.
+
+  // Use W("text") to output translations.
+  // $lang/xlang are used to specify the language
+  // $editor can be set to create a translation
+  // tag even if a translation is already available.
+  // there is currently no security.
+  //
+  // An "_" is used for functions that return the
+  // translated string instead of printing it directly.
+  // These functions are used for "%s" printing with W().
+  //
+  // Most of the code should be straight forward. Look
+  // at some of the example files that use it and compare with
+  // the generated pages.
+// obtain user db specific configuration parameters
+include("i18nhtml_config.inc.php");
+header("Content-type: text/html; charset=utf-8");
+
+// if (get_magic_quotes_gpc())
+//   die('PHP misconfigured.  Disable get_magic_quotes.');
+
+// establish default connection to database server
+$connection = @mysql_connect($i18nHTMLsqlServer,
+                            $i18nHTMLsqlUser,
+                            $i18nHTMLsqlPass);
+if (!$connection) {
+   die ('Failure connecting to ' . $i18nHTMLsqlServer . ' : ' . mysql_error());
+}
+
+// and select database on server that holds translations
+if ($connection) {
+  $db_selected = mysql_select_db($i18nHTMLsqlDB,
+                 $connection);
+  if (!$db_selected) {
+     die ('Error selecting db : ' . mysql_error());
+  }
+}
+
+// ensure the mapping and pending tables exist, creating them if not
+$query="CREATE TABLE IF NOT EXISTS ".$i18nHTMLsqlPrefix."map" .
+       " (name BLOB, lang TINYBLOB, translation BLOB, ranking INT, ip 
TINYTEXT, " .
+       "INDEX(name(10)), INDEX(lang(4)), INDEX(ranking), 
INDEX(translation(10)))";
+$result = mysql_query($query, $connection);
+if (($i18nHTMLdebug == 1) && (!$result)) {
+  die('Unable to validate map table.  Invalid query: ' . mysql_error());
+}
+
+$query="CREATE TABLE IF NOT EXISTS ".$i18nHTMLsqlPrefix."pending" .
+       " (c BLOB, lang TINYBLOB, count INT, " .
+       "INDEX(c(10)), INDEX(lang(4)), INDEX(count))";
+$result = mysql_query($query, $connection);
+if (($i18nHTMLdebug == 1) && (!$result)) {
+  die('Unable to validate pending table.  Invalid query: ' . mysql_error());
+}
+
+/* mapping of real-names to language codes */
+$languagecodes = array("English"=>"en",
+                      "German"=>"de",
+                      "French"=>"fr",
+                      "Portuguese"=>"pt",
+                      "Russian"=>"ru",
+                      "Romanian"=>"ro",
+                      "Spanish"=>"es",
+                      "Italian"=>"it",
+                      "Simplified chinese"=>"zh_CN",
+                      "Catalan"=>"ca",
+                      "Basque"=>"eu",
+                      "Arabic"=>"ar",
+                      "Bulgarian"=>"bg",
+                      "Czech"=>"cs",
+                      "Dutch"=>"nl",
+                      "Esperanto"=>"eo",
+                      "Hebrew"=>"he",
+                      "Japanese"=>"ja",
+                      "Norwegian"=>"no",
+                      "Polish"=>"po",
+                      "Ukrainian"=>"uk",
+                      "Danish"=>"da",
+                      "Swedish"=>"sv");
+
+/* try to automagically figure out user preferences */
+$hlang = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
+if ($hlang) {
+  $tok = strtok($hlang, ";");
+  while ($tok) {
+    foreach($languagecodes as $name=>$code) {
+      if (0 == strncmp($tok, $code, 2)) {
+        $lang = $name;
+        break 2;
+      }
+    }
+    $tok = strtok(";");
+  }
+}
+// If no language is specified, use english.
+if ( (! $lang) || ($lang=="") )
+  $lang = "English";
+$xlang = $_REQUEST['xlang'];
+if ($xlang)
+  $lang = $xlang;
+$lang = ucfirst(strtolower($lang));
+$lang = quote_smart($lang);
+$editor = $_REQUEST['editor'];
+$i18nHTMLhasTranslation = 0; // set by last call to translation_query()
+
+/**
+ * Replace certain HTML named special characters with their
+ * numeric codes (some browsers don't work with the symbolic names).
+ */
+$htmlin  = array("&rsquo;", "&gt;",  "&quot;", "&prime;", "&amp;", "\"",    
"'",      "`",       "&lsquo;");
+$htmlout = array("&#8217;", "&#62;", "&#34;" , "&#8242;", "&#38;", "&#34;", 
"&#8242;", "&#8217;", "&#8216;");
+function fix($a) {
+  global $htmlin;
+  global $htmlout;
+  return str_replace($htmlin, $htmlout, $a);
+}
+
+// Quote variable to make safe from
+// http://fr.php.net/manual/en/function.mysql-real-escape-string.php
+function quote_smart($value)
+{
+   // Stripslashes
+   if (get_magic_quotes_gpc()) {
+       $value = stripslashes($value);
+   }
+   $value = mysql_real_escape_string($value);
+   return $value;
+}
+
+// *************************************************
+// i18nHTML configuration API functions
+// *************************************************
+
+// change the marker text shown to indicate text
+// is translatable (link to translate page text)
+function setTranslateLinkMarker($marker) {
+  global $i18nHTMLmarker;
+
+  if ($marker == "")
+    $i18nHTMLmarker = "*";  // reset to default value
+  else
+    $i18nHTMLmarker = $marker;
+}
+
+// ***************************************************
+// i18nHTML _internal_ API functions (don't look here)
+// ***************************************************
+
+// returns a HTML string to link to enable one to translate the given
+// text ($a) when $editor has a nonzero value or
+// $i18nHTMLhasTranslation is 0; otherwise and empty string ("") is
+// returned.
+function translateLink_($a) {
+  global $lang;
+  global $HTTP_SERVER_VARS;
+  global $editor;
+  global $i18nHTMLhasTranslation;
+  global $i18nHTMLmarker;
+  global $i18nHTMLbase;
+
+  if ($hasTranslation == "")
+    $hasTranslation = $i18nHTMLhasTranslation;
+  if ( ($editor) || ($i18nHTMLhasTranslation == 0) ) {
+    $back = "http://"; . $HTTP_SERVER_VARS["HTTP_HOST"] . 
$HTTP_SERVER_VARS["REQUEST_URI"];
+    return "<a href=\"" . $i18nHTMLbase . "translate.php?xlang="
+      . $lang
+      . "&amp;text=" . urlencode(fix($a))
+      . "&amp;back=" . urlencode($back)
+      . "\" title=\""
+      .fix($a)
+      ."\">" . $i18nHTMLmarker . "</a>\n";
+  } else
+    return "";
+}
+
+// displays a link to the page to enable one to
+// translate the given text ($a)
+// see translateLink_
+function translateLink($a) {
+  echo translateLink_($a);
+}
+
+/**
+ * transcode unicode entities to/from HTML entities
+ *
+ * Also, this function transforms HTML entities into their equivalent Unicode 
entities.
+ * For example, w.bloggar posts pages using HTML entities.
+ * If you have to modify these pages using web forms, you would like to get 
UTF-8 instead.
+ *
+ * @link 
http://www.evolt.org/article/A_Simple_Character_Entity_Chart/17/21234/ A Simple 
Character Entity Chart
+ *
+ * @param string the string to be transcoded
+ * @param boolean TRUE to transcode to Unicode, FALSE to transcode to HTML
+ * @return a transcoded string
+ */
+function transcode($input, $to_unicode=TRUE) {
+  // initialize tables only once
+  static $html_entities, $unicode_entities;
+  if(!is_array($html_entities)) {
+
+
+    // numerical order
+    $codes = array(
+                  '&#160;'     => '&nbsp;',    // non-breaking space
+                  '&#161;'     => '&iexcl;',   // inverted exclamation mark
+                  '&#162;'     => '&cent;',    // cent sign
+                  '&#163;'     => '&pound;',   // pound sign
+                  '&#164;'     => '&curren;',  // currency sign
+                  '&#165;'     => '&yen;',             // yen sign
+                  '&#166;'     => '&brvbar;',  // broken bar
+                  '&#167;'     => '&sect;',    // section sign
+                  '&#168;'     => '&uml;',             // diaeresis
+                  '&#169;'     => '&copy;',    // copyright sign
+                  '&#170;'     => '&ordf;',    // feminine ordinal indicator
+                  '&#171;'     => '&laquo;',   // left-pointing double angle 
quotation mark
+                  '&#172;'     => '&not;',             // not sign
+                  '&#173;'     => '&shy;',             // soft hyphen
+                  '&#174;'     => '&reg;',             // registered sign
+                  '&#175;'     => '&macr;',    // macron
+                  '&#176;'     => '&deg;',             // degree sign
+                  '&#177;'     => '&plusmn;',  // plus-minus sign
+                  '&#178;'     => '&sup2;',    // superscript two
+                  '&#179;'     => '&sup3;',    // superscript three
+                  '&#180;'     => '&acute;',   // acute accent
+                  '&#181;'     => '&micro;',   // micro sign
+                  '&#182;'     => '&para;',    // pilcrow sign
+                  '&#183;'     => '&middot;',  // middle dot
+                  '&#184;'     => '&cedil;',   // cedilla
+                  '&#185;'     => '&sup1;',    // superscript one
+                  '&#186;'     => '&ordm;',    // masculine ordinal indicator
+                  '&#187;'     => '&raquo;',   // right-pointing double angle 
quotation mark
+                  '&#188;'     => '&frac14;',  // vulgar fraction one quarter
+                  '&#189;'     => '&frac12;',  // vulgar fraction one half
+                  '&#190;'     => '&frac34;',  // vulgar fraction three 
quarters
+                  '&#191;'     => '&iquest;',  // inverted question mark
+                  '&#192;'     => '&Agrave;',  // latin capital letter A with 
grave
+                  '&#193;'     => '&Aacute;',  // latin capital letter A with 
acute
+                  '&#194;'     => '&Acirc;',   // latin capital letter A with 
circumflex
+                  '&#195;'     => '&Atilde;',  // latin capital letter A with 
tilde
+                  '&#196;'     => '&Auml;',    // latin capital letter A with 
diaeresis
+                  '&#197;'     => '&Aring;',   // latin capital letter A with 
ring above
+                  '&#198;'     => '&AElig;',   // latin capital letter AE
+                  '&#199;'     => '&Ccedil;',  // latin capital letter C with 
cedilla
+                  '&#200;'     => '&Egrave;',  // latin capital letter E with 
grave
+                  '&#201;'     => '&Eacute;',  // latin capital letter E with 
acute
+                  '&#202;'     => '&Ecirc;',   // latin capital letter E with 
circumflex
+                  '&#203;'     => '&Euml;',    // latin capital letter E with 
diaeresis
+                  '&#204;'     => '&Igrave;',  // latin capital letter I with 
grave
+                  '&#205;'     => '&Iacute;',  // latin capital letter I with 
acute
+                  '&#206;'     => '&Icirc;',   // latin capital letter I with 
circumflex
+                  '&#207;'     => '&Iuml;',    // latin capital letter I with 
diaeresis
+                  '&#208;'     => '&ETH;',             // latin capital letter 
ETH
+                  '&#209;'     => '&Ntilde;',  // latin capital letter N with 
tilde
+                  '&#210;'     => '&Ograve;',  // latin capital letter O with 
grave
+                  '&#211;'     => '&Oacute;',  // latin capital letter O with 
acute
+                  '&#212;'     => '&Ocirc;',   // latin capital letter O with 
circumflex
+                  '&#213;'     => '&Otilde;',  // latin capital letter O with 
tilde
+                  '&#214;'     => '&Ouml;',    // latin capital letter O with 
diaeresis
+                  '&#215;'     => '&times;',   // multiplication sign
+                  '&#216;'     => '&Oslash;',  // latin capital letter O with 
stroke
+                  '&#217;'     => '&Ugrave;',  // latin capital letter U with 
grave
+                  '&#218;'     => '&Uacute;',  // latin capital letter U with 
acute
+                  '&#219;'     => '&Ucirc;',   // latin capital letter U with 
circumflex
+                  '&#220;'     => '&Uuml;',    // latin capital letter U with 
diaeresis
+                  '&#221;'     => '&Yacute;',  // latin capital letter Y with 
acute
+                  '&#222;'     => '&THORN;',   // latin capital letter THORN
+                  '&#223;'     => '&szlig;',   // latin small letter sharp s
+                  '&#224;'     => '&agrave;',  // latin small letter a with 
grave
+                  '&#225;'     => '&aacute;',  // latin small letter a with 
acute
+                  '&#226;'     => '&acirc;',   // latin small letter a with 
circumflex
+                  '&#227;'     => '&atilde;',  // latin small letter a with 
tilde
+                  '&#228;'     => '&auml;',    // latin small letter a with 
diaeresis
+                  '&#229;'     => '&aring;',   // latin small letter a with 
ring above
+                  '&#230;'     => '&aelig;',   // latin small letter ae
+                  '&#231;'     => '&ccedil;',  // latin small letter c with 
cedilla
+                  '&#232;'     => '&egrave;',  // latin small letter e with 
grave
+                  '&#233;'     => '&eacute;',  // latin small letter e with 
acute
+                  '&#234;'     => '&ecirc;',   // latin small letter e with 
circumflex
+                  '&#235;'     => '&euml;',    // latin small letter e with 
diaeresis
+                  '&#236;'     => '&igrave;',  // latin small letter i with 
grave
+                  '&#237;'     => '&iacute;',  // latin small letter i with 
acute
+                  '&#238;'     => '&icirc;',   // latin small letter i with 
circumflex
+                  '&#239;'     => '&iuml;',    // latin small letter i with 
diaeresis
+                  '&#240;'     => '&eth;',             // latin small letter 
eth
+                  '&#241;'     => '&ntilde;',  // latin small letter n with 
tilde
+                  '&#242;'     => '&ograve;',  // latin small letter o with 
grave
+                  '&#243;'     => '&oacute;',  // latin small letter o with 
acute
+                  '&#244;'     => '&ocirc;',   // latin small letter o with 
circumflex
+                  '&#245;'     => '&otilde;',  // latin small letter o with 
tilde
+                  '&#246;'     => '&ouml;',    // latin small letter o with 
diaeresis
+                  '&#247;'     => '&divide;',  // division sign
+                  '&#248;'     => '&oslash;',  // latin small letter o with 
stroke
+                  '&#249;'     => '&ugrave;',  // latin small letter u with 
grave
+                  '&#250;'     => '&uacute;',  // latin small letter u with 
acute
+                  '&#251;'     => '&ucirc;',   // latin small letter u with 
circumflex
+                  '&#252;'     => '&uuml;',    // latin small letter u with 
diaeresis
+                  '&#253;'     => '&yacute;',  // latin small letter y with 
acute
+                  '&#254;'     => '&thorn;',   // latin small letter thorn
+                  '&#255;'     => '&yuml;',    //
+                  '&#338;'     => '&OElig;',   // latin capital ligature OE
+                  '&#339;'     => '&oelig;',   // latin small ligature oe
+                  '&#352;'     => '&Scaron;',  // latin capital letter S with 
caron
+                  '&#353;'     => '&scaron;',  // latin small letter s with 
caron
+                  '&#376;'     => '&Yuml;',    // latin capital letter Y with 
diaeresis
+                  '&#402;'     => '&fnof;' ,   // latin small f with hook
+                  '&#710;'     => '&circ;',    // modifier letter circumflex 
accent
+                  '&#732;'     => '&tilde;',   // small tilde
+                  '&#913;'     => '&Alpha;',   // greek capital letter alpha
+                  '&#914;'     => '&Beta;',    // greek capital letter beta
+                  '&#915;'     => '&Gamma;',   // greek capital letter gamma
+                  '&#916;'     => '&Delta;',   // greek capital letter delta
+                  '&#917;'     => '&Epsilon;', // greek capital letter epsilon
+                  '&#918;'     => '&Zeta;',    // greek capital letter zeta
+                  '&#919;'     => '&Eta;',             // greek capital letter 
eta
+                  '&#920;'     => '&Theta;',   // greek capital letter theta
+                  '&#921;'     => '&Iota;',    // greek capital letter iota
+                  '&#922;'     => '&Kappa;',   // greek capital letter kappa
+                  '&#923;'     => '&Lambda;',  // greek capital letter lambda
+                  '&#924;'     => '&Mu;',              // greek capital letter 
mu
+                  '&#925;'     => '&Nu;',              // greek capital letter 
nu
+                  '&#926;'     => '&Xi;',              // greek capital letter 
xi
+                  '&#927;'     => '&Omicron;', // greek capital letter omicron
+                  '&#928;'     => '&Pi;',              // greek capital letter 
pi
+                  '&#929;'     => '&Rho;',             // greek capital letter 
rho
+                  '&#931;'     => '&Sigma;',   // greek capital letter sigma
+                  '&#932;'     => '&Tau;',             // greek capital letter 
tau
+                  '&#933;'     => '&Upsilon;', // greek capital letter upsilon
+                  '&#934;'     => '&Phi;',             // greek capital letter 
phi
+                  '&#935;'     => '&Chi;',             // greek capital letter 
chi
+                  '&#936;'     => '&Psi;',             // greek capital letter 
psi
+                  '&#937;'     => '&Omega;',   // greek capital letter omega
+                  '&#945;'     => '&alpha;',   // greek small letter alpha
+                  '&#946;'     => '&beta;',    // greek small letter beta
+                  '&#947;'     => '&gamma;',   // greek small letter gamma
+                  '&#948;'     => '&delta;',   // greek small letter delta
+                  '&#949;'     => '&epsilon;', // greek small letter epsilon
+                  '&#950;'     => '&zeta;',    // greek small letter zeta
+                  '&#951;'     => '&eta;',             // greek small letter 
eta
+                  '&#952;'     => '&theta;',   // greek small letter theta
+                  '&#953;'     => '&iota;',    // greek small letter iota
+                  '&#954;'     => '&kappa;',   // greek small letter kappa
+                  '&#955;'     => '&lambda;',  // greek small letter lambda
+                  '&#956;'     => '&mu;',              // greek small letter mu
+                  '&#957;'     => '&nu;',              // greek small letter nu
+                  '&#958;'     => '&xi;',              // greek small letter xi
+                  '&#959;'     => '&omicron;', // greek small letter omicron
+                  '&#960;'     => '&pi;',              // greek small letter pi
+                  '&#961;'     => '&rho;',             // greek small letter 
rho
+                  '&#962;'     => '&sigmaf;',  // greek small letter final 
sigma
+                  '&#963;'     => '&sigma;',   // greek small letter sigma
+                  '&#964;'     => '&tau;',             // greek small letter 
tau
+                  '&#965;'     => '&upsilon;', // greek small letter upsilon
+                  '&#966;'     => '&phi;',             // greek small letter 
phi
+                  '&#967;'     => '&chi;',             // greek small letter 
chi
+                  '&#968;'     => '&psi;',             // greek small letter 
psi
+                  '&#969;'     => '&omega;',   // greek small letter omega
+                  '&#977;'     => '&thetasym;',        // greek small letter 
theta symbol
+                  '&#978;'     => '&upsih;',   // greek upsilon with hook 
symbol
+                  '&#982;'     => '&piv;',             // greek pi symbol
+                  '&#8194;'    => '&ensp;',    // en space
+                  '&#8195;'    => '&emsp;',    // em space
+                  '&#8201;'    => '&thinsp;',  // thin space
+                  '&#8204;'    => '&zwnj;',    // zero width non-joiner
+                  '&#8205;'    => '&zwj;',             // zero width joiner
+                  '&#8206;'    => '&lrm;',             // left-to-right mark
+                  '&#8207;'    => '&rlm;',             // right-to-left mark
+                  '&#8211;'    => '&ndash;',   // en dash
+                  '&#8212;'    => '&mdash;',   // em dash
+                  '&#8216;'    => '&lsquo;',   // left single quotation mark
+                  '&#8217;'    => '&rsquo;',   // right single quotation mark
+                  '&#8218;'    => '&sbquo;',   // single low-9 quotation mark
+                  '&#8220;'    => '&ldquo;',   // left double quotation mark
+                  '&#8221;'    => '&rdquo;',   // right double quotation mark
+                  '&#8222;'    => '&bdquo;',   // double low-9 quotation mark
+                  '&#8224;'    => '&dagger;',  // dagger
+                  '&#8225;'    => '&Dagger;',  // double dagger
+                  '&#8226;'    => '&bull;',    // bullet
+                  '&#8230;'    => '&hellip;',  // horizontal ellipsis
+                  '&#8240;'    => '&permil;',  // per mille sign
+                  '&#8242;'    => '&prime;',   // primeminutes
+                  '&#8243;'    => '&Prime;',   // double prime
+                  '&#8249;'    => '&lsaquo;',  // single left-pointing angle 
quotation mark
+                  '&#8250;'    => '&rsaquo;',  // single right-pointing angle 
quotation mark
+                  '&#8254;'    => '&oline;',   // overline
+                  '&#8260;'    => '&frasl;',   // fraction slash
+                  '&#8364;'    => '&euro;',    // euro sign
+                  '&#8465;'    => '&image;',   // blackletter capital I
+                  '&#8472;'    => '&weierp;',  // script capital P
+                  '&#8476;'    => '&real;',    // blackletter capital R
+                  '&#8482;'    => '&trade;',   // trade mark sign
+                  '&#8501;'    => '&alefsym;', // alef symbol
+                  '&#8592;'    => '&larr;',    // leftwards arrow
+                  '&#8593;'    => '&uarr;',    // upwards arrow
+                  '&#8594;'    => '&rarr;',    // rightwards arrow
+                  '&#8595;'    => '&darr;',    // downwards arrow
+                  '&#8596;'    => '&harr;',    // left right arrow
+                  '&#8629;'    => '&crarr;',   // downwards arrow with corner 
leftwards
+                  '&#8656;'    => '&lArr;',    // leftwards double arrow
+                  '&#8657;'    => '&uArr;',    // upwards double arrow
+                  '&#8658;'    => '&rArr;',    // rightwards double arrow
+                  '&#8659;'    => '&dArr;',    // downwards double arrow
+                  '&#8660;'    => '&hArr;',    // left right double arrow
+                  '&#8704;'    => '&forall;',  // for all
+                  '&#8706;'    => '&part;',    // partial differential
+                  '&#8707;'    => '&exist;',   // there exists
+                  '&#8709;'    => '&empty;',   // empty set
+                  '&#8711;'    => '&nabla;',   // nabla
+                  '&#8712;'    => '&isin;',    // element of
+                  '&#8713;'    => '&notin;',   // not an element of
+                  '&#8715;'    => '&ni;',              // contains as member
+                  '&#8719;'    => '&prod;',    // n-ary product
+                  '&#8721;'    => '&sum;',             // n-ary sumation
+                  '&#8722;'    => '&minus;',   // minus sign
+                  '&#8727;'    => '&lowast;',  // asterisk operator
+                  '&#8730;'    => '&radic;',   // square root
+                  '&#8733;'    => '&prop;',    // proportional to
+                  '&#8734;'    => '&infin;',   // infinity
+                  '&#8736;'    => '&ang;',             // angle
+                  '&#8743;'    => '&and;',             // logical and
+                  '&#8744;'    => '&or;',              // logical or
+                  '&#8745;'    => '&cap;',             // intersection
+                  '&#8746;'    => '&cup;',             // union
+                  '&#8747;'    => '&int;',             // integral
+                  '&#8756;'    => '&there4;',  // therefore
+                  '&#8764;'    => '&sim;',             // tilde operator
+                  '&#8773;'    => '&cong;',    // approximately equal to
+                  '&#8776;'    => '&asymp;',   // almost equal to
+                  '&#8800;'    => '&ne;',              // not equal to
+                  '&#8801;'    => '&equiv;',   // identical to
+                  '&#8804;'    => '&le;',              // less-than or equal to
+                  '&#8805;'    => '&ge;',              // greater-than or 
equal to
+                  '&#8834;'    => '&sub;',             // subset of
+                  '&#8835;'    => '&sup;',             // superset of
+                  '&#8836;'    => '&nsub;',    // not a subset of
+                  '&#8838;'    => '&sube;',    // subset of or equal to
+                  '&#8839;'    => '&supe;',    // superset of or equal to
+                  '&#8853;'    => '&oplus;',   // circled plus
+                  '&#8855;'    => '&otimes;',  // circled times
+                  '&#8869;'    => '&perp;',    // up tack
+                  '&#8901;'    => '&sdot;',    // dot operator
+                  '&#8968;'    => '&lceil;',   // left ceiling
+                  '&#8969;'    => '&rceil;',   // right ceiling
+                  '&#8970;'    => '&lfloor;',  // left floor
+                  '&#8971;'    => '&rfloor;',  // right floor
+                  '&#9001;'    => '&lang;',    // left-pointing angle bracket
+                  '&#9002;'    => '&rang;',    // right-pointing angle bracket
+                  '&#9674;'    => '&loz;',             // lozenge
+                  '&#9824;'    => '&spades;',  // black spade suit
+                  '&#9827;'    => '&clubs;',   // black club suit
+                  '&#9829;'    => '&hearts;',  // black heart suit
+                  '&#9830;'    => '&diams;'    // black diam suit
+                  );
+
+    // split entities for use in str_replace()
+    foreach($codes as  $unicode_entity => $html_entity) {
+      $unicode_entities[] = $unicode_entity;
+      $html_entities[] = $html_entity;
+    }
+  }
+  // transcode HTML entities to Unicode
+  if($to_unicode)
+    return str_replace($html_entities, $unicode_entities, $input);
+
+  // transcode Unicode entities to HTML entities
+  else
+    return str_replace($unicode_entities, $html_entities, $input);
+}
+
+/**
+ * transcode multi-byte characters to HTML representations for Unicode
+ *
+ * This function is aiming to preserve Unicode characters through storage in a 
ISO-8859-1 compliant system.
+ *
+ * Every multi-byte UTF-8 character is transformed to its equivalent HTML 
numerical entity (eg, &amp;#4568;)
+ * that may be handled safely by PHP and by MySQL.
+ *
+ * Of course, this solution does not allow for full-text search in the 
database and therefore, is not a
+ * definitive solution to internationalization issues.
+ * It does enable, however, practical use of Unicode to build pages in foreign 
languages.
+ *
+ * Also, this function transforms HTML entities into their equivalent Unicode 
entities.
+ * For example, w.bloggar posts pages using HTML entities.
+ * If you have to modify these pages using web forms, you would like to get 
UTF-8 instead.
+ *
+ * @link 
http://www.evolt.org/article/A_Simple_Character_Entity_Chart/17/21234/ A Simple 
Character Entity Chart
+ *
+ * @param string the original UTF-8 string
+ * @return a string acceptable in an ISO-8859-1 storage system (ie., PHP4 + 
MySQl 3)
+ */
+function to_unicode($input) {
+  // transcode HTML entities to Unicode entities
+  $input = transcode($input);
+  // scan the whole string
+  $output = '';
+  $index = 0;
+  while($index < strlen($input)) {
+    // look at one char
+    $char = ord($input[$index]);
+    // one byte (0xxxxxxx)
+    if ($char < 0x80) {
+      // some chars may be undefined
+      $output .= chr($char);
+      $index += 1;
+      // two bytes (110xxxxx 10xxxxxx)
+    } else if ($char < 0xE0) {
+      // strip weird sequences (eg, C0 80 -> NUL)
+      if($value = (($char % 0x20) * 0x40) + (ord($input[$index + 1]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 2;
+      // three bytes (1110xxxx 10xxxxxx 10xxxxxx) example: euro sign = 
\xE2\x82\xAC -> &#8364;
+    } else if ($char < 0xF0) {
+      // strip weird sequences
+      if($value = (($char % 0x10) * 0x1000) + ((ord($input[$index + 1]) % 
0x40) * 0x40) + (ord($input[$index + 2]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 3;
+      // four bytes (11110xxx 10xxxxxx 10xxxxxx 10xxxxxx)
+    } else if($char < 0xF8) {
+      // strip weird sequences
+      if ($value = (($char % 0x08) * 0x40000) + ((ord($input[$index + 1]) % 
0x40) * 0x1000) + ((ord($input[$index + 2]) % 0x40) * 0x40)
+        + (ord($input[$index + 3]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 4;
+      // five bytes (111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx)
+    } else if($char < 0xFC) {
+      // strip weird sequences
+      if ($value = (($char % 0x04) * 0x1000000) + ((ord($input[$index + 1]) % 
0x40) * 0x40000) + ((ord($input[$index + 2]) % 0x40) * 0x1000)
+        + ((ord($input[$index + 3]) % 0x40) * 0x40) + (ord($input[$index + 4]) 
% 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 5;
+      // six bytes (1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx)
+    } else {
+      // strip weird sequences
+      if ($value = (($char % 0x02) * 0x40000000) + ((ord($input[$index + 1]) % 
0x40) * 0x1000000) + ((ord($input[$index + 2]) % 0x40) * 0x40000)
+        + ((ord($input[$index + 3]) % 0x40) * 0x1000) + ((ord($input[$index + 
4]) % 0x40) * 0x40) + (ord($input[$index + 4]) % 0x40))
+       $output .= '&#' . $value . ';';
+      $index += 6;
+    }
+  }
+  // return the translated string
+  return $output;
+}
+
+// returns either the translated string or the original string.
+// Assumes we are passed the original string as occurs in text; result
+// will be html tokenized by htmlentities() using UTF8.
+// $i18nHTMLhasTranslation is set to nonzero value if a translation is
+// available or failure connecting to database, otherwise it is set to
+// 0.
+function translation_query($a) {
+  global $connection;
+  global $lang;
+  global $i18nHTMLrecordMode;
+  global $i18nHTMLhasTranslation, $i18nHTMLsqlPrefix;
+
+  $i18nHTMLhasTranslation = 1; // assume translation until failure
+
+  if ($a == "")
+    return $a;
+  $a = fix($a);
+  $a_sql = quote_smart($a);
+  if (!$connection) {
+    // database not available, just print English
+    return $a;
+  }
+
+  if ("English" == $lang) {
+    // no need to translate english, that's the
+    // hard-wired source language!
+    if ($i18nHTMLrecordMode == 2) {
+      // if not already in pending table (and recordMode set to allow us)
+      // then insert this string into it
+      $query = "SELECT count FROM ".$i18nHTMLsqlPrefix."pending WHERE 
c=\"$a_sql\" AND lang=\"$lang\"";
+      $result = mysql_query($query, $connection);
+      $num = 0;
+      if ($result)
+        $num = mysql_num_rows($result);
+      if (0 == $num) {
+        $query = "INSERT INTO ".$i18nHTMLsqlPrefix."pending VALUES(\"$a_sql\", 
\"$lang\", 0)";
+        mysql_query($query, $connection);
+      }
+    }
+    return $a;
+  }
+  // attempt to get translations, ranked for best
+  $query = "SELECT translation FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$a_sql\" AND lang=\"$lang\" ORDER BY ranking DESC";
+  $result = mysql_query($query, $connection);
+  $num = 0;
+  if ($result)
+    $num = mysql_num_rows($result);
+  if (0 == $num) {  // didn't find a translation
+    if ($i18nHTMLrecordMode > 0) {
+      // either insert untranslated item into pending table or update
+      // referenced count; count is used to display more used strings
+      // during mass translation before less common ones.
+      $query = "SELECT count FROM ".$i18nHTMLsqlPrefix."pending WHERE 
c=\"$a_sql\" AND lang=\"$lang\"";
+      $result = mysql_query($query, $connection);
+      $num = 0;
+      if ($result)
+        $num = mysql_numrows($result);
+      $count = 0;
+      if ($num > 0) {
+        $row = mysql_fetch_array($result);
+        $count = $row["count"] + 1;
+        $query = "UPDATE ".$i18nHTMLsqlPrefix."pending SET count=$count WHERE 
c=\"$a_sql\" AND lang=\"$lang\"";
+      } else {
+        $query = "INSERT INTO ".$i18nHTMLsqlPrefix."pending VALUES(\"$a_sql\", 
\"$lang\", 1)";
+      }
+      mysql_query($query, $connection);
+
+    }
+    $i18nHTMLhasTranslation = 0; // no translation was found
+    return $a;              // just return English string
+  } else { // translation available
+
+    $row = mysql_fetch_array($result);
+    return $row["translation"];
+  }
+}
+
+// *************************************************
+// Fundamental i18nHTML API functions
+// *************************************************
+
+// translate the sentence $a and return the result.
+function TRANSLATE_($a,$args=null) {
+  if ($a == "")
+    return 0;
+  return vsprintf(translation_query($a), $args);
+}
+
+// translate the sentence $a and output just
+// the translated text (without link to translate.php)
+function TRANSLATE($a,$args=null) {
+  echo TRANSLATE_($a);
+}
+
+// translate the sentence $a adding a link
+// to enable editing translations and return the result.
+function W_($a,$args=null) {
+  if ($a == "")
+    return 0;
+  return TRANSLATE_($a,$args) . translateLink_($a);
+}
+
+// translate the sentence $a appending a link
+// to enable edit the translation and output the
+// result.
+function W($a, $args=NULL) {
+  if ($a != "")
+    echo W_($a, $args) . "\n";
+}
+
+// create internationalized, internal link to
+// $a.php with description $b
+function intlink_($a, $b) {
+  global $lang;
+
+  $ret = "<a href=\"" . $a . "?xlang=" . $lang . "\">" . TRANSLATE_($b) . 
"</a>";
+  $ret = $ret . translateLink_($b);
+  return $ret;
+}
+
+// create internationalized, internal link to
+// $a.php with description $b
+function intlink($a, $b) {
+  echo intlink_($a, $b);
+}
+
+// create internationalized, external link to
+// $a with description $b
+function extlink_($a, $b) {
+  $ret = "<a href=\"" . $a . "\">" . TRANSLATE_($b) . "</a>" . 
translateLink_($b);
+  return $ret;
+}
+
+// create internationalized, external link to
+// $a with description $b
+function extlink($a, $b) {
+  echo extlink_($a, $b);
+}
+
+
+// *************************************************
+// global, call-once helper functions
+// *************************************************
+
+// outputs appropriate DOCTYPE declaration for the document
+// this should be the 1st line in your php file after including
+// i18nhtml.inc.  Valid types are: HTML for HTML 4 documents,
+// XHTML1 for xhtml 1.0 documents, and XHTML1.1 for xhtml 1.1
+// defaulting to HTML4 if $type is blank or unknown.  An optional
+// $mode may be specified, it must be one of "Transitional",
+// "Strict", or "Frameset", defaulting to "Transitional".
+// Note for XHTML1.1 $mode is ignored.
+// example:
+//           include("i18nhtml.inc");
+//           DOCTYPE("XHTML1");
+function DOCTYPE($type=null, $mode=null) {
+  // depending on $mode, use appropriate dtd
+  if ($mode == "Strict") {
+    $dtd = "strict";
+    if ($type != "XHTML1") // Strict not specified except for XHTML1.0
+      $mode = "";
+  } else if ($mode == "Frameset") {
+    $dtd = "frameset";
+  } else { // $mode == Transitional, default, or unknown
+    $dtd = "loose";
+    $mode = "Transitional";
+  }
+  if ($type == "XHTML1")
+    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 " . $mode . "//EN\" 
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-"; . $dtd . ".dtd\">\n";
+  else if ($type == "XHTML1.1")
+    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" 
\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\";>\n";
+  else
+    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 " . $mode . "//EN\" 
\"http://www.w3.org/TR/html4/"; . $dtd . ".dtd\">\n";
+}
+
+function TITLE($a,$b="") {
+  global $lang;
+  global $languagecodes;
+  echo "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" 
>";
+  echo "<title>" . TRANSLATE_($a,$b) . "</title>\n";
+  if (isset($languagecodes[$lang])) {
+    echo "<meta name=\"content-language\" content=\"" .
+         $languagecodes[$lang] . "\">";
+    echo "<meta name=\"language\" content=\"" .
+         $languagecodes[$lang] . "\">";
+  }
+}
+
+// displays a list of all languages currently available with
+// at least 1 translated string.
+function generateLanguageBar() {
+  global $connection, $i18nHTMLsqlPrefix;
+
+  if ($connection) {
+    echo "<center>[";
+    $query = "SELECT DISTINCT lang FROM ".$i18nHTMLsqlPrefix."map ORDER BY 
lang";
+//     die($query);
+    $result = mysql_query($query, $connection);
+    $num = 0;
+    if ($result)
+      $num = mysql_numrows($result);
+    echo "<a href=\"?xlang=English\">";
+    W("English");
+    echo "</a>";
+    $last = "English";
+    for ($i=0;$i<$num;$i++) {
+      $row = mysql_fetch_array($result);
+      $next = $row["lang"];
+      if ($next == $last)
+        continue;
+      echo " | ";
+      echo "<a href=\"?xlang=$next\">" . W_($next) . "</a>";
+      $last = $next;
+    }
+    echo "]</center>";
+  }
+}
+
+
+// displays text at the bottom of the page to indicate
+// translation mode (including link to active) and
+// copyright notice for i18nHTML.
+function generateFooter() {
+  global $xlang;
+  global $editor;
+  global $HTTP_SERVER_VARS;
+
+  P();
+  echo "Translation engine based on <a 
href=\"http://gnunet.org/i18nHTML/\";>i18nHTML</a> (C) 2003, 2004, 2005 
Christian Grothoff.<br />\n";
+  if ( ($xlang) && ($xlang != "English") ) {
+    $back = "http://"; . $HTTP_SERVER_VARS["HTTP_HOST"] . 
$HTTP_SERVER_VARS["REQUEST_URI"];
+    echo "<center><small>\n";
+    if ($editor != 1)
+      echo " <a href=\"$back&amp;editor=1\">" . W_("enter translation mode") . 
"</a>";
+    else
+      W(" Translation Mode Active (for this page only)");
+    echo "</small></center>\n";
+  }
+  echo "</p>\n";
+}
+
+
+
+// *************************************************
+// HTML construct helper functions
+// *************************************************
+
+function LI($a,$b="") {
+  echo "<li>" . W_($a,$b) . "</li>\n";
+}
+function TH($a,$b="") {
+  echo "<th>" . W_($a,$b) . "</th>\n";
+}
+function TD($a,$b="") {
+  echo "<td>" . W_($a,$b) . "</td>\n";
+}
+function DT($a,$b="") {
+  echo "<dt>" . W_($a,$b) . "</dt>\n";
+}
+function DD($a,$b="") {
+  echo "<dd>" . W_($a,$b) . "</dd>\n";
+}
+function H1($a,$b="") {
+  echo "<h1>" . W_($a,$b) . "</h1>\n";
+}
+function H2($a,$b="") {
+  echo "<h2>" . W_($a,$b) . "</h2>\n";
+}
+function H3($a,$b="") {
+  echo "<h3>" . W_($a,$b) . "</h3>\n";
+}
+function H4($a,$b="") {
+  echo "<h4>" . W_($a,$b) . "</h4>\n";
+}
+function H5($a,$b="") {
+  echo "<h5>" . W_($a,$b) . "</h5>\n";
+}
+function PRE($a) {
+  echo "<pre>" . $a . "</pre>";
+}
+// 'verbatim' (untranslated) "li"
+function LIV($a) {
+  echo "<li>" . $a . "</li>\n";
+}
+function P($attr="") {
+  echo "<p $attr>\n";
+}
+function BR($attr="") {
+  echo "<br $attr/>\n";
+}
+function HR() {
+  echo "<hr/>\n";
+}
+function DTDD($a,$b) {
+  DT($a);
+  DD($b);
+}
+function LILI($a,$b) {
+  echo "<li>" . extlink_($a,$b) . "</li>\n";
+}
+function ANCHOR($a) {
+  echo "<a name=\"$a\"></a>\n";
+}
+function IMG_($src, $alt, $align="CENTER", $width, $height, $border=0, 
$hspace=0, $vspace=0) {
+  $ret = "";
+
+  if ($align == "CENTER")
+    $ret = $ret . "<p><center>\n";
+  $ret = $ret . "<img src=\"" . $src . "\" alt=\"";
+  $ret = $ret . TRANSLATE_($alt);
+  $ret = $ret . "\" align=\"" . $align . "\" width=$width height=$height 
border=$border hspace=$hspace vspace=$vspace>\n";
+  $ret = $ret . translateLink_($alt);
+  if ($align == "CENTER")
+    $ret = $ret . "</center><p>\n";
+  return $ret;
+}
+function IMG($src, $alt, $align="CENTER", $width, $height, $border=0, 
$hspace=0, $vspace=0) {
+  echo IMG_($src, $alt, $align, $width, $height, $border, $hspace, $vspace);
+}
+
+?>
\ No newline at end of file

Added: GNUnet-docs/WWW/test/i18nhtml_config.inc.php
===================================================================
--- GNUnet-docs/WWW/test/i18nhtml_config.inc.php        2005-06-13 12:00:59 UTC 
(rev 904)
+++ GNUnet-docs/WWW/test/i18nhtml_config.inc.php        2005-06-13 18:33:20 UTC 
(rev 905)
@@ -0,0 +1,36 @@
+<?php
+/*
+     (C) 2003, 2004 Christian Grothoff
+
+     This code is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 2, or (at your
+     option) any later version.
+
+     The code is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with the code; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+  // Use this file to configure i18nHTML
+
+// -- use 0 when /. comes...
+$i18nHTMLrecordMode = 2; // 1: only missing, 2: everything, 0: disable
+
+$i18nHTMLsqlServer = "localhost";
+$i18nHTMLsqlUser = "GNUnetWWW";
+$i18nHTMLsqlPass = "garlic";
+
+$i18nHTMLsqlDB = "translations"; // default is "translation"
+$i18nHTMLbase = "";  // base directory prepended to i18nHTML php pages used in 
links
+$i18nHTMLmarker = "*";  // default value if never changed
+
+$i18nHTMLsqlPrefix = ""; // use this if you want to have a prefix for the SQL 
table names used by i18nHTML
+
+?>

Modified: GNUnet-docs/WWW/test/index.php
===================================================================
--- GNUnet-docs/WWW/test/index.php      2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/index.php      2005-06-13 18:33:20 UTC (rev 905)
@@ -5,28 +5,25 @@
 include("html_header.php3");
 
 H2("About GNUnet");
+gnunetlogo();
 
-echo "<p>\n";
 W("GNUnet is a framework for secure peer-to-peer networking that does not use 
any centralized or otherwise trusted services.");
 W("A first service implemented on top of the networking layer allows anonymous 
censorship-resistant file-sharing.");
 W("GNUnet uses a simple, excess-based economic model to allocate resources.");
 W("Peers in GNUnet monitor each others behavior with respect to resource 
usage; peers that contribute to the network are rewarded with better service.");
-echo "</p>\n";
+P();
 
-echo "<p>\n";
 W("GNUnet is part of the %s.",
   extlink_("http://www.gnu.org/","GNU project"));
 W("Our official GNU website can be found at %s.",
   
extlink_("http://www.gnu.org/software/gnunet/","http://www.gnu.org/software/gnunet/";));
 W("GNUnet can be downloaded from this site or the %s.",
   extlink_("http://www.gnu.org/prep/ftp.html","GNU mirrors"));
-echo "</p>\n";
 
+P();
 H2("News");
-echo "<p>\n";
 W("Older news can be found %s.\n",
   intlink_("old_news.php3", "here"));
-echo "</p>\n";
 echo "<dl>\n";
 
 function convert_time($mysql_timestamp){
@@ -60,11 +57,11 @@
   echo "<dt>" . $pd[0] . "-" . $pd[1] . "-" . $pd[2] .  ": " . 
W_($row["title"]) . "</dt>\n";
   echo "<dd>\n";
   include($row["include"]);
-  echo "\n</dd>\n";
+  echo "</dd>\n";
 }
 echo "</dl>\n";
+P();
 H2("Roadmap");
-echo "<p>\n";
 W("Here is the current development plan:");
 echo "<ul>\n";
 LI("fix %s",
@@ -75,13 +72,12 @@
 LI("extend GTK UI (delete, statistics, configuration, recursive insertion)");
 LI("add download-daemon that manages ongoing/completed/stalled downloads");
 echo "</ul>\n";
-echo "</p>\n";
+P();
 H2("Contact");
-echo "<p>\n";
 W("GNUnet is developed by %s.",
   extlink_("http://www.gnu.org/software/gnunet/","the GNUnet developers"));
 W("For questions about GNUnet send E-Mail to %s.",
   extlink_("mailto:address@hidden","address@hidden";));
-echo "</p>";
+
 include("html_footer.php3");
 ?>

Modified: GNUnet-docs/WWW/test/mailinglist.php3
===================================================================
--- GNUnet-docs/WWW/test/mailinglist.php3       2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/mailinglist.php3       2005-06-13 18:33:20 UTC (rev 
905)
@@ -5,47 +5,40 @@
 include("html_header.php3");
 
 H2("Blogs, Forum, Stories and Polls");
-echo "<p>\n";
 W("GNUnet uses %s as a community content management system.",
   extlink_("http://gnunet.org/drupal/";, "drupal"));
 W("There, you can read the latest stories, participate in the forums and polls 
and even start your own blogs.");
 W("Everything related to GNUnet is welcome, as long as it is respectful and 
legal.");
-echo "</p>\n";
+P();
 
 H2("Bugtrack");
-echo "<p>\n";
 W("GNUnet uses Mantis for bugtracking.");
 W("Visit %s to report bugs.",
   extlink_("https://gnunet.org/mantis/","https://gnunet.org/mantis/";));
 W("You need to sign up for a reporter account.");
 W("Please make sure you report bugs under <strong>GNUnet</strong> and not 
under any of the other projects.");
-echo "</p>\n";
-echo "<p>\n";
+P();
 W("If you dislike Mantis and need to report a bug via E-mail, you can use the 
standard GNU way by sending mail to %s.",
   extlink_("mailto:address@hidden","address@hidden";));
-echo "</p>\n";
 
+P();
 H2("GNUnet Development");
-echo "<p>\n";
 W("This mailinglist is used for developer communication.");
 W("Signing up is easy, send good patches and you get CVS access, too:");
 echo "<center>";
 extlink("http://mail.gnu.org/mailman/listinfo/gnunet-developers","Developers";);
 echo "</center>";
-echo "</p>\n";
 
+P();
 H2("GNUnet Users");
-echo "<p>\n";
 W("<tt>help-gnunet</tt> is a mailinglist that is intended as a discussion 
forum for users, such that they can help other users.");
 W("Some developers usually also hang around to help.");
 W("This mailinglist is be open for everybody and any kind of (netiquette 
compatible) discussion:");
 echo "<center>";
 extlink("http://mail.gnu.org/mailman/listinfo/help-gnunet","Users";);
 echo "</center>";
-echo "</p>\n";
 
-H2("GNUnet Announcements");
-echo "<p>\n";
+P();H2("GNUnet Announcements");
 W("If you just want to receive announcements of new versions, you can 
subscribe to a strictly moderated mailinglist.");
 W("Only developers can post announcements for new releases of GNUnet related 
software on this list.");
 W("All other mail will be discareded.");
@@ -53,10 +46,8 @@
 echo "<center>";
 extlink("http://mail.gnu.org/mailman/listinfo/info-gnunet","Announcements";);
 echo "</center>";
-echo "</p>\n";
 
-H2("GNUnet Diffs");
-echo "<p>\n";
+P();H2("GNUnet Diffs");
 W("This mailinglist is used to instantly publish all commits to the %s.",
   extlink_("/svn/", "GNUnet subversion repository"));
 W("So if you want to be notified about any change to the GNUnet codebase, you 
can subscribe to this mailinglist.");
@@ -65,10 +56,9 @@
 echo "<center>";
 extlink("http://mail.gnu.org/mailman/listinfo/gnunet-sv","Diffs";);
 echo "</center>";
-echo "</p>\n";
+P();
 
 H2("Other Discussion Forums");
-echo "<p>\n";
 W("The %s is a webpage for discussions of GNUnet and related topics.",
   extlink_("http://www.boardy.de/forumdisplay.php?forumid=104104","GNUnet 
Forum"));
 W("The forum was started by German GNUnet users and hence many postings are in 
German, but contributions in English are welcome.");
@@ -77,14 +67,12 @@
   extlink_("/drupal/", "here"));
 W("%s is an international P2P board with GNUnet related subcategories.",
   extlink_("http://board.planetpeer.de/";, "Planet Peer"));
-echo "</p>\n";
 
 H2("Chat");
-echo "<p>\n";
 W("Various GNUnet people are regularly hanging out on the %s.",
   extlink_("http://www.freenode.net/","Freenode IRC Network"));
 W("The channel name is <tt>#GNUnet</tt>.");
-echo "</p>\n";
 
+P();
 include("html_footer.php3");
 ?>

Modified: GNUnet-docs/WWW/test/menu.php3
===================================================================
--- GNUnet-docs/WWW/test/menu.php3      2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/menu.php3      2005-06-13 18:33:20 UTC (rev 905)
@@ -2,34 +2,20 @@
 if (! $menu_once) {
   $menu_once = 1;
 ?>
-<table bgcolor="#0a6cce" border="0" cellpadding="0" cellspacing="0" 
height="58" width="100%">
-  <tr> 
-    <td colspan="4" height="10" nowrap="nowrap" valign="middle">
-    </td>
-  </tr>
-  <tr>
-    <td width="15">
-     &nbsp;
-    </td>
-    <td height="1" nowrap="nowrap" valign="middle"> 
-                       <font class="title">GNUnet</font>
-                       <br />
-                       <font class="subtitle">GNU's decentralized anonymous 
and censor-resistant P2P framework.</font>
-
-    </td>
-    <td align="right" valign="top">
-       <img src="gnunet-logo.png" />
-    </td>
-    <td width="10">
-     &nbsp;
-    </td>
-  </tr>
-  <tr> 
-    <td colspan="4" height="10" nowrap="nowrap" valign="middle">
-    </td>
-  </tr>
+<center>
+<table border=0 rules=none width="90%">
+ <tr>
+  <th><?php intlink("index.php","Welcome") ?></th>
+  <th><?php intlink("mailinglist.php3","Contact"); ?></th>
+  <th><?php extlink("https://gnunet.org/drupal/";, "Community"); ?></th>
+  <th><?php intlink("faq.php3","FAQ"); ?></th>
+  <th><?php intlink("download.php3","Download"); ?></th>
+  <th><?php intlink("documentation.php3","Documentation"); ?></th>
+  <th><?php intlink("papers.php3","Papers"); ?></th>
+  <th><?php intlink("links.php3","Links"); ?></th>
+ </tr>
 </table>
+</center>
 <?php
-       menu_bar();
  }
 ?>                         

Modified: GNUnet-docs/WWW/test/news_20050404.inc
===================================================================
--- GNUnet-docs/WWW/test/news_20050404.inc      2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/news_20050404.inc      2005-06-13 18:33:20 UTC (rev 
905)
@@ -4,7 +4,7 @@
 W("However, as a result, some translations had to be discarded.");
 W("This includes translations which had errors such as a mismatch in the 
number of %% signs.");
 W("The new i18nHTML version will no longer permit users to commit such 
translations.");
-echo "<br/><br/>\n";
+P();
 W("If you still have problems with the character encodings, please first check 
if your browser is set to utf8 encoding.");
 W("If that does not help, try re-translating the sentence that shows up badly 
(the automated conversion may have failed).");
 W("Otherwise, please file a detailed bug-report on %s.",

Modified: GNUnet-docs/WWW/test/news_20050506.inc
===================================================================
--- GNUnet-docs/WWW/test/news_20050506.inc      2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/news_20050506.inc      2005-06-13 18:33:20 UTC (rev 
905)
@@ -1,9 +1,9 @@
-<?php
-W("Version %s of %s has been released.",
-  
ARRAY(extlink_("http://gnunet.org/libextractor/download/libextractor-0.5.0.tar.gz";,
-                "0.5.0"),
-       extlink_("http://gnunet.org/libextractor/","libextractor";)));
-W("The release adds support for calling libextractor from Python.");
-W("Also, plugins can now be supplied with options.");
-W("Overall, the new release is compatible with plugins written for previous 
versions and also applications using the 0.4.x APIs.");
-?>
+<?php
+W("Version %s of %s has been released.",
+  
ARRAY(extlink_("http://gnunet.org/libextractor/download/libextractor-0.5.0.tar.gz";,
+                "0.5.0"),
+       extlink_("http://gnunet.org/libextractor/","libextractor";)));
+W("The release adds support for calling libextractor from Python.");
+W("Also, plugins can now be supplied with options.");
+W("Overall, the new release is compatible with plugins written for previous 
versions and also applications using the 0.4.x APIs.");
+?>

Modified: GNUnet-docs/WWW/test/scripts.inc
===================================================================
--- GNUnet-docs/WWW/test/scripts.inc    2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/scripts.inc    2005-06-13 18:33:20 UTC (rev 905)
@@ -1,5 +1,5 @@
 <?php
-include("i18nhtml.inc");
+include("i18nhtml.inc.php");
 
 // GNUnet specific functions
 
@@ -10,23 +10,6 @@
   img("gnu_in_net.png", "GNUnet logo", "RIGHT", 149, 150);
 }
 
-function menu_bar() {
-?>
-       <table bgcolor="#0a6cce" border="0" cellpadding="0" cellspacing="0" 
width="100%">
-         <tr> 
-           <td class="menu"><?php intlink("index.php","Welcome") ?></td>
-           <td class="menu"><?php intlink("mailinglist.php3","Contact"); 
?></td>
-           <td class="menu"><?php extlink("https://gnunet.org/drupal/";, 
"Community"); ?></td>
-           <td class="menu"><?php intlink("faq.php3","FAQ"); ?></td>
-           <td class="menu"><?php intlink("download.php3","Download"); ?></td>
-           <td class="menu"><?php 
intlink("documentation.php3","Documentation"); ?></td>
-           <td class="menu"><?php intlink("papers.php3","Papers"); ?></td>
-           <td class="menu"><?php intlink("links.php3","Links"); ?></td>
-         </tr>
-       </table>
-<?php
-}
-
 function shortEntry_($a, $b="") {
   return "<td align=center>" . W_($a) . $b . "</td>";
 }

Added: GNUnet-docs/WWW/test/start.php
===================================================================
--- GNUnet-docs/WWW/test/start.php      2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/start.php      2005-06-13 18:33:20 UTC (rev 905)
@@ -0,0 +1,29 @@
+<?php
+include("i18nhtml.inc.php");
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>\n";
+TITLE("Documentation");
+echo "</head><body>";
+generateLanguageBar();
+H2("Documentation");
+H3("i18nHTML");
+W("These webpages uses %s to internationalize the documentation.",
+  extlink_("http://gnunet.org/i18nHTML/";, "i18nHTML"));
+W("Please feel encouraged to help, for example by translating some of the 
pages to your native language.");
+W("Just view the pages in your language and click on the &quot;*&quot; after a 
sentence to translate it.");
+W("You can start a new language by adding <tt>lang=LANGUAGE</tt> after the 
<tt>.php3</tt> in the URL.");
+W("The translations incorporate a voting system, the highest ranked 
translation is displayed.");
+W("English is always the source language.");
+W("Only developers can change the source, contact them if you find problems.");
+W("On the translation page, you find all other translations.");
+W("You can also vote for a specific translation by clicking on the respective 
sentence.");
+W("You are allowed to vote multiple times for the same sentence, e.g. to 
express strong feelings. :-)");
+W("The system logs your IP and allows the administrator to easily undo all 
operations that were performed from a certain IP address.");
+if ($xlang && ($xlang != "English") ) {
+  W("You can translate the most commonly requested untranslated sentences for 
your language using the %s.",
+    intlink_("editor.php", "mass translation page"));
+ }
+
+generateFooter();
+echo "</body></html>\n";
+?>

Modified: GNUnet-docs/WWW/test/status.php
===================================================================
--- GNUnet-docs/WWW/test/status.php     2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/status.php     2005-06-13 18:33:20 UTC (rev 905)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -18,74 +18,76 @@
      Boston, MA 02111-1307, USA.
 */
   // This file can be used to obtain some statistics
-  // about the progress of the translation. 
+  // about the progress of the translation.
   // It has no other purpose.
 
-include("i18nhtml.inc");
+include("i18nhtml.inc.php");
 if (!$connection) {
   echo "Database is down.";
   die();
  }
-echo "<html><head><title>";
-TRANSLATE("Translation: status");
-echo "</title></head><body>";
+$mode = $_REQUEST['mode'];
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>\n";
+TITLE("Translation: status");
+echo "</head><body>";
 W("Language setting is %s.",
   $lang);
 P();
-if ($mode == 1) {
-  H2("All available translations");
-  echo "<table border=5>\n";
-  echo "<tr><th>";
-  W("Original");
-  echo "</th><th>";
-  W("Language");
-  echo "</th><th>";
-  W("Translation");
-  echo "</th><th>";
-  W("Votes");
-  echo "</th></tr>\n";
- }
-
-$query = "SELECT count FROM pending WHERE lang=\"English\"";
+$query = "SELECT count FROM ".$i18nHTMLsqlPrefix."pending WHERE 
lang=\"English\"";
 $result = mysql_query($query, $connection);
 $num = 0;
-if ($result) 
+if ($result)
   $num = mysql_numrows($result);
 W("Sentences in the original English text: %s",
   $num);
 P();
-
+if ($mode == 1) {
+  H2("All available translations");
+  echo "<table border='5'>\n";
+  echo "<tr>";
+  TH("Original");
+  TH("Language");
+  TH("Translation");
+  TH("Votes");
+  echo "</tr>\n";
+}
 $stats = ARRAY();
-$query = "SELECT name,ranking,translation,lang FROM map";
+$query = "SELECT name,ranking,translation,lang FROM ".$i18nHTMLsqlPrefix."map";
 $result = mysql_query($query, $connection);
 $num = 0;
-if ($result) 
+if ($result)
   $num = mysql_numrows($result);
 for ($i=0;$i<$num;$i++) {
   $row = mysql_fetch_array($result);
-  $text = urldecode($row["name"]);
+  $text = stripslashes($row["name"]);
+  $translation = stripslashes($row["translation"]);
   $ranking = $row["ranking"];
   $stats[$row["lang"]]++;
-  if ($mode == 1)
-    printf("<tr><td>%s</td><td>%s</td><td><a 
href=\"vote.php3?lang=%s&text=%s&translation=%s\">%s</a></td><td>%s</td></tr>\n",
-          urldecode($text),
+  if ($mode == 1) {
+    printf("<tr><td>%s</td><td>%s</td><td><a href=\"vote.php3?" .
+           "lang=%s&text=%s&translation=%s\">%s</a></td><td>%s</td></tr>\n",
+          $text,
           $row["lang"],
-          $row["lang"],
-          $text,
-          $row["translation"],
-          urldecode($row["translation"]),
+          urlencode($row["lang"]),
+          urlencode($text),
+          urlencode($translation),
+          $translation,
           $ranking);
- }
-if ($mode == 1)
-  echo "</table><p><hr><p>\n";
-
-echo "$num ";
-W("translations in database.");
-echo "<p>\n";
+  }
+}
+if ($mode == 1) {
+  echo "</table>";
+  P();
+  HR();
+  P();
+}
+W("%s translated sentences in database.", $num);
+P();
 foreach ($stats as $a => $b) {
-  echo "$b ";
-  W("in ");
-  echo "$a<br>";
+  W("%s translations available in %s.", ARRAY($b, $a));
+  BR();
 }
+generateFooter();
 echo "</body></html>";
 ?>
\ No newline at end of file

Modified: GNUnet-docs/WWW/test/translate.php
===================================================================
--- GNUnet-docs/WWW/test/translate.php  2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/translate.php  2005-06-13 18:33:20 UTC (rev 905)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -17,19 +17,18 @@
      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
      Boston, MA 02111-1307, USA.
 */
-include("i18nhtml.inc");
+include("i18nhtml.inc.php");
 if (!$connection) {
   echo "Database is down. Cannot edit translations.";
   die();
 }
-$text = $_REQUEST['text'];
+$text     = fix($_REQUEST['text']);
+$text_sql = quote_smart($text);
+$text_url = urlencode($text);
 $back = $_REQUEST['back'];
-
 DOCTYPE("HTML", "Transitional");
 echo "<html><head>\n";
-echo "<title>";
-TRANSLATE("WWW translation");
-echo "</title>";
+TITLE("WWW translation");
 echo "<meta name=\"description\" content=\"";
 TRANSLATE("Help translating this webpage.");
 echo "\">";
@@ -37,68 +36,45 @@
 if ($lang == "English") {
   echo "Cannot translate to English.";
   die();
- } 
+ }
 H2("Original Text");
-// if (get_magic_quotes_gpc()) $text = stripslashes($text);
 echo $text;
 H2("Translation");
 W("Destination language: ");
 W($lang);
 P();
-echo "<form action=\"" . $i18nHTMLbase . "commitTranslation.php\">\n";
-echo "<input type=hidden name=\"text\" value=\"" . urlencode($text) . "\">\n";
+echo "<form method=\"POST\" action=\"" . $i18nHTMLbase . 
"commitTranslation.php\">\n";
+echo "<input type=hidden name=\"text\" value=\"$text_url\">\n";
 echo "<input type=hidden name=\"xlang\" value=\"$xlang\">\n";
 echo "<input type=hidden name=\"back\" value=\"$back\">\n";
-/* 
-P();
-W("Character set:");
-<select size="1" name="charset">
-  <option value="UTF-8">Unicode UTF-8 encoding</option>
-  <option selected value="ISO-8859-1">ISO-8859-1 Western European, 
Latin-1</option>
-  <option value="ISO-8859-15">ISO-8859-15 Extended Western European</option>
-  <option value="cp1252">cp1252 Windows Western Europen</option>
-  <option value="cp866">cp866 DOS Cyrillic</option>
-  <option value="cp1251">cp1251 Windows Cyrillic</option>
-  <option value="KOI8-R">koi8-ru Russian</option>
-  <option value="BIG5">BIG5 Traditional Chinese</option>
-  <option value="GB2312">GB2312 Simplified Chinese</option>
-  <option value="Shift-JIS">Shift-JIS Japanese</option>
-  <option value="EUC-JP">EUC-JP Japanese</option>
-</select><br> */
 W("Translated text:");
-?>
-<input size="80" maxlength="65535" name="translation">
-<input type=submit value="I hereby give this translation into the Public 
Domain (commit)">
-</form>
-<?php
+echo "<input size=\"80\" maxlength=\"65535\" name=\"translation\">\n";
+echo "<input type=submit value=\"" .
+     TRANSLATE_("I hereby give this translation into the Public Domain 
(commit)") .
+     "\">\n";
+echo "</form>\n";
 P();
 
 H2("All available translations");
-?>
-<table border=5 width=95%>
-<tr><th><?php W("Language"); ?></th><th><?php W("Translation"); ?></th></tr>
-<?php
- $u = urlencode($text);
- $query = "SELECT translation,lang FROM map WHERE name=\"$u\" ORDER BY ranking 
DESC";
- $result = mysql_query($query, $connection);
- $num = 0;
- if ($result) 
-   $num = mysql_num_rows($result);
- for ($i=0;$i<$num;$i++) {
-   $row = mysql_fetch_array($result);
-
-   // we assume strings escaped before adding to DB
-   $translation = stripslashes($row["translation"]);
-
-   printf("<tr><td>%s</td><td><a href=\"" . $i18nHTMLbase . 
"vote.php?xlang=%s&text=%s&translation=%s\">%s</a></td></tr>\n",
-          W_($row["lang"]),
-          urlencode($row["lang"]),
-         urlencode($text),
-         $translation,
-         urldecode($translation));
- }
+echo "<table border=5 width=95%>\n";
+echo "<tr><th>" . W_("Language") . "</th><th>" . W_("Translation") . 
"</th></tr>\n";
+$query = "SELECT translation,lang FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\" ORDER BY ranking DESC";
+$result = mysql_query($query, $connection);
+$num = 0;
+if ($result)
+  $num = mysql_num_rows($result);
+for ($i=0;$i<$num;$i++) {
+  $row = mysql_fetch_array($result);
+  $translation = $row["translation"];
+  printf("<tr><td>%s</td><td><a href=\"" . $i18nHTMLbase .
+         "vote.php?xlang=%s&text=%s&translation=%s\">%s</a></td></tr>\n",
+         W_($row["lang"]),
+         urlencode($row["lang"]),
+         urlencode($text_url),  // yes, we need urlencode twice!
+         urlencode(urlencode($translation)), // yes, we need urlencode twice!
+         fix($translation));
+}
 echo "</table>";
-
 H2("Remarks");
 H3("The percent sign");
 W("The %% sign is a special character.");
@@ -106,19 +82,15 @@
 W("The sequence %%s is used as a placeholder for links.");
 W("Currently, the translation can only access the links in the same order as 
the original text.");
 P();
-
 H3("Language specific special characters");
 W("Various languages use special characters.");
 W("The code has not been tested with certain character sets, such as 
Chinese.");
 W("If you are trying to translate the page to such a language, please contact 
the developerws if you encounter any problems.");
 P();
-
 H3("Copyright");
 W("The original english text is released under the GNU Free Documentation 
License (FDL).");
 W("Translations submitted to the webpage must be released to the public domain 
to ensure that we will not have any legal trouble.");
 W("If you have concerns or remarks regarding this policy, feel free to bring 
them to our attention.");
-
 generateFooter();
 echo "</body></html>";
-
-?>
\ No newline at end of file
+?>

Added: GNUnet-docs/WWW/test/update0_1_0.php
===================================================================
--- GNUnet-docs/WWW/test/update0_1_0.php        2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/update0_1_0.php        2005-06-13 18:33:20 UTC (rev 
905)
@@ -0,0 +1,50 @@
+<?php
+include("i18nhtml.inc");
+?>
+# This script merely generates the SQL statements<br>
+# to do the update.  You'll have to run the SQL<br>
+# commands yourself to prevent accidental data loss.<br>
+# <pre>
+<?php
+echo "use $i18nHTMLsqlDB;\n";
+$query = "SELECT * FROM map";
+$result = mysql_query($query, $connection);
+$num = 0;
+$loss = 0;
+if ($result) 
+  $num = mysql_numrows($result);
+for ($ii=0;$ii<$num;$ii++) {
+  $row = mysql_fetch_array($result);
+  $la = mysql_real_escape_string($row["lang"]);
+  $src = mysql_real_escape_string($row["name"]); // urlencoded
+  $dst = $row["translation"]; // possibly urlencoded
+  $rank = $row["ranking"];
+  $rtrans = mysql_real_escape_string(to_unicode(urldecode($dst)));
+  // detect "bad" translations (where conversion failed)
+  // if more than 5 values in [0..9] follow => bad conversion
+  $txtCnt = count_chars(urldecode($src), 1);
+  $tCnt = count_chars($rtrans, 1);
+
+  // 3426
+  if (! ( ereg("&#[0-9]{6}", $rtrans) ||
+          ($txtCnt[ord('%')] != $tCnt[ord('%')]) ||
+          ( ( ($la != "Japanese") &&
+              ($la != "Traditional chinese") &&
+              ($la != "Russian") &&
+              ($la != "Ukrainian") &&
+             (ereg("&#[0-9]{4}", $rtrans)) ) ) ) ) {
+    $dst = mysql_real_escape_string($dst);
+    if ($rtrans != $dst) {
+      $subquery = "UPDATE map SET translation=\"$rtrans\" WHERE name=\"$src\" 
AND lang=\"$la\" AND translation=\"$dst\" AND ranking=$rank;\n";
+      echo "$subquery\n";
+    }
+  } else {
+    $subquery = "DELETE FROM map WHERE name=\"$src\" AND lang=\"$la\" AND 
translation=\"$dst\" AND ranking=$rank;\n";
+    echo "$subquery\n";
+    $loss++;
+  }
+ }
+echo "# Lost $loss out of $num translations.\n";
+?>
+# </pre>
+# end of conversion

Added: GNUnet-docs/WWW/test/update0_2_0.php
===================================================================
--- GNUnet-docs/WWW/test/update0_2_0.php        2005-06-13 12:00:59 UTC (rev 
904)
+++ GNUnet-docs/WWW/test/update0_2_0.php        2005-06-13 18:33:20 UTC (rev 
905)
@@ -0,0 +1,36 @@
+<?php
+include("i18nhtml.inc");
+?>
+# This script merely generates the SQL statements<br>
+# to do the update.  You'll have to run the SQL<br>
+# commands yourself to prevent accidental data loss.<br>
+# <pre>
+<?php
+echo "use $i18nHTMLsqlDB;\n";
+$query = "SELECT * FROM map";
+$result = mysql_query($query, $connection);
+$num = 0;
+$loss = 0;
+if ($result) 
+  $num = mysql_numrows($result);
+for ($ii=0;$ii<$num;$ii++) {
+  $row = mysql_fetch_array($result);
+  $la = mysql_real_escape_string($row["lang"]);
+  $src = $row["name"]; // urlencoded
+  $src_sql = mysql_real_escape_string($src);
+  $dst_sql = mysql_real_escape_string($row["translation"]);
+  $rank = $row["ranking"];
+  $rname = fix(urldecode($src));
+  $rname_sql = mysql_real_escape_string(fix(urldecode($src)));
+  // detect "bad" translations (where conversion failed)
+  // if more than 5 values in [0..9] follow => bad conversion
+  $txtCnt = count_chars(urldecode($src), 1);
+  $tCnt = count_chars($rtrans, 1);
+
+  $dst = mysql_real_escape_string($dst);
+  $subquery = "UPDATE map SET name=\"$rname_sql\" WHERE name=\"$src_sql\" AND 
lang=\"$la\" AND translation=\"$dst_sql\" AND ranking=$rank;\n";
+  echo "$subquery";
+}
+?>
+# </pre>
+# end of conversion

Modified: GNUnet-docs/WWW/test/user_afs.php3
===================================================================
--- GNUnet-docs/WWW/test/user_afs.php3  2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/user_afs.php3  2005-06-13 18:33:20 UTC (rev 905)
@@ -109,12 +109,12 @@
 W("Note that the UI may not always be very pretty for collections since this 
is a new feature.");
 P();
 
-ANCHOR("configuration");H3("AFS options in gnunet.conf");
+ANCHOR("configuration");H3("File-sharing options in gnunet.conf");
 
 W("This section describes the options in gnunet.conf that relate to anonymous 
file sharing.");
 W("Most options are in the configuration file for the gnunetd daemon, the 
others are specfically marked as client options.");
 
-ANCHOR("gnunet.conf.diskquota");H4("AFS: DISKQUOTA");
+ANCHOR("gnunet.conf.diskquota");H4("FS: DISKQUOTA");
 
 W("Use this option to specify how much space GNUnet is allowed to use on the 
drive.");
 W("This does not include indexed files.");
@@ -127,68 +127,17 @@
 
 
 P();
-ANCHOR("gnunet.conf.indexdirectory"); H4("AFS: INDEX-DIRECTORY");
+ANCHOR("gnunet.conf.indexdirectory"); H4("FS: INDEX-DIRECTORY");
 
 W("This option specifies the name of the directory where indexed files are 
either copied to or symlinked from.");
 W("When a file is indexed with the option <tt>-l</tt> and if <tt>gnunetd</tt> 
and the inserting process run on the same machine, then a symbolic link is 
created from the index-directory to that file.");
 W("Without the <tt>-l</tt> option or if <tt>gnunetd</tt> runs on a different 
machine, a copy of the file is made instead.");
 W("Note that the indexing process does a lot more than just this, thus moving 
files over to the index directory by hand will NOT share these files.");
 
-P();
-ANCHOR("gnunet.conf.indexquota"); H4("AFS: INDEX-QUOTA");
-W("This option specifies the maximum size of the copied (!) files in the index 
directory.");
-W("Note that files that were indexed with the <tt>-l</tt> option on the local 
machine do not count towards the quota.");
-W("The quota is used to limit the amount of data that users can copy to the 
index directory.");
-W("It is separate from the normal QUOTA which applies to inserted (not 
indexed) and migrated content.");
 
-
-
 P();
-ANCHOR("gnunet.conf.anonymity-receive");H4("AFS: ANONYMITY-RECEIVE");
+ANCHOR("gnunet.conf.activemigration");H4("FS: ACTIVEMIGRATION");
 
-W("With this option you can specify the required degree of receiver 
anonymity.");
-W("If set to zero, GNUnet will try to download the file as fast as possible 
without any additional slowdown by the anonymity code due to a lack of 
traffic.");
-W("Note that you will still have a fairly high degree of anonymity due to 
link-to-link encryption, small uniform messages, pseudo-random routing and 
random delays.");
-W("Still, your anonymity will depend on the current network load if the 
adversary is powerful enough to monitor most of your traffic.");
-W("The download is still unlikely to be terribly fast since the sender may 
have requested sender-anonymity and since in addition to that, GNUnet will 
still do the anonymous routing.");
-BR();
-
-W("This option can be used to further limit the number of requests that are 
send out to the network.");
-W("In particular, you can require GNUnet to receive certain amounts of traffic 
from other peers before sending your queries.");
-W("This way, you can gain very high levels of anonymity - at the expense of 
much more traffic and much higher latency.");
-W("Since downloads are likely to quickly get very slow or even stop entirely, 
set it only if you really believe you need the strongest possible anonymity.");
-BR();
-
-W("The definition of ANONYMITY-RECEIVE is the following:");
-BR();
-echo "<ul><li>";
-W("If the value v is smaller than 1000, it means that if GNUnet routes n bytes 
of messages from foreign peers, it may originate n/v bytes of queries in the 
same time-period.");
-W("The time-period is twice the average delay that GNUnet deferrs forwarded 
queries.");
-echo "</li><li>";
-W("If the value v is larger or equal to 1000, it means that if GNUnet routes n 
bytes of QUERIES from at least (v MOD 1000) peers, it may originate n/v/1000 
bytes of queries in the same time-period.");
-echo "</li></ul>";
-BR();
-
-W("The default is 0 and this should be fine for most users.");
-W("Also notice that if you choose high values, especially above 1000, you may 
end up having no throughput at all, especially if many of your fellow 
GNUnet-peers do the same.");
-
-P();
-ANCHOR("gnunet.conf.anonymity-send");H4("AFS: ANONYMITY-SEND");
-
-W("You can also request a certain degree of anonymity for the files and blocks 
that you are sharing.");
-W("In this case, only a certain faction of the traffic that you are routing 
will be allowed to be replies that originate from your machine.");
-W("Again, 0 means unlimited.");
-BR();
-
-W("The semantics of ANONYMITY-SEND are equivalent to the semantics of %s",
-  extlink_("#gnunet.conf.anonymity-receive","ANONYMITY-RECEIVE"));
-BR();
-
-W("The default is 0 and this should be fine for most users.");
-
-P();
-ANCHOR("gnunet.conf.activemigration");H4("AFS: ACTIVEMIGRATION");
-
 W("Setting this option to <tt>YES</tt> allows <tt>gnunetd</tt> to migrate data 
to the local machine.");
 W("Setting this option to <tt>YES</tt> is highly recommended for efficiency.");
 W("Its also the default.");
@@ -198,7 +147,7 @@
 W("Note that in either case, your anonymity would have to be broken first 
(which may be possible depending on the size of the GNUnet network and the 
strength of the adversary).");
 
 P();
-ANCHOR("gnunet.conf.searchtimeout");H4("AFS: SEARCHTIMEOUT");
+ANCHOR("gnunet.conf.searchtimeout");H4("FS: SEARCHTIMEOUT");
 
 W("This is a client option respected by <tt>gnunet-search</tt> and 
<tt>gnunet-gtk</tt>.");
 w("After how many seconds should <tt>gnunet-search</tt> give up searching?");
@@ -208,7 +157,7 @@
 W("The default is 300 seconds.");
 
 P();
-ANCHOR("gnunet.conf.extractors");H4("AFS: EXTRACTORS");
+ANCHOR("gnunet.conf.extractors");H4("FS: EXTRACTORS");
 
 W("This is a client option respected by <tt>gnunet-insert</tt> and 
<tt>gnunet-gtk</tt>.");
 W("This option specifies which additional extractors <tt>gnunet-insert</tt> 
should use for keyword extraction.");
@@ -216,71 +165,17 @@
 W("Typically, an extractor for splitting keywords at word boundaries is added 
here.");
 
 P();
-ANCHOR("gnunet.conf.databasetype");H4("AFS: DATABASETYPE");
+ANCHOR("gnunet.conf.databasetype");H4("MODULES: sqstore");
 
 W("Which database type should be used for content?");
-W("Valid types are &quot;gdbm&quot;, &quot;tdb&quot;, &quot;bdb&quot;, 
&quot;mysql&quot;, &quot;sqlite&quot; and &quot;directory&quot;.");
+W("Valid types are &quot;sqstore_sqlite&quot; and &quot;sqstore_mysql&quot;.");
 W("The libraries and header files for the specified type must have been 
available at compile time.");
-W("");
-W("Only &quot;directory&quot; is guaranteed to be available on all systems.");
-W("If the type is changed, you must stop <tt>gnunetd</tt> and run 
<tt>gnunet-convert</tt> to convert the database.");
+W("If the type is changed, you must stop <tt>gnunetd</tt> and run 
<tt>gnunet-update</tt> to convert the database.");
 BR();
-
-W("Here are some performance numbers for the databases from Eric Haumant (for 
a 100 MB file with random content):");
-P();
-?>
-<center>
-<table border=5>
- <tr>
-  <th><?php W("Database"); ?></th>
-  <th><?php W("Upload Speed"); ?></th>
-  <th><?php W("Download Speed"); ?></th>
-  <th><?php W("Space used"); ?></th>
- </tr>
- <tr>
-  <td><?php W("mysql"); ?></td>
-  <td><?php W("400 kb/s"); ?></td>
-  <td><?php W("300 kb/s"); ?></td>
-  <td><?php W("113 MB"); ?></td>
- </tr>
-</table>
-</center>
-<?php
-W("Nils Durner compared the new SQLite database with bdb:");
-?>
-<center>
-<table border=5>
- <tr>
-  <th><?php W("Database"); ?></th>
-  <th><?php W("Upload Speed (73 MB file)"); ?></th>
-  <th><?php W("Upload Speed (279 MB file)"); ?></th>
-  <th><?php W("Space used (73 MB file)"); ?></th>
-  <th><?php W("Space used (279 MB file)"); ?></th>
- </tr>
- <tr>
-  <td><?php W("SQLite"); ?></td>
-  <td><?php W("70,562 kb/s"); ?></td>
-  <td><?php W("24,255 kb/s"); ?></td>
-  <td><?php W("91,4 MB"); ?></td>
-  <td><?php W("348,9 MB"); ?></td>
- </tr>
-</table>
-</center>
-<?php
-W("Note that these numbers may be slightly different between different 
machines and different versions of GNUnet.");
-W("Nevertheless, they should help you pick the right database for you (the 
choice is between work required to do the setup vs. performance).");
 W("The <tt>mysql</tt> module requires manual setup, described %s.",
   extlink_("#mysql","here"));
 W("The sqlite databases only requires the installation of the respective 
database (with header files) before running configure.");
 
-ANCHOR("gnunet.conf.content-priority");H4("GNUNET-INSERT: CONTENT-PRIORITY");
-
-W("What is the initial priority of content that is locally inserted?");
-W("Default is 65535 which is <em>very high</em> (every day, content ages by 2 
points; thus inserting content at 65535 will make it age to 
<em>unimportant</em> in about 100 years).");
-P();
-HR();
-P();
-
 ANCHOR("mysql");H4("Setting up the mysql database");
 
 W("Note: The mysql module does NOT work with mysql v3.23.49 due to a bug in 
mysql.");
@@ -373,7 +268,7 @@
 
 
 
-ANCHOR("commands");H3("Commands for Anonymous File Sharing");
+ANCHOR("commands");H3("Commands for File Sharing");
 
 IMG("afs_small.png", "Anonymous file sharing logo", "RIGHT", 150, 115);
 W("The only useful application that is currently available for GNUnet is 
anonymous file-sharing.");
@@ -386,12 +281,17 @@
 W("The command <tt>gnunet-insert</tt> can be used to add content to the 
network.");
 W("The basic format of the command is");
 
-PRE("# gnunet-insert [-n] [-k KEYWORDS]* [-D Description] FILENAME 
[FILENAMES]*");
+PRE("$ gnunet-insert [-n] [-k KEYWORDS]* [-m TYPE:VALUE] FILENAME 
[FILENAMES]*");
 
 W("The option -k is used to specify keywords for the file that should be 
inserted.");
 W("You can supply any number of keywords, and each of the keywords will be 
sufficient to locate and retrieve the file.");
-W("The description (option -D, text with spaces must be in quotes) is 
displayed to other users when they select which files to download.");
-W("The description and the keywords are optional and can be inferred if you 
have %s installed and libextractor is able to infer keywords and a description 
from the file.",
+W("The -m option is used to specify meta-data, such as descriptions.");
+W("You can use -m multiple times.");
+W("The TYPE passed must be from the list of meta-data types known to 
libextractor.");
+W("You can obtain this list by running <tt>extract -l</tt>.");
+W("Use quotes around the entire meta-data argument if the value contains 
spaces.");
+W("The meta-data is displayed to other users when they select which files to 
download.");
+W("The meta-data and the keywords are optional and maybe inferred by %s.",
   intlink_("/libextractor/index.php", "libextactor"));
 P();
 
@@ -428,18 +328,18 @@
 W("The command <tt>gnunet-search</tt> can be used to search for content on 
GNUnet.");
 W("The format is:");
 
-PRE("# gnunet-search [-t TIMEOUT] KEYWORD [AND KEYWORD]*");
+PRE("$ gnunet-search [-t TIMEOUT] KEYWORD [AND KEYWORD]*");
 
 W("The -t option specifies that the query should timeout after approximately 
TIMEOUT seconds.");
 W("A value of zero is interpreted as <i>no timeout</i>.");
 W("If multiple words are passed as keywords and are <strong>not</strong> 
separated by an <tt>AND</tt>, gnunet-search will concatenate them to one bigger 
keyword.");
 W("Thus,");
 
-PRE("# gnunet-search Das Kapital");
+PRE("$ gnunet-search Das Kapital");
 
 W("and");
 
-PRE("# gnunet-search \"Das Kapital\"");
+PRE("$ gnunet-search \"Das Kapital\"");
 
 W("are identical.");
 W("You can use AND to separate keywords.");
@@ -448,7 +348,7 @@
 
 P();
 W("Search results are printed by gnunet-search like this:");
-PRE("gnunet-download -o &quot;COPYING&quot; -- 
gnunet://afs/N8RCF3TETLRU9CV1PAS7M2H9QDB36AE3.K9JO8IP7KTNFO23S3VB4TFUKLD7SO5AS.0466DC92.17992\n"
 .
+PRE("$ gnunet-download -o &quot;COPYING&quot; -- 
gnunet://afs/N8RCF3TETLRU9CV1PAS7M2H9QDB36AE3.K9JO8IP7KTNFO23S3VB4TFUKLD7SO5AS.0466DC92.17992\n"
 .
     "=&gt; The GNU Public License &lt;= (mimetype: text/plain)");
 
 W("The first line is the command you would have to enter to download the 
file.");
@@ -463,11 +363,11 @@
 ANCHOR("gnunetdownload");H4("gnunet-download");
 W("In order to download a file, you need the three values returned by 
<tt>gnunet-search</tt>.");
 W("You can then use the tool <tt>gnunet-download</tt> to obtain the file:");
-PRE("# gnunet-download -f FILENAME -- GNUNETURL");
+PRE("$ gnunet-download -f FILENAME -- GNUNETURL");
 W("FILENAME specifies the name of the file where GNUnet is supposed to write 
the result.");
 W("Existing files are overwritten.");
 W("If you want to download the GPL from the previous example, you do the 
following:");
-PRE("# gnunet-download -o \"COPYING\" -- 
gnunet://afs/N8RCF3TETLRU9CV1PAS7M2H9QDB36AE3.K9JO8IP7KTNFO23S3VB4TFUKLD7SO5AS.0466DC92.17992");
+PRE("$ gnunet-download -o \"COPYING\" -- 
gnunet://afs/N8RCF3TETLRU9CV1PAS7M2H9QDB36AE3.K9JO8IP7KTNFO23S3VB4TFUKLD7SO5AS.0466DC92.17992");
 W("If you ever have to abort a download, you can continue it at any time by 
re-issuing <tt>gnunet-download</tt> with the same filename.");
 W("In that case, GNUnet will <strong>not</strong> download blocks again that 
are already present.");
 W("GNUnet&rsquo;s %s will ensure file integrity, even if the existing file was 
not downloaded from GNUnet in the first place.",
@@ -486,7 +386,6 @@
 W("<tt>gnunet-delete</tt> can be used to un-index files that were inserted 
into GNUnet (works only for files that were inserted locally and that are still 
present on the local drive).");
 
 ANCHOR("gnunetdirectory");H4("gnunet-directory");
-W("Since version 0.5.5 GNUnet supports directories.");
 W("Directories are shared just like ordinary files.");
 W("If you download a directory with <tt>gnunet-download</tt>, you can use 
<tt>gnunet-directory</tt> to list its contents.");
 W("The contents of a directory are File Identifiers (FIs).");
@@ -496,12 +395,8 @@
 W("In order to make it possible to assemble directories, GNUnet stores all 
locally known FIs in a plaintext database, the FI database.");
 
 P("This <tt>gnunet-directory</tt> can also be used to list the contents of the 
FI database.");
-W("The FI database is organized into four categories.");
-W("The categorization of the entries of the FI database is used to specify 
where the FI was originally from.");
-W("The categories are insertion (locally inserted file), search result, 
namespace entry and directory (a directory was downloaded and displayed with 
<tt>gnunet-gtk</tt> or <tt>gnunet-directory</tt> and the FI was part of that 
listing).");
-W("The option <tt>-a</tt> causes the display of all known FI entries in all 
categories.");
-W("Entries from a specific category can be printed with the respective letter 
option.");
-W("The corresponding capital letter options remove all entries from a given 
category.");
+W("The option <tt>-l</tt> causes the display of all known FI entries.");
+W("The FI database can be flushed using the <tt>-k</tt> option.");
 W("There is currently no way to selectively remove a specific entry.");
 
 HR();
@@ -517,13 +412,6 @@
 W("A pseudonym is the virtual identity of the entity in control of a 
namespace.");
 W("Anyone can create any number of pseudonyms.");
 W("Note that creating a pseudonym can take a few minutes depending on the 
performance of the machine used.");
-W("Pseudonyms can be encrypted with a password.");
-W("The password is then used to additionally encrypt the key of the 
pseudonym.");
-W("A password is only useful if the local GNUnet-directory may be potentially 
exposed to an adversary who would like to cease control of the namespace.");
-W("If the local disk is private and not seriously threatened, not using any 
password protection for a pseudonym is acceptable.");
-W("If password protection is desired, use the &quot;-p&quot; option to specify 
a password.");
-W("There is currently no tool to change a password, but it should not be 
difficult to write one.");
-W("The ID of an encrypted pseudonym can only be listed if the respective 
password is specified.");
 P();
 W("With the <tt>-D NICK</tt> option pseudonyms can be deleted.");
 W("Once the pseudonym has been deleted it is impossible to add content to the 
corresponding namespace.");
@@ -546,10 +434,9 @@
 W("While the namespace is uniquely identified by its ID, another way to refer 
to the namespace is to use the NICKNAME.");
 W("The NICKNAME can be freely chosen by the creator of the namespace and hence 
conflicts are possible.");
 W("If a GNUnet client learns about more than one namespace using the same 
NICKNAME, the ID is appended to the NICKNAME go get a unique identifier.");
-W("The advertisement also contains various optional descriptions of the 
content of the namespace.");
-W("More specifically, it contains a DESCRIPTION (text), a CONTACT address 
(e-mail), a URI (where to find more information), a MIME-TYPE (what is the 
primary type of the data in the namespace) and a NAME (the name of the creator 
in real-life).");
+W("The advertisement also contains meta-data describing the content of the 
namespace.");
 W("Naturally all of this information is <tt>optional</tt> and maybe 
<tt>incorrect</tt> since it is provided by the user and cannot be verified.");
-W("Another item of particular interest in the namespace advertisement is the 
ROOT.");
+W("An item of particular interest in the namespace advertisement is the 
ROOT.");
 W("The ROOT is the identifier of a designated file in the namespace.");
 W("The idea is that the ROOT can be used to advertise an entry point to the 
content of the namespace.");
 P();
@@ -560,6 +447,8 @@
 
 P();
 ANCHOR("GUI");H4("gnunet-gtk");
+W("<tt>gnunet-gtk</tt> is not yet available for GNUnet 0.7.x.");
+/*
 W("<tt>gnunet-gtk</tt> is the GTK+ interface for GNUnet.");
 W("It can currently only be used to search for and download files from the 
network.");
 W("gnunet-gtk can also be used to insert files into the network.");
@@ -630,5 +519,6 @@
 W("Just as <tt>gnunet-pseudonym</tt> can print a list of all known namespace 
advertisements, the namespace search in <tt>gnunet-gtk</tt> offers access to 
the list of advertised namespaces and the respective meta-data.");
 IMG("gnunet-namespace-search.png", "Searching a namespace.", "CENTER", 658, 
348);
 P();
+*/
 include("html_footer.php3");
 ?>

Modified: GNUnet-docs/WWW/test/vote.php
===================================================================
--- GNUnet-docs/WWW/test/vote.php       2005-06-13 12:00:59 UTC (rev 904)
+++ GNUnet-docs/WWW/test/vote.php       2005-06-13 18:33:20 UTC (rev 905)
@@ -1,6 +1,6 @@
 <?php
 /*
-     (C) 2003, 2004 Christian Grothoff
+     (C) 2003, 2004, 2005 Christian Grothoff
 
      This code is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -17,37 +17,39 @@
      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
      Boston, MA 02111-1307, USA.
 */
-  // This file records votes from users for translations.
-  // For sentences with multiple translations, the one with the most
-  // votes is displayed.
-include("i18nhtml.inc");
-echo "<html><head><title>";
-W("WWW translation: vote");
-echo "</title></head><body>";
+// This file records votes from users for translations.
+// For sentences with multiple translations, the one with the most
+// votes is displayed.
+include("i18nhtml.inc.php");
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>";
+TITLE("WWW translation: vote");
+echo "</head><body>";
 if (!$connection) {
   echo "Database is down. Cannot edit translations.";
   die();
- } 
-$text = $_REQUEST['text'];
-$translation = $_REQUEST['translation'];
-$u = urlencode($text);
-$t = urlencode($translation);
-echo "text = " . $text . "<br>\n";
-echo "translation = " . $translation . "<br>\n";
+ }
+$text            = fix(urldecode($_REQUEST['text']));
+$translation     = fix(urldecode($_REQUEST['translation']));
+$text_sql        = quote_smart($text);
+$translation_sql = quote_smart(to_unicode($translation));
 
-$query = "SELECT ranking FROM map WHERE name=\"$u\" AND lang=\"$lang\" AND 
translation=\"$t\"";
+$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE " .
+         "name=\"$text_sql\" AND lang=\"$lang\" AND 
translation=\"$translation_sql\"";
 $result = mysql_query($query, $connection);
 $num = 0;
-if ($result) 
+if ($result)
   $num = mysql_numrows($result);
 if ($num > 0) {
   $row = mysql_fetch_array($result);
   $ranking = $row["ranking"] + 1;
-  $query = "UPDATE map SET ranking=\"$ranking\" WHERE name=\"$u\" AND 
lang=\"$lang\" AND translation=\"$t\"";
+  $query = "UPDATE ".$i18nHTMLsqlPrefix."map SET ranking=\"$ranking\" WHERE " .
+           "name=\"$text_sql\" AND lang=\"$lang\" AND 
translation=\"$translation_sql\"";
   mysql_query($query, $connection);
   W("Ranking of translation is now: ");
   echo "$ranking";
- } else {
-  W("Translation does not exist (bug?).");
- }
+} else {
+  W("Translation '%s' of '%s' does not exist (bug?).",
+    ARRAY($translation, $text));
+}
 ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]