[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3101 - in GNUnet-docs/WWW/freeway: . doc
From: |
mdonoughe |
Subject: |
[GNUnet-SVN] r3101 - in GNUnet-docs/WWW/freeway: . doc |
Date: |
Fri, 7 Jul 2006 18:46:10 -0700 (PDT) |
Author: mdonoughe
Date: 2006-07-07 18:45:58 -0700 (Fri, 07 Jul 2006)
New Revision: 3101
Added:
GNUnet-docs/WWW/freeway/commitMassTranslation.php
GNUnet-docs/WWW/freeway/commitTranslation.php
GNUnet-docs/WWW/freeway/contact.php
GNUnet-docs/WWW/freeway/doc/
GNUnet-docs/WWW/freeway/doc/configuration.php
GNUnet-docs/WWW/freeway/doc/index.php
GNUnet-docs/WWW/freeway/editor.php
GNUnet-docs/WWW/freeway/favicon.ico
GNUnet-docs/WWW/freeway/freeway.css
GNUnet-docs/WWW/freeway/freeway.png
GNUnet-docs/WWW/freeway/freeway.svg
GNUnet-docs/WWW/freeway/i18nhtml.inc.php
GNUnet-docs/WWW/freeway/i18nhtml_config.inc.php
GNUnet-docs/WWW/freeway/index.php
GNUnet-docs/WWW/freeway/scripts.inc.php
GNUnet-docs/WWW/freeway/status.php
GNUnet-docs/WWW/freeway/translate.php
GNUnet-docs/WWW/freeway/vote.php
Removed:
GNUnet-docs/WWW/freeway/api.css
GNUnet-docs/WWW/freeway/commitTranslation.php3
GNUnet-docs/WWW/freeway/connect.php3
GNUnet-docs/WWW/freeway/html_footer.php3
GNUnet-docs/WWW/freeway/html_header.php3
GNUnet-docs/WWW/freeway/index.php
GNUnet-docs/WWW/freeway/lang.php3
GNUnet-docs/WWW/freeway/manual.html
GNUnet-docs/WWW/freeway/menu.php3
GNUnet-docs/WWW/freeway/messages.html
GNUnet-docs/WWW/freeway/project.css
GNUnet-docs/WWW/freeway/screenshots/
GNUnet-docs/WWW/freeway/scripts.php3
GNUnet-docs/WWW/freeway/translate.php3
GNUnet-docs/WWW/freeway/vote.php3
Log:
New web site
Deleted: GNUnet-docs/WWW/freeway/api.css
===================================================================
--- GNUnet-docs/WWW/freeway/api.css 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/api.css 2006-07-08 01:45:58 UTC (rev 3101)
@@ -1,62 +0,0 @@
-/* Javadoc style sheet */
-
-/* Define colors, fonts and other style attributes here to override the
defaults */
-
-/* Page background color */
-
-body {
- color: #000000;
- background-color: #ffffff;
- font: normal normal normal 12px "Trebuchet
MS";
- }
-
-a {
- color: #42adff;
- }
-
-a:visited {
- color: #215788;
- }
-
-a:hover {
- color: #000000;
- }
-
-a:active {
- color: #000000;
- }
-
-td {
- font-size: 12px;
- }
-
-tr {
- font-size: 16px;
- }
-
-th {
- font-size: 16px;
- }
-
-/* Table colors */
-.TableHeadingColor { background: #cccccc; } /* Dark mauve */
-.TableSubHeadingColor { background: #aaaaaa; } /* Light mauve */
-.TableRowColor { background: #FFFFFF; } /* White */
-
-/* Font used in left-hand frame lists */
-.FrameTitleFont { font: normal normal normal 12px "Trebuchet MS"; }
-.FrameHeadingFont { font: normal normal normal 12px "Trebuchet MS"; }
-.FrameItemFont { font: normal normal normal 12px "Trebuchet MS"; }
-
-/* Example of smaller, sans-serif font in frames */
-/* .FrameItemFont { font: normal normal normal 12px "Trebuchet MS"; } */
-
-/* Navigation bar fonts and colors */
-.NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */
-.NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */
-.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}
-.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
-
-.NavBarCell2 { font-family: Arial, Helvetica, sans-serif;
background-color:#FFFFFF;}
-.NavBarCell3 { font-family: Arial, Helvetica, sans-serif;
background-color:#FFFFFF;}
-
Added: GNUnet-docs/WWW/freeway/commitMassTranslation.php
===================================================================
--- GNUnet-docs/WWW/freeway/commitMassTranslation.php 2006-07-07 17:04:37 UTC
(rev 3100)
+++ GNUnet-docs/WWW/freeway/commitMassTranslation.php 2006-07-08 01:45:58 UTC
(rev 3101)
@@ -0,0 +1,100 @@
+<?php
+/*
+ (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
+ 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.
+*/
+include("i18nhtml.inc.php");
+if (!$connection) {
+ echo "Database is down. Cannot edit translations.";
+ die();
+}
+if ($xlang == "English") {
+ W("Translating to English currently not allowed.\n");
+ die();
+}
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>";
+TITLE("WWW translation: commit");
+echo "</head><body>";
+W("Processing translations...");
+P();
+$done = 0;
+foreach($_POST as $dec=>$val) {
+ if ($val == "")
+ continue;
+ if ( ($dec == "xlang") || ($dec == "start") )
+ continue;
+ $val = fix($val);
+ $query = "SELECT c FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$xlang\"";
+ $result = mysql_query($query, $connection);
+ $num = 0;
+ if ($result)
+ $num = mysql_numrows($result);
+ while ($num > 0) {
+ $num--;
+ $row = mysql_fetch_array($result);
+ $cx_plain = fix($row["c"]);
+ $cx_sql = mysql_real_escape_string($cx_plain);
+ if ($dec == bin2hex(md5($cx_plain))) {
+ $enc_sql = $cx_sql;
+ break;
+ }
+ }
+ if ($num == 0) {
+ W("Did not find "%s" in pending translations, skipping.",
+ $dec);
+ P();
+ continue;
+ }
+ $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)
+ $num = mysql_numrows($result);
+ if ($num == 0) {
+ $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 "%s" = "%s".",
+ ARRAY(stripslashes($enc_sql),
+ stripslashes($val_sql)));
+ BR();
+ }
+ }
+}
+P();
+echo "<a href=\"" . $i18nHTMLbase . "editor.php?xlang=" . $lang . "&start=" .
($start - $done) . "\">";
+$t = TRANSLATE("Continue mass-editing...");
+echo "</a>";
+if ($t == 1)
+ translateLink($b);
+echo "</body></html>";
+?>
Property changes on: GNUnet-docs/WWW/freeway/commitMassTranslation.php
___________________________________________________________________
Name: svn:executable
+ *
Added: GNUnet-docs/WWW/freeway/commitTranslation.php
===================================================================
--- GNUnet-docs/WWW/freeway/commitTranslation.php 2006-07-07 17:04:37 UTC
(rev 3100)
+++ GNUnet-docs/WWW/freeway/commitTranslation.php 2006-07-08 01:45:58 UTC
(rev 3101)
@@ -0,0 +1,81 @@
+<?php
+/*
+ (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
+ 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.
+*/
+include("i18nhtml.inc.php");
+if (!$connection) {
+ echo "Database is down. Cannot edit translations.";
+ die();
+}
+if ($xlang == "English") {
+ 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));
+
+$back = $_REQUEST['back'];
+// check for identical translation
+$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)
+ $num = mysql_numrows($result);
+if ($num > 0) {
+ 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 {
+ $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 {
+ $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>";
+ }
+ }
+}
+?>
Property changes on: GNUnet-docs/WWW/freeway/commitTranslation.php
___________________________________________________________________
Name: svn:executable
+ *
Deleted: GNUnet-docs/WWW/freeway/commitTranslation.php3
===================================================================
--- GNUnet-docs/WWW/freeway/commitTranslation.php3 2006-07-07 17:04:37 UTC
(rev 3100)
+++ GNUnet-docs/WWW/freeway/commitTranslation.php3 2006-07-08 01:45:58 UTC
(rev 3101)
@@ -1,52 +0,0 @@
-<?php
-/*
- (C) 2003 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.
-*/
-include("scripts.php3");
-if (!$connection) {
- echo "<HTML><HEAD><TITLE>GNUnet WWW translation:
commit</TITLE></HEAD><BODY>";
- echo "Database is down. Can not edit translations.";
- echo "</body></html>";
- die();
-}
-if ($xlang == "English") {
- echo "<HTML><HEAD><TITLE>GNUnet WWW translation:
commit</TITLE></HEAD><BODY>";
- echo "Translating to English currently not allowed.\n";
- echo "</body></html>";
- die();
-}
-$t = urlencode(txt2html($translation));
-$query = "SELECT ranking FROM map WHERE name=\"$text\" AND lang=\"$lang\" AND
translation=\"$t\"";
-$result = mysql_query($query, $connection);
-$num = 0;
-if ($result) {
- $num = mysql_numrows($result);
-}
-if ($num > 0) {
- echo "<HTML><HEAD><TITLE>GNUnet WWW translation:
commit</TITLE></HEAD><BODY>";
- W("Translation exists.");
- extlink($back, "Back...");
- echo "</body></html>";
-} else {
- $query = "INSERT INTO map VALUES(\"$text\", \"$lang\", \"$t\", 1, \"" .
$_SERVER['REMOTE_ADDR'] . "\");";
- mysql_query($query, $connection);
- header("Location: " . $back); /* Redirect browser */
- exit; /* Make sure that code below does
- not get executed when we redirect. */
-}
-?>
Deleted: GNUnet-docs/WWW/freeway/connect.php3
===================================================================
--- GNUnet-docs/WWW/freeway/connect.php3 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/connect.php3 2006-07-08 01:45:58 UTC (rev
3101)
@@ -1,31 +0,0 @@
-<?php
-/*
- (C) 2003 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.
-*/
-/*
- Connects to the SQL-Database.
- Provides $connection.
-*/
- $connection = @mysql_connect("localhost",
- "GNUnetWWW",
- "garlic");
- if ($connection) {
- mysql_select_db("translations",
- $connection);
- }
-?>
Added: GNUnet-docs/WWW/freeway/contact.php
===================================================================
--- GNUnet-docs/WWW/freeway/contact.php 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/contact.php 2006-07-08 01:45:58 UTC (rev 3101)
@@ -0,0 +1,11 @@
+<?php
+include('scripts.inc.php');
+start('Freeway: Contact');
+
+H2('Bugtracker');
+P();
+W('Freeway uses %s.', extlink_('https://gnunet.org/mantis/', 'GNUnet\'s
bugtracking system'));
+W('Always select "freeway" as the category when reporting bugs in Freeway.');
+PE();
+stop();
+?>
\ No newline at end of file
Added: GNUnet-docs/WWW/freeway/doc/configuration.php
===================================================================
--- GNUnet-docs/WWW/freeway/doc/configuration.php 2006-07-07 17:04:37 UTC
(rev 3100)
+++ GNUnet-docs/WWW/freeway/doc/configuration.php 2006-07-08 01:45:58 UTC
(rev 3101)
@@ -0,0 +1,29 @@
+<?php
+include('../scripts.inc.php');
+start('Freeway: Documentation: Configuration');
+
+H2('Configuration');
+P();
+W('Freeway uses GNUnet\'s configuration files and should work with unmodified
GNUnet configurations.');
+W('This file documents any options that Freeway intentionally does not honor,
as well as any extra options that may Freeway use.');
+PE();
+H2('Java/Native module preference');
+P();
+W('Freeway by default will attempt to load Java modules, and only use Native
modules if the Java module does not exist or cannot be initialized.');
+W('There may be some cases in which this is not what you want because the Java
module may not be compatible with some other Native module, or the Java module
may be too old to work properly.');
+PE();
+P();
+W('You may set the order Freeway uses when loading services in the
"FREEWAY-SERVICES" section of ~/.gnunet/gnunetd.conf.');
+W('Create this section if it does not already exist.');
+PE();
+P();
+W('The name of the key(the left side) should be the beginning of the service
name in all capitals.');
+W('For example: "StatsService" becomes "STATS".');
+PE();
+P();
+W('The value can be any list of "java" and/or "c" seperated with commas and
contained in double quotes.');
+W('Capitalization and white space do not matter.');
+W('The default value is "java, c".');
+PE();
+stop();
+?>
\ No newline at end of file
Added: GNUnet-docs/WWW/freeway/doc/index.php
===================================================================
--- GNUnet-docs/WWW/freeway/doc/index.php 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/doc/index.php 2006-07-08 01:45:58 UTC (rev
3101)
@@ -0,0 +1,12 @@
+<?php
+include('../scripts.inc.php');
+start('Freeway: Documentation');
+
+H2('Documentation');
+P();
+W('The following documentation is available:');
+PE(); ?>
+<ul>
+<li><?php intlink('configuration.php', 'Configuration'); ?></li>
+</ul>
+<?php stop();?>
\ No newline at end of file
Added: GNUnet-docs/WWW/freeway/editor.php
===================================================================
--- GNUnet-docs/WWW/freeway/editor.php 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/editor.php 2006-07-08 01:45:58 UTC (rev 3101)
@@ -0,0 +1,141 @@
+<?php
+/*
+ (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
+ 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.
+*/
+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>";
+generateLanguageBar();
+if ( (! $xlang) || ($xlang == "English") ) {
+ echo "Cannot translate to English.";
+ die();
+ }
+$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.");
+$max = 10; /* apache limits! */
+$end = $start + $max;
+W("The page lists the top %s requested, untranslated sentences in the selected
language.",
+ $max);
+W("Do not copy the quotes (") from the original messages into the
translations.");
+W("Leave translations that you cannot do blank.");
+
+$query = "SELECT c FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\"
ORDER BY count DESC";
+$result = mysql_query($query, $connection);
+$num = 0;
+if ($result)
+ $num = mysql_numrows($result);
+if ($end > $num) {
+ $end = $num;
+ $start = $end - $max;
+ if ($start < 0)
+ $start = 0;
+}
+
+if ($num == 0) {
+ P();
+ W("No missing translations for the selected target language were found.");
+} else {
+ P();
+ W("%s translations to %s have been requested and were not available.",
+ ARRAY($num,
+ W_($lang)));
+ W("Displaying entries %s to %s (ordered by request frequency).",
+ ARRAY($start, $end));
+ P();
+
+ 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("Original");
+ TH("Translation");
+ echo "</tr>";
+ for ($ii=0;$ii<$end;$ii++) {
+ $row = mysql_fetch_array($result);
+ if ($ii < $start)
+ continue;
+ $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)
+ $num2 = mysql_numrows($result2);
+ echo "<tr><td width=\"45%\">";
+ echo ""$cx_plain"";
+ echo "</td>\n\t<td width\"50\%\">";
+ if ($num2 > 0) {
+ $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";
+ }
+ }
+ echo "</tr></table>";
+ 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) . "\">";
+ $t = TRANSLATE("Skip these sentences, continue with next set.");
+ echo "</a>";
+ if ($t == 1)
+ translateLink($b);
+} else {
+ W("Statistics about translation progress can be found %s.\n",
+ intlink_($i18nHTMLbase . "status.php", "here"));
+}
+P();
+H2("Remarks");
+H3("The percent sign");
+W("The %% sign is a special character.");
+W("You must use %%%% in the text to print a single percent sign.");
+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>\n";
+?>
Property changes on: GNUnet-docs/WWW/freeway/editor.php
___________________________________________________________________
Name: svn:executable
+ *
Added: GNUnet-docs/WWW/freeway/favicon.ico
===================================================================
(Binary files differ)
Property changes on: GNUnet-docs/WWW/freeway/favicon.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: GNUnet-docs/WWW/freeway/freeway.css
===================================================================
--- GNUnet-docs/WWW/freeway/freeway.css 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/freeway.css 2006-07-08 01:45:58 UTC (rev 3101)
@@ -0,0 +1,19 @@
+a {color: #8B4513; text-decoration: none;}
+a:visited {color: #665340;}
+#banner {background: #D2691E url("freeway.png") top right no-repeat; border:
10px solid #D2691E; color: #D3D3D3; font-size: 12px; height: 75px;}
+#banner a {color: #D3D3D3;}
+#banner h1 a {color: #FFFFFF;}
+body {font-family: sans-serif; margin: 0;}
+.command {background: #D3D3D3; border: 1pt solid #808080; font-family:
monospace; font-size: 10pt;}
+#copyright {background: #D3D3D3; border: 1pt solid #808080; font-family:
monospace; font-size: 8pt; margin-bottom: 1em; margin-top: 1em; padding: 1em;}
+#edit {text-align: center; font-size: 10pt;}
+h1 {color: #FFFFFF; font-size: 35px; margin: 0; padding-top: 10px;}
+h2 {background: #D2691E; border: 1pt solid #8B4513; color: #FFFFFF; display:
block; font-size: 16pt; padding: 0.1em; text-align: center;}
+hr {background: #808080; border: none; height: 1pt; width: 100%;}
+#i18nhtml {margin-top: 3em;}
+#languages {font-size: 8pt; margin: 0; padding: 0; text-align: center;}
+.navigation {width: 100%; border-collapse: collapse;}
+.navigation tr {background: #D3D3D3;}
+.navigation tr td {text-align: center;}
+.navigation tr td a {display: block; font-size: 10pt; font-weight: bold;
padding: 0.1em;}
+p {font-size: 10pt; margin: 1em;}
\ No newline at end of file
Added: GNUnet-docs/WWW/freeway/freeway.png
===================================================================
(Binary files differ)
Property changes on: GNUnet-docs/WWW/freeway/freeway.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: GNUnet-docs/WWW/freeway/freeway.svg
===================================================================
--- GNUnet-docs/WWW/freeway/freeway.svg 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/freeway.svg 2006-07-08 01:45:58 UTC (rev 3101)
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="372"
+ height="372"
+ viewBox="0 0 372 372"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44"
+ sodipodi:docname="freeway.svg"
+ sodipodi:docbase="/"
+ inkscape:export-filename="/freeway.png"
+ inkscape:export-xdpi="11.685701"
+ inkscape:export-ydpi="11.685701">
+ <metadata
+ id="metadata31">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="This is the Freeway logo from res/swing/images, but with
less of a border on the circle, no text, and the gnu has been recentered and
resized.">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="766"
+ inkscape:window-width="1022"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="1.016129"
+ inkscape:cx="186"
+ inkscape:cy="186"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:current-layer="svg2" />
+ <defs
+ id="defs4">
+ <path
+ id="gnu"
+ d="M112.993,304.372c-3.634,0.247-8.365,1.875-11.539,7.564
c-2.591,4.646-8.661,5.387-11.495,4.451c-4.721-1.56-10.755-2.642-16.6,1.523c-5.845,4.164-12.157,1.015-11.05-6.576
c1.107-7.59,3.849-14.351,11.127-18.538c15.895-9.144,4.848-15.508,13.572-24.685c8.741-9.195,6.81-12.009,6.52-24.497
c-29.543-4.438-46.287-12.953-64.984-36.313c-18.697-23.361-25.945-42.59-27.883-71.878c-1.938-29.288-0.258-48.269,12.396-72.58
s25.977-36.014,49.065-48.153C85.21,2.553,107.832-0.354,128.742,0c20.91,0.353,34.843,1.885,46.658,8.626
c11.814,6.741,22.622,15.224,29.512,15.285c6.891,0.061,11.582-1.744,14.931-4.31c0.894,22.703-19.539,24.675-37.819,25.155
c-18.281,0.479-29.514-7.083-46.351-4.27S91.269,50.961,77.84,74.336s-13.887,31.638-12.771,51.24
c1.116,19.603,17.988,34.228,27.512,34.387c9.523,0.159,11.649-2.599,19.985-8.036c8.337-5.438,50.896-58.122,65.418-69.956
c14.523-11.834,28.854-15.488,44.328-15.678c15.474-0.19,19.428,0.335,31.908,5.45c12.48,5.114,20.149,14.533,30.211,20.291
c5.143-3.027,8.338-7.547,13.057-10.996c16.877-12.335,25.646-15.659,45.705-13.707c11.529,1.122,26.066,7.708,34.74,15.25
c15.445,13.429,28.205,32.125,38.516,46.328c8.029,11.061,17.477,24.295,30.965,28.432c14.727,4.515,25.809-14.559,27.436-25.139
c0.922-5.995,2.125-11.249,2.135-17.847c0.01-6.599-0.664-14.607-2.566-21.484s-5.16-13.72-8.688-19.394
c-5.742-9.235-15.137-18.899-24.912-23.871c-5.486-2.79-18.393-7.863-26.529-8.041c-9.969-0.216-17.564,3.133-26.781,3.761
c-11.156,0.761-31.084,3.269-39.83-5.35c-5.566-5.485-6.266-9.144-7.217-16.296c2.459,2.026,5.898,3.358,8.959,3.617
c6.986,0.59,13.527-5.114,19.166-8.419c4.645-2.723,11.223-7.589,17.324-10.048c15.676-6.32,34.932-6.138,51.48-4.445
c13.264,1.356,30.461,7.257,42.094,13.84c11.688,6.612,22.951,17.761,31.201,28.271c10.379,13.224,16.053,24.57,19.812,41.063
c4.805,21.062,6.137,52.702,0.328,73.469c-4.578,16.365-19.779,41.504-32.719,53.827c-12.762,12.155-27.498,18.022-44.256,21.231
c0.656,3.382,0.764,6.536,1.631,9.309c1.232,3.936,3.588,8.324,8.428,6.936c1.93-0.553,2.963-1.032,5.508,1.194
c2.543,2.226,1.219,10.825-5.938,14.684c-3.629,1.957-7.459,2.382-13.271,2.498s-14.883,0.141-21.193-0.964
c-6.309-1.104-10.078-6.111-17.066-6.895c-10.799-1.208-19.068-9.01-27.727-14.59c-3.613-2.329-4.832-2.353-6.914-3.53
c1.125,3.444,2.625,7.021,3.373,10.332c0.75,3.311,0.43,6.378,0.828,9.028c0.396,2.648,1.131,4.707,1.559,6.855
c1.73,1.547,2.283,3.9,5.189,4.64c2.908,0.739,7.461-0.412,10.436-0.812s4.969-2.021,7.303-1.577
c2.336,0.443,4.549,2.115,6.506,3.682s3.639,1.796,5.223,5.706s3.037,11.917,3.254,17.269s-0.383,10.183-1.969,14.43
s-2.98,6.13-7.275,10.336c-4.295,4.207-11.289,10.38-18.268,14.68c1.285,1.903,1.855,3.645,3.859,5.71
c2.004,2.066,6.182,4.381,8.041,6.56c1.857,2.179,2.799,3.742,2.826,6.186c0.029,2.443-0.09,5.619-2.074,8.283
c-4.941,6.633-10.785,7.821-17.891,10.941c1.195,7.462,2.17,12.793,0.443,20.244c-0.705,3.036-2.271,9.92-6.016,11.686
c-3.746,1.766-10.969,0.911-15.541,1.637c-4.572,0.727-7.131,1.417-10.695,2.125c-2.166,3.131-5.391,6.586-6.496,9.392
c-1.107,2.807-0.773,3.813,0.156,6.679s4.092,7.039,4.988,10.395s1.07,6.969,0.234,10.334c-0.838,3.365-2.271,5.807-5.139,8.795
c-2.867,2.989-8.508,5.336-11.318,7.758c-2.812,2.423-5.611,2.714-4.844,6.723c1.055,5.506,9.1,14.436,14.92,16.562
c3.488,1.275,8.17,0.873,12.406-0.915c-0.287,4.703-4.357,7.873-7.016,10.996c7.201-2.059,14.184-6.001,19.014-11.226
c-1.498,4.538-6.652,11.823-14.361,18.22c-7.709,6.397-7.662,5.088-11.494,7.633c6.992,1.405,13.494,1.025,18.91,0.052
c-2.969,1.637-7.836,3.939-14.283,4.616c-6.447,0.676-10.422,0.198-16.232-1.213c-5.811-1.412-11.115-6.694-18.156-10.335
c0.686,2.612,1.174,5.753,4.135,8.439c2.961,2.686,7.441,4.052,12.203,6.375c-6.062-0.688-12.432-0.896-18.389-2.209
c-4.41-0.973-7.373-2.005-10.6-3.603c-3.225-1.598-5.715-3.929-8.572-5.893c1.369,2.615,1.775,5.691,4.105,7.847
s6.117,2.959,9.18,4.44c-3.195-0.07-6.268,0.623-9.58-0.21c-3.314-0.833-6.422-2.142-9.867-4.68s-6.998-5.663-9.938-8.858
c-2.938-3.195-6.566-7.337-7.664-10.283c-1.1-2.947,0.66-5.008,0.99-7.509c-2.029,1.333-4.525,2.067-6.084,4.002
s-2.941,3.702-2.251,7.075c0.691,3.373,3.804,7.496,6.005,11.248c-6.568-5.371-10.236-7.439-11.799-13.918
c-1.463-6.066,2.322-11.572,5.199-16.159c1.429-2.278,3.567-4.398,4.903-6.597c-2.967-2.903-6.358-5.398-8.901-8.709
c-2.542-3.31-3.61-7.79-6.205-10.957c-2.596-3.168-6.088-5.173-9.129-7.756c2.673,5.742,7.066,12.785,8.02,17.229
c0.953,4.444-1.069,7.164-2.646,9.563c-1.578,2.399-4.124,2.934-6.539,4.408c-2.415,1.475-6.171,0.312-7.61,2.501
c-1.438,2.188-1.824,5.48-0.449,7.648l5.64,8.902c-2.078-1.049-5.658-4.1-7.272-6.264s-4.09-4.163-4.429-7.089
c-0.339-2.925-0.504-5.464,1.391-8.07c1.896-2.605,7.086-3.477,9.409-5.48c2.323-2.003,3.626-3.307,3.493-5.896
c-0.132-2.589-2.661-4.441-4.835-6.073c-6.637-4.978-15.151-9.565-20.787-15.565c-3.184-3.39-4.712-6.127-5.352-8.466
c-0.639-2.338,0.037-4.162,1.619-7.038c1.582-2.877,7.007-6.718,7.667-9.843c0.659-3.124-2.081-3.795-4.554-4.897
s-7.17,0.565-9.464-1.352c-2.293-1.917,0.674-5.945-1.911-8.154c-2.584-2.209-8.499-0.976-11.552-3.352
c-3.053-2.377-4.315-5.327-5.367-8.775s-1.171-7.225-0.458-9.722s2.855-2.934,4.147-4.228s2.413-2.367,0.691-4.297
c-1.722-1.929-7.365,0.108-10.609-2.369c-3.244-2.477-1.258-8.41-3.552-10.911c-2.293-2.501-6.409-1.522-8.581-2.321
c-2.171-0.799-3.023,2.02-4.355-2.438c-1.332-4.459-1.368-17.75-3.16-22.71s-5.311-0.335-6.945-5.265
c-1.634-4.929-0.085-12.812-0.821-20.257l-3.335-20.257c-11.634,7.815-19.314,10.269-31.813,12.477
c-1.043,30.582-3.916,48.591,6.464,82.52c10.38,33.928,31.387,53.924,59.726,82.649c-37.395-28.016-55.248-50.792-66.422-79.97
C109.723,356.876,111.869,332.472,112.993,304.372z" />
+ <linearGradient
+ id="grad1">
+ <stop
+ offset="0"
+ style="stop-color:#ff6f00;stop-opacity:0.9059;"
+ id="stop650" />
+ <stop
+ offset="1.000000"
+ style="stop-color:#ffff00;stop-opacity:0.6235;"
+ id="stop649" />
+ </linearGradient>
+ <linearGradient
+ id="grad2"
+ xlink:href="#grad1"
+ x1="104.19894"
+ y1="8.1250016"
+ x2="104.2"
+ y2="193.51573"
+ gradientUnits="userSpaceOnUse" />
+ <path
+ id="arc"
+ d="M0,0 a150 150 0 0 0 300 0" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#grad1"
+ id="linearGradient1921"
+ gradientUnits="userSpaceOnUse"
+ x1="104.19894"
+ y1="8.1250016"
+ x2="104.2"
+ y2="193.51573" />
+ </defs>
+ <circle
+ sodipodi:ry="100"
+ sodipodi:rx="100"
+ sodipodi:cy="100"
+ sodipodi:cx="100"
+
style="fill:url(#linearGradient1921);stroke:#510000;stroke-width:5.88235283;stroke-miterlimit:4;stroke-dasharray:none"
+ id="circle18"
+ r="100"
+ cy="100"
+ cx="100"
+ transform="matrix(1.795601,0,0,1.795601,5.439909,5.439909)"
+ mask="none"
+ clip-path="none" />
+ <use
+ height="372"
+ width="372"
+ y="0"
+ x="0"
+ id="use22"
+ transform="matrix(0.507832,0,0,0.507832,49.24338,52.27634)"
+ style="fill:black;stroke:none"
+ xlink:href="#gnu" />
+</svg>
Deleted: GNUnet-docs/WWW/freeway/html_footer.php3
===================================================================
--- GNUnet-docs/WWW/freeway/html_footer.php3 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/html_footer.php3 2006-07-08 01:45:58 UTC (rev
3101)
@@ -1,46 +0,0 @@
-<?php
-P();
-HR();
-if ($menu != "NO")
- include("menu.php3");
-HR();
-?>
-<pre>Copyright (C) 2002, 2003, 2004 Christian Grothoff.
-Verbatim copying and distribution of this entire article
-is permitted in any medium, provided this notice is preserved.
-</pre>
-<TABLE CLASS=plain STYLE="background-color:#FEFEFE;color:#000000;" BORDER=0
BGCOLOR=WHITE WIDTH="99%">
-<TR CLASS=plain>
-<TD CLASS=plain
STYLE="background-color:#FEFEFE;color:#000000;">Internationalization interface
(C) 2003 Christian Grothoff.</TD>
-<TD CLASS=plain STYLE="background-color:#FEFEFE;color:#000000;" ROWSPAN=2
VALIGN=MIDDLE ALIGN=RIGHT>
-<?php
-$back = "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] .
$HTTP_SERVER_VARS["REQUEST_URI"];
-echo "<small>";
-if ( ($xlang) && ($xlang != "English") ) {
- if ($editor != 1)
- echo " <A HREF=\"$back&editor=1\">" . W_("enter editor mode") . "</A>";
- else
- W(" Editor Mode Active (for this page only)");
- echo "</small>";
- }
-?>
-</TD>
-</TR>
-<TR>
-<TD CLASS=plain STYLE="background-color:#FEFEFE;color:#000000">PHP code is
available under GPL (see GNUnet-docs CVS).</TD>
-</TR>
-</TABLE>
-<?php
-if ($haveNBO) {
- HR();
- P();
- H2("Footnotes");
- ANCHOR("NBO");H3("NBO - network byte order");
- W("Fields of this type are in network byte order.");
- W("Before reading these fields, they must be converted to host byte order
using <tt>htons</tt> for 2-byte values and <tt>htonl</tt> for 4-byte values.");
- W("Before writing to these fields, the value must be converted using
<tt>ntohs</tt> and <tt>ntohl</tt> respectively.");
- P();
-}
-?>
-</BODY>
-</HTML>
Deleted: GNUnet-docs/WWW/freeway/html_header.php3
===================================================================
--- GNUnet-docs/WWW/freeway/html_header.php3 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/html_header.php3 2006-07-08 01:45:58 UTC (rev
3101)
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<HTML lang="en">
-<HEAD>
-<?php
- $haveNBO = 0;
- if ($title)
- echo "<title>";
- TRANSLATE($title);
- echo "</title>";
- if ($description)
- echo "<meta name=\"description\" content=\"";
- TRANSLATE($description);
- echo "\">";
-?>
-<meta name="author" content="Christian Grothoff">
-<meta name="keywords"
content="GNUnet,distributed,anonymous,p2p,sharing,accounting,accountability,denyability,backup,freenet,file,decentralized,free,GNU,Linux,GPL">
-<meta name="robots" content="index,follow">
-<meta name="revisit-after" content="28 days">
-<?php
- echo "<meta name=\"content-language\" content=\"$lang\">";
- echo "<meta name=\"language\" content=\"$lang\">";
-?>
-<meta name="publisher" content="Christian Grothoff">
-<meta name="date" content="2003-06-14">
-<?php
-if ($author)
- echo "<meta name=\"rights\" content=\"(C) 2001,2002,2003 by $author\">";
-else
- echo "<meta name=\"rights\" content=\"(C) 2001,2002,2003 by Christian
Grothoff\">";
-?>
-<meta http-equiv="expires" content="43200">
-<meta http-equiv="content-type" content="text/html;CHARSET=iso-8859-1">
-<meta http-equiv="Content-Style-Type" content="text/css">
-<link rel=stylesheet type="text/css"
HREF="http://www.ovmj.org/GNUnet/gnunet.css">
-</HEAD>
-<BODY>
-<?php
- if ($menu != "NO") {
- include("menu.php3");
- include("lang.php3");
- }
-?>
Added: GNUnet-docs/WWW/freeway/i18nhtml.inc.php
===================================================================
--- GNUnet-docs/WWW/freeway/i18nhtml.inc.php 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/i18nhtml.inc.php 2006-07-08 01:45:58 UTC (rev
3101)
@@ -0,0 +1,894 @@
+<?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("’", ">", """, "′", "&", "\"",
"'", "`", "‘");
+$htmlout = array("’", ">", """ , "′", "&", """,
"'", "’", "‘");
+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
+ . "&text=" . urlencode(fix($a))
+ . "&back=" . urlencode($back)
+ . "\" title=\""
+ .fix($a)
+ ."\">" . $i18nHTMLmarker . "</a>";
+ } 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(
+ ' ' => ' ', // non-breaking space
+ '¡' => '¡', // inverted exclamation mark
+ '¢' => '¢', // cent sign
+ '£' => '£', // pound sign
+ '¤' => '¤', // currency sign
+ '¥' => '¥', // yen sign
+ '¦' => '¦', // broken bar
+ '§' => '§', // section sign
+ '¨' => '¨', // diaeresis
+ '©' => '©', // copyright sign
+ 'ª' => 'ª', // feminine ordinal indicator
+ '«' => '«', // left-pointing double angle
quotation mark
+ '¬' => '¬', // not sign
+ '­' => '­', // soft hyphen
+ '®' => '®', // registered sign
+ '¯' => '¯', // macron
+ '°' => '°', // degree sign
+ '±' => '±', // plus-minus sign
+ '²' => '²', // superscript two
+ '³' => '³', // superscript three
+ '´' => '´', // acute accent
+ 'µ' => 'µ', // micro sign
+ '¶' => '¶', // pilcrow sign
+ '·' => '·', // middle dot
+ '¸' => '¸', // cedilla
+ '¹' => '¹', // superscript one
+ 'º' => 'º', // masculine ordinal indicator
+ '»' => '»', // right-pointing double angle
quotation mark
+ '¼' => '¼', // vulgar fraction one quarter
+ '½' => '½', // vulgar fraction one half
+ '¾' => '¾', // vulgar fraction three
quarters
+ '¿' => '¿', // inverted question mark
+ 'À' => 'À', // latin capital letter A with
grave
+ 'Á' => 'Á', // latin capital letter A with
acute
+ 'Â' => 'Â', // latin capital letter A with
circumflex
+ 'Ã' => 'Ã', // latin capital letter A with
tilde
+ 'Ä' => 'Ä', // latin capital letter A with
diaeresis
+ 'Å' => 'Å', // latin capital letter A with
ring above
+ 'Æ' => 'Æ', // latin capital letter AE
+ 'Ç' => 'Ç', // latin capital letter C with
cedilla
+ 'È' => 'È', // latin capital letter E with
grave
+ 'É' => 'É', // latin capital letter E with
acute
+ 'Ê' => 'Ê', // latin capital letter E with
circumflex
+ 'Ë' => 'Ë', // latin capital letter E with
diaeresis
+ 'Ì' => 'Ì', // latin capital letter I with
grave
+ 'Í' => 'Í', // latin capital letter I with
acute
+ 'Î' => 'Î', // latin capital letter I with
circumflex
+ 'Ï' => 'Ï', // latin capital letter I with
diaeresis
+ 'Ð' => 'Ð', // latin capital letter
ETH
+ 'Ñ' => 'Ñ', // latin capital letter N with
tilde
+ 'Ò' => 'Ò', // latin capital letter O with
grave
+ 'Ó' => 'Ó', // latin capital letter O with
acute
+ 'Ô' => 'Ô', // latin capital letter O with
circumflex
+ 'Õ' => 'Õ', // latin capital letter O with
tilde
+ 'Ö' => 'Ö', // latin capital letter O with
diaeresis
+ '×' => '×', // multiplication sign
+ 'Ø' => 'Ø', // latin capital letter O with
stroke
+ 'Ù' => 'Ù', // latin capital letter U with
grave
+ 'Ú' => 'Ú', // latin capital letter U with
acute
+ 'Û' => 'Û', // latin capital letter U with
circumflex
+ 'Ü' => 'Ü', // latin capital letter U with
diaeresis
+ 'Ý' => 'Ý', // latin capital letter Y with
acute
+ 'Þ' => 'Þ', // latin capital letter THORN
+ 'ß' => 'ß', // latin small letter sharp s
+ 'à' => 'à', // latin small letter a with
grave
+ 'á' => 'á', // latin small letter a with
acute
+ 'â' => 'â', // latin small letter a with
circumflex
+ 'ã' => 'ã', // latin small letter a with
tilde
+ 'ä' => 'ä', // latin small letter a with
diaeresis
+ 'å' => 'å', // latin small letter a with
ring above
+ 'æ' => 'æ', // latin small letter ae
+ 'ç' => 'ç', // latin small letter c with
cedilla
+ 'è' => 'è', // latin small letter e with
grave
+ 'é' => 'é', // latin small letter e with
acute
+ 'ê' => 'ê', // latin small letter e with
circumflex
+ 'ë' => 'ë', // latin small letter e with
diaeresis
+ 'ì' => 'ì', // latin small letter i with
grave
+ 'í' => 'í', // latin small letter i with
acute
+ 'î' => 'î', // latin small letter i with
circumflex
+ 'ï' => 'ï', // latin small letter i with
diaeresis
+ 'ð' => 'ð', // latin small letter
eth
+ 'ñ' => 'ñ', // latin small letter n with
tilde
+ 'ò' => 'ò', // latin small letter o with
grave
+ 'ó' => 'ó', // latin small letter o with
acute
+ 'ô' => 'ô', // latin small letter o with
circumflex
+ 'õ' => 'õ', // latin small letter o with
tilde
+ 'ö' => 'ö', // latin small letter o with
diaeresis
+ '÷' => '÷', // division sign
+ 'ø' => 'ø', // latin small letter o with
stroke
+ 'ù' => 'ù', // latin small letter u with
grave
+ 'ú' => 'ú', // latin small letter u with
acute
+ 'û' => 'û', // latin small letter u with
circumflex
+ 'ü' => 'ü', // latin small letter u with
diaeresis
+ 'ý' => 'ý', // latin small letter y with
acute
+ 'þ' => 'þ', // latin small letter thorn
+ 'ÿ' => 'ÿ', //
+ 'Œ' => 'Œ', // latin capital ligature OE
+ 'œ' => 'œ', // latin small ligature oe
+ 'Š' => 'Š', // latin capital letter S with
caron
+ 'š' => 'š', // latin small letter s with
caron
+ 'Ÿ' => 'Ÿ', // latin capital letter Y with
diaeresis
+ 'ƒ' => 'ƒ' , // latin small f with hook
+ 'ˆ' => 'ˆ', // modifier letter circumflex
accent
+ '˜' => '˜', // small tilde
+ 'Α' => 'Α', // greek capital letter alpha
+ 'Β' => 'Β', // greek capital letter beta
+ 'Γ' => 'Γ', // greek capital letter gamma
+ 'Δ' => 'Δ', // greek capital letter delta
+ 'Ε' => 'Ε', // greek capital letter epsilon
+ 'Ζ' => 'Ζ', // greek capital letter zeta
+ 'Η' => 'Η', // greek capital letter
eta
+ 'Θ' => 'Θ', // greek capital letter theta
+ 'Ι' => 'Ι', // greek capital letter iota
+ 'Κ' => 'Κ', // greek capital letter kappa
+ 'Λ' => 'Λ', // greek capital letter lambda
+ 'Μ' => 'Μ', // greek capital letter
mu
+ 'Ν' => 'Ν', // greek capital letter
nu
+ 'Ξ' => 'Ξ', // greek capital letter
xi
+ 'Ο' => 'Ο', // greek capital letter omicron
+ 'Π' => 'Π', // greek capital letter
pi
+ 'Ρ' => 'Ρ', // greek capital letter
rho
+ 'Σ' => 'Σ', // greek capital letter sigma
+ 'Τ' => 'Τ', // greek capital letter
tau
+ 'Υ' => 'Υ', // greek capital letter upsilon
+ 'Φ' => 'Φ', // greek capital letter
phi
+ 'Χ' => 'Χ', // greek capital letter
chi
+ 'Ψ' => 'Ψ', // greek capital letter
psi
+ 'Ω' => 'Ω', // greek capital letter omega
+ 'α' => 'α', // greek small letter alpha
+ 'β' => 'β', // greek small letter beta
+ 'γ' => 'γ', // greek small letter gamma
+ 'δ' => 'δ', // greek small letter delta
+ 'ε' => 'ε', // greek small letter epsilon
+ 'ζ' => 'ζ', // greek small letter zeta
+ 'η' => 'η', // greek small letter
eta
+ 'θ' => 'θ', // greek small letter theta
+ 'ι' => 'ι', // greek small letter iota
+ 'κ' => 'κ', // greek small letter kappa
+ 'λ' => 'λ', // greek small letter lambda
+ 'μ' => 'μ', // greek small letter mu
+ 'ν' => 'ν', // greek small letter nu
+ 'ξ' => 'ξ', // greek small letter xi
+ 'ο' => 'ο', // greek small letter omicron
+ 'π' => 'π', // greek small letter pi
+ 'ρ' => 'ρ', // greek small letter
rho
+ 'ς' => 'ς', // greek small letter final
sigma
+ 'σ' => 'σ', // greek small letter sigma
+ 'τ' => 'τ', // greek small letter
tau
+ 'υ' => 'υ', // greek small letter upsilon
+ 'φ' => 'φ', // greek small letter
phi
+ 'χ' => 'χ', // greek small letter
chi
+ 'ψ' => 'ψ', // greek small letter
psi
+ 'ω' => 'ω', // greek small letter omega
+ 'ϑ' => 'ϑ', // greek small letter
theta symbol
+ 'ϒ' => 'ϒ', // greek upsilon with hook
symbol
+ 'ϖ' => 'ϖ', // greek pi symbol
+ ' ' => ' ', // en space
+ ' ' => ' ', // em space
+ ' ' => ' ', // thin space
+ '‌' => '‌', // zero width non-joiner
+ '‍' => '‍', // zero width joiner
+ '‎' => '‎', // left-to-right mark
+ '‏' => '‏', // right-to-left mark
+ '–' => '–', // en dash
+ '—' => '—', // em dash
+ '‘' => '‘', // left single quotation mark
+ '’' => '’', // right single quotation mark
+ '‚' => '‚', // single low-9 quotation mark
+ '“' => '“', // left double quotation mark
+ '”' => '”', // right double quotation mark
+ '„' => '„', // double low-9 quotation mark
+ '†' => '†', // dagger
+ '‡' => '‡', // double dagger
+ '•' => '•', // bullet
+ '…' => '…', // horizontal ellipsis
+ '‰' => '‰', // per mille sign
+ '′' => '′', // primeminutes
+ '″' => '″', // double prime
+ '‹' => '‹', // single left-pointing angle
quotation mark
+ '›' => '›', // single right-pointing angle
quotation mark
+ '‾' => '‾', // overline
+ '⁄' => '⁄', // fraction slash
+ '€' => '€', // euro sign
+ 'ℑ' => 'ℑ', // blackletter capital I
+ '℘' => '℘', // script capital P
+ 'ℜ' => 'ℜ', // blackletter capital R
+ '™' => '™', // trade mark sign
+ 'ℵ' => 'ℵ', // alef symbol
+ '←' => '←', // leftwards arrow
+ '↑' => '↑', // upwards arrow
+ '→' => '→', // rightwards arrow
+ '↓' => '↓', // downwards arrow
+ '↔' => '↔', // left right arrow
+ '↵' => '↵', // downwards arrow with corner
leftwards
+ '⇐' => '⇐', // leftwards double arrow
+ '⇑' => '⇑', // upwards double arrow
+ '⇒' => '⇒', // rightwards double arrow
+ '⇓' => '⇓', // downwards double arrow
+ '⇔' => '⇔', // left right double arrow
+ '∀' => '∀', // for all
+ '∂' => '∂', // partial differential
+ '∃' => '∃', // there exists
+ '∅' => '∅', // empty set
+ '∇' => '∇', // nabla
+ '∈' => '∈', // element of
+ '∉' => '∉', // not an element of
+ '∋' => '∋', // contains as member
+ '∏' => '∏', // n-ary product
+ '∑' => '∑', // n-ary sumation
+ '−' => '−', // minus sign
+ '∗' => '∗', // asterisk operator
+ '√' => '√', // square root
+ '∝' => '∝', // proportional to
+ '∞' => '∞', // infinity
+ '∠' => '∠', // angle
+ '∧' => '∧', // logical and
+ '∨' => '∨', // logical or
+ '∩' => '∩', // intersection
+ '∪' => '∪', // union
+ '∫' => '∫', // integral
+ '∴' => '∴', // therefore
+ '∼' => '∼', // tilde operator
+ '≅' => '≅', // approximately equal to
+ '≈' => '≈', // almost equal to
+ '≠' => '≠', // not equal to
+ '≡' => '≡', // identical to
+ '≤' => '≤', // less-than or equal to
+ '≥' => '≥', // greater-than or
equal to
+ '⊂' => '⊂', // subset of
+ '⊃' => '⊃', // superset of
+ '⊄' => '⊄', // not a subset of
+ '⊆' => '⊆', // subset of or equal to
+ '⊇' => '⊇', // superset of or equal to
+ '⊕' => '⊕', // circled plus
+ '⊗' => '⊗', // circled times
+ '⊥' => '⊥', // up tack
+ '⋅' => '⋅', // dot operator
+ '⌈' => '⌈', // left ceiling
+ '⌉' => '⌉', // right ceiling
+ '⌊' => '⌊', // left floor
+ '⌋' => '⌋', // right floor
+ '〈' => '⟨', // left-pointing angle bracket
+ '〉' => '⟩', // right-pointing angle bracket
+ '◊' => '◊', // lozenge
+ '♠' => '♠', // black spade suit
+ '♣' => '♣', // black club suit
+ '♥' => '♥', // black heart suit
+ '♦' => '♦' // 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, &#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 -> €
+ } 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 XHTML() {
+ global $lang;
+ global $languagecodes;
+ echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ DOCTYPE('XHTML1.1');
+ echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' .
$languagecodes[$lang] . "\">\n";
+}
+
+function TITLE($a,$b="") {
+ global $lang;
+ global $languagecodes;
+ echo "<meta http-equiv=\"Content-Type\"
content=\"text/html;charset=utf-8\"/>\n";
+ echo "<title>" . TRANSLATE_($a,$b) . "</title>\n";
+ if (isset($languagecodes[$lang])) {
+ echo "<meta name=\"content-language\" content=\"" .
+ $languagecodes[$lang] . "\"/>\n";
+ echo "<meta name=\"language\" content=\"" .
+ $languagecodes[$lang] . "\"/>\n";
+ }
+}
+
+// displays a list of all languages currently available with
+// at least 1 translated string.
+function generateLanguageBar() {
+ global $connection, $i18nHTMLsqlPrefix;
+
+ if ($connection) {
+ echo '<div id="languages">[';
+ $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") . "</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 "]</div>";
+ }
+}
+
+
+// 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('id="i18nhtml"');
+ W('Translation engine based on %s (C) 2003, 2004, 2005 %s.',
array(intlink_('http://gnunet.org/i18nHTML/', 'i18nHTML'),
extlink_('http://grothoff.org/christian/', 'Christian Grothoff')));
+ PE();
+ if ( ($xlang) && ($xlang != "English") ) {
+ P('id=edit');
+ $back = "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] .
$HTTP_SERVER_VARS["REQUEST_URI"];
+ if ($editor != 1)
+ echo " <a href=\"$back&editor=1\">" . W_("enter translation mode") .
"</a>";
+ else
+ W("Translation Mode Active (for this page only)");
+ PE();
+ }
+}
+
+
+
+// *************************************************
+// 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 id="' . str_replace('"', '\"', str_replace(' ', '', $a)) . '">' .
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 PE($attr="") {
+ echo "</p>\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
Property changes on: GNUnet-docs/WWW/freeway/i18nhtml.inc.php
___________________________________________________________________
Name: svn:executable
+ *
Added: GNUnet-docs/WWW/freeway/i18nhtml_config.inc.php
===================================================================
--- GNUnet-docs/WWW/freeway/i18nhtml_config.inc.php 2006-07-07 17:04:37 UTC
(rev 3100)
+++ GNUnet-docs/WWW/freeway/i18nhtml_config.inc.php 2006-07-08 01:45:58 UTC
(rev 3101)
@@ -0,0 +1,42 @@
+<?php
+/*
+ (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
+ 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 = "translation"; // 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
+
+
+// Note that if you enable debug, the scripts may print
+// warnings even if everything is ok!
+$i18nHTMLdebug = 1; // 0 = no, 1 = yes
+
+?>
Property changes on: GNUnet-docs/WWW/freeway/i18nhtml_config.inc.php
___________________________________________________________________
Name: svn:executable
+ *
Deleted: GNUnet-docs/WWW/freeway/index.php
===================================================================
--- GNUnet-docs/WWW/freeway/index.php 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/index.php 2006-07-08 01:45:58 UTC (rev 3101)
@@ -1,57 +0,0 @@
-<?php
-include("scripts.php3");
-$title = "Freeway: GNUnet for Java";
-$description="Freeway is a port of GNUnet to Java";
-include("html_header.php3");
-
-H2("Freeway");
-
-W("Freeway is a port of %s to Java.",
- intlink_("../index", "GNUnet"));
-W("Freeway is licensed under the %s.",
- extlink_("http://www.gnu.org/copyleft/gpl.html", "GNU GPL"));
-P();
-W("You can access the current development code using the <tt>freeway</tt> CVS
repository as described %s.",
- intlink_("../download", "here"));
-W("No official release has been made at this point.");
-
-H2("Features and Requirements");
-
-W("The code uses NIO for input-output operations (peer-to-peer, client-server)
and thus requires JDK 1.4.");
-W("%s is used for compiling the code.",
- extlink_("http://ant.apache.org", "ant"));
-W("The two tools above are not included in CVS and must be obtained
separately.");
-P();
-W("Furthermore, the code depends on a few libraries of which binaries are
included in CVS.");
-W("Freeway uses the %s library for cryptographic operations.",
- extlink_("http://www.cryptix.org", "cryptix"));
-W("Doug Lea′s %s is used for concurrency control.",
-
extlink_("http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html",
"util.concurrent"));
-
-H2("Pending work");
-W("The project is still under early development.");
-W("So far the following problems are known:");
-echo "<ul><li>";
-W("certain TCP connections are blocking where they must not be, occasionally
stalling the system (buffers in Handler and Core are full)");
-echo "</li><li>";
-W("various functions in the Swing UI are not implemented");
-echo "</li><li>";
-W("some transports have not been ported");
-echo "</li><li>";
-W("some applications (protocols) have not been ported");
-echo "</li></ul>";
-
-H2("Resources");
-echo "<ul><li>";
-W("%s of the code",
- extlink_("api/index.html", "JavaDoc"));
-echo "</li><li>";
-W("description of the %s",
- extlink_("messages.html", "protocol"));
-echo "</li><li>";
-W("%s",
- extlink_("screenshots/", "screenshots"));
-echo "</li></ul>";
-
-include("html_footer.php3");
-?>
Added: GNUnet-docs/WWW/freeway/index.php
===================================================================
--- GNUnet-docs/WWW/freeway/index.php 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/index.php 2006-07-08 01:45:58 UTC (rev 3101)
@@ -0,0 +1,33 @@
+<?php
+include('scripts.inc.php');
+start('Freeway');
+
+H2('Requirements');
+P();
+W('Freeway requires an installed copy of GNUnet in order to use the native
modules.');
+W('Currently, Freeway will not work unless GNUnet has been installed.');
+W('You can obtain GNUnet from the %s.', intlink_('http://gnunet.org/', 'GNUnet
website'));
+PE();
+P();
+W('The Freeway build scripts use Sh, Autotools, Make, Ant, and Jikes.');
+W('You will also need a working C toolchain and Java runtime environment.');
+PE();
+H2('Getting Freeway');
+P();
+W('There are no official releases available.');
+W('The latest developer code can be checked out of the %s.',
extlink_('https://gnunet.org/svn/freeway/', 'SVN repository'));
+PE();
+H2('Compiling');
+P();
+W('To generate the build scripts, run %s.', '<span class="command">sh
bootstrap</span>');
+W('Then run %s.', '<span class="command">sh configure</span>');
+W('If configure doesn\'t find GNUnet, you may need to use %s.', '<span
class="command">sh configure --with-gnunet=<path to GNUnet></span>');
+W('Finally, build Freeway and its native components by running %s.', '<span
class="command">sh build.sh</span>');
+PE();
+H2('Running Freeway');
+P();
+W('After Freeway has been compiled, it can be run using %s.', '<span
class="command">sh etc/gnunetd.sh</span>');
+W('Note: recent versions of Freeway probably only support the native %s
application.', '<span class="command">gnunet-stats</span>');
+W('See also: %s', intlink_('doc/configuration.php',
'documentation/configuration'));
+stop();
+?>
\ No newline at end of file
Deleted: GNUnet-docs/WWW/freeway/lang.php3
===================================================================
--- GNUnet-docs/WWW/freeway/lang.php3 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/lang.php3 2006-07-08 01:45:58 UTC (rev 3101)
@@ -1,44 +0,0 @@
-<?php
-/*
- (C) 2003 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.
-*/
- if ($connection) {
- echo "<center>[";
- $query = "SELECT lang FROM map ORDER BY lang";
- $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);
- echo "</A>";
- $last = $next;
- }
- echo "]</center>";
- }
-?>
Deleted: GNUnet-docs/WWW/freeway/manual.html
===================================================================
--- GNUnet-docs/WWW/freeway/manual.html 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/manual.html 2006-07-08 01:45:58 UTC (rev 3101)
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Freeway : GNUNet pour Java</title>
-<link href="project.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-<div class='page'>
-
-<h1>Commandes en ligne</h1>
-
-<iframe width='100%' height='500px' src='man-pages.xml'></iframe>
-
-</div>
-</body>
-</html>
Deleted: GNUnet-docs/WWW/freeway/menu.php3
===================================================================
--- GNUnet-docs/WWW/freeway/menu.php3 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/menu.php3 2006-07-08 01:45:58 UTC (rev 3101)
@@ -1,13 +0,0 @@
-<!-- CENTER>
-<TABLE BORDER=0 RULES=NONE WIDTH="90%">
- <TR>
- <TH><?php intlink("index","Welcome") ?></TH>
- <TH><?php intlink("mailinglist","Contact"); ?></TH>
- <TH><?php intlink("faq","FAQ"); ?></TH>
- <TH><?php intlink("download","Download"); ?></TH>
- <TH><?php intlink("documentation","Documentation"); ?></TH>
- <TH><?php intlink("papers","Papers"); ?></TH>
- <TH><?php intlink("links","Links"); ?></TH>
- </TR>
-</TABLE>
-</CENTER -->
Deleted: GNUnet-docs/WWW/freeway/messages.html
===================================================================
--- GNUnet-docs/WWW/freeway/messages.html 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/messages.html 2006-07-08 01:45:58 UTC (rev
3101)
@@ -1,209 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Format des messages</title>
-<link href="project.css" rel="stylesheet" type="text/css">
-</head>
-
-<style>
-span.constant {
- color: #00aa00;
- }
-
-h2 {
- color: #000000;
- background-color: #cccccc;
- text-align: center;
- padding: 2px;
- margin: 5px 0px 5px 0px;
- }
-
-h3 {
- text-align: left;
- text-decoration: underline;
- }
-</style>
-
-<body>
-<div class='page'>
-
-<h2>Messages</h2>
-
-<pre>
-<u><b>P2PHello</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be >= <span class='constant'>556</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>0</span></i>
-+4 256 <a href=''>Signature</a> <b>signature</b> : <i>the
signature</i>
-+260 264 <a href=''>PublicKey</a> <b>publicKey</b> : <i>the
public key</i>
-+524 20 <a href=''>HostIdentity</a> <b>senderIdentity</b> : <i>whose
identity follows ? No, this is NOT a duplicate as a node may send us the
identity of ANOTHER node !</i>
-+544 4 int <b>expirationTime</b> : <i>time this address
expires</i>
-+548 2 short <b>senderAddressSize</b> : <i>size of the sender
address</i>
-+550 2 short <b>protocol</b> : <i>protocol supported
by the node (only one protocol can be advertised by the same HELO). Examples
are UDP, TCP, etc.</i>
-+552 4 int <b>MTU</b> : <i>advertised MTU for
sending (replies can have a different MTU !)</i>
-+556 * byte[] <b>senderAddress</b> : <i>address of the node
in a protocol specific format</i>
-
-<u><b>P2PSessionKey</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be <span class='constant'>520</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>1</span></i>
-+4 4 int <b>creationTime</b> : <i>time when this key
was created</i>
-+8 256 <a href=''>EncryptedData</a> <b>encryptedKey</b> : <i>the
encrypted session key</i>
-+264 256 <a href=''>Signature</a> <b>signature</b> :
<i>signature of the stuff above</i>
-+520
-
-<u><b>P2PPing</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be <span class='constant'>28</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>2</span></i>
-+4 20 <a href=''>HostIdentity</a> <b>receiver</b> : <i>which
peer is the target of the ping ?</i>
-+24 4 int <b>challenge</b> : <i>the challenge is a
(pseudo) random number that an adversary that wants to fake a pong message
would have to guess</i>
-+28
-
-<u><b>P2PPong</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be <span class='constant'>28</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>3</span></i>
-+4 20 <a href=''>HostIdentity</a> <b>receiver</b> : <i>which
peer is the target of the pong ?</i>
-+24 4 int <b>challenge</b> : <i>the challenge is a
(pseudo) random number that an adversary that wants to fake a pong message
would have to guess</i>
-+28
-
-<u><b>P2PTimeStamp</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be <span class='constant'>8</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>4</span></i>
-+4 4 int <b>timeStamp</b> : <i>time stamp (in
seconds after 01/01/1970)</i>
-+8
-
-<u><b>P2PSequence</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be <span class='constant'>8</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>5</span></i>
-+4 4 int <b>number</b> : <i>sequence number</i>
-+8
-
-<u><b>P2PNoise</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be >= <span class='constant'>4</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>6</span></i>
-+4 * byte[] <b>noise</b> : <i>random bytes</i>
-
-<u><b>P2PHangUp</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be <span class='constant'>24</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>7</span></i>
-+4 20 <a href=''>HostIdentity</a> <b>sender</b> : <i></i>
-+24
-
-<u><b>P2PCapability</b></u>
-+0 2 short <b>size</b> : <i>size of the message
(must be <span class='constant'>12</span>)</i>
-+2 2 short <b>requestType</b> : <i>type of the request,
is <span class='constant'>8</span></i>
-+4 4 int <b>capabilityType</b> : <i>capability type</i>
-+8 4 int <b>value</b> : <i>capability value</i>
-+12
-
-<u><b>Signature</b></u>
-+0 256 byte[] <b>data</b> : <i>signature of RSA
encrypted data length (2048 bit) bytes</i>
-+256
-
-<u><b>EncryptedData</b></u>
-+0 256 byte[] <b>data</b> : <i></i>
-+256
-
-<u><b>PublicKey</b></u>
-+0 2 short <b>length</b> : <i>size of the
structure - 2 (must be <span class='constant'>262</span>)</i>
-+2 2 short <b>sizeN</b> : <i>size of the modulus
N</i>
-+4 258 byte[] <b>key</b> : <i>the modulus N,
followed by the exponent E</i>
-+262 2 short <b>padding</b> : <i>padding (must be
<span class='constant'>0</span>)</i>
-+264
-
-<u><b>PrivateKey</b></u>
-+0 2 short <b>length</b> : <i>size of the
structure - 2</i>
-+2 2 short <b>sizeN</b> : <i></i>
-+4 2 short <b>sizeE</b> : <i></i>
-+6 2 short <b>sizeD</b> : <i></i>
-+8 2 short <b>sizeP</b> : <i></i>
-+10 2 short <b>sizeQ</b> : <i></i>
-+12 2 short <b>sizeDMPL</b> : <i></i>
-+14 2 short <b>sizeDMQL</b> : <i></i>
-+16 * byte[] <b>key</b> : <i></i>
-
-<u><b>HostIdentity</b></u> <i>the identity of the host</i>
-+0 20 <a href=''>HashCode160</a> <b>hash</b> : <i>the
RIPE160 hashcode of host's public key</i>
-+20
-
-<u><b>HashCode160</b></u> <i>a 160-bit hashcode</i>
-+0 4 int <b>a</b> : <i>A field</i>
-+4 4 int <b>b</b> : <i>B field</i>
-+8 4 int <b>c</b> : <i>C field</i>
-+12 4 int <b>d</b> : <i>D field</i>
-+16 4 int <b>e</b> : <i>E field</i>
-+20
-
-<u><b>TCPMessagePack</b></u> <i>TCP message packet</i>
-+0 2 short <b>size</b> : <i>size of the
message</i>
-+2 2 short <b>isEncrypted</b> : <i></i>
-+4 4 int <b>checkSum</b> : <i>CRC checksum of the
packet</i>
-+8 * byte[] <b>parts</b> : <i>filled with messages
until size if reached (there is no "end of message")</i>
-
-<u><b>SBlock</b></u>
-+0 2 short <b>major_formatVersion</b> : <i></i>
-+2 2 short <b>minor_formatVersion</b> : <i></i>
-+4 48 <a href=''>FileIdentifier</a> <b>fileIdentifier</b> : <i></i>
-+52 256 byte[] <b>description</b> : <i></i>
-+308 64 byte[] <b>filename</b> : <i></i>
-+372 64 byte[] <b>mimetype</b> : <i></i>
-+436 4 int <b>creationTime</b> : <i></i>
-+440 4 int <b>updateInterval</b> : <i></i>
-+444 20 <a href=''>HashCode160</a> <b>nextIdentifier</b> : <i></i>
-+464 20 <a href=''>HashCode160</a> <b>identifierIncrement</b> : <i></i>
-+484 20 <a href=''>HashCode160</a> <b>identifier</b> : <i></i>
-+504 256 <a href=''>Signature</a> <b>signature</b> : <i></i>
-+760 264 <a href=''>PublicKey</a> <b>subspace</b> : <i></i>
-+1024
-
-<u><b>FileIdentifier</b></u>
-+0 4 int <b>file_length</b> : <i>total size of the
file in bytes</i>
-+4 4 int <b>crc</b> : <i>top CRC of the
tree-encoding</i>
-+8 40 <a href=''>CHK_Hashes</a> <b>chk</b> : <i>query
and key of the top IBlock</i>
-+48
-
-<u><b>CHK_Hashes</b></u>
-+0 20 <a href=''>HashCode160</a> <b>key</b> : <i>the
hash of the plaintext is the key to decrypt</i>
-+20 20 <a href=''>HashCode160</a> <b>query</b> : <i>the
hash of the encrypted block is the query</i>
-+40
-
-
-<u><b>ContentIndex</b></u>
-+0 20 <a href=''>HashCode160</a> <b>hash</b> : <i>the
double-hash of this entry for 3HASH entries, or the CHK query hash for CHK
entries</i>
-+20 4 int <b>importance</b> : <i>the current rating
of this content</i>
-+24 2 short <b>type</b> : <i>the type of the
entry</i>
-+26 2 short <b>fileNameIndex</b> : <i>the index of the
file into the file-index module if the value is >0. If the value is 0, the
file is in the contentdatabase</i>
-+28 4 int <b>fileOffset</b> : <i>the offset in the
file for on-demand-encoded files where fileNameIndex is >0</i>
-+32
-
-</pre>
-
-<h2>Remarques</h2>
-
-<h3>Size in bytes</h3>
-<pre>
-byte : 1
-short : 2
-int : 4
-long : 8
-</pre>
-
-
-<h3>Network Byte Order (NBO) : most significant byte first (as in "big-endian"
storage)</h3>
-<pre>
-
- octet 0 octet 1
- +-----------------------+-----------------+
- short : | 15 14 13 12 11 10 9 8 | 7 6 5 4 3 2 1 0 |
- +-----------------------+-----------------+
-
- octet 0 octet 1 octet 2
octet 3
-
+-------------------------+-------------------------+-----------------------+-----------------+
- int : | 31 30 29 28 27 26 25 24 | 23 22 21 20 19 18 17 16 | 15 14 13 12 11
10 9 8 | 7 6 5 4 3 2 1 0 |
-
+-------------------------+-------------------------+-----------------------+-----------------+
-</pre>
-
-<h3>Maximum Transfer Unit (MTU)</h3>
-
-</div>
-</body>
-</html>
Deleted: GNUnet-docs/WWW/freeway/project.css
===================================================================
--- GNUnet-docs/WWW/freeway/project.css 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/project.css 2006-07-08 01:45:58 UTC (rev 3101)
@@ -1,48 +0,0 @@
-/* Feuille de style Freeway. */
-
-body {
- color: #000000;
- background-color: #ffffff;
- font: normal normal normal 13px "Trebuchet
MS";
- padding: 0px;
- margin: 0px;
- }
-
-
-div.title {
- background-color: #aaaaaa;
- font: italic normal normal 18px "Trebuchet
MS";
- text-align: center;
- padding: 5px;
- margin: 0px;
- }
-
-div.menu {
- background-color: #cccccc;
- font: italic normal normal 11px "Trebuchet
MS";
- padding: 0px 3px 0px 3px;
- }
-
-div.page {
- padding: 13px;
- margin: 10px 0px 0px 0px;
- }
-
-a {
- color: #42adff;
- }
-
-a:visited {
- color: #215788;
- }
-
-a:hover {
- color: #000000;
- }
-
-a:active {
- color: #000000;
- }
-
-
-
Added: GNUnet-docs/WWW/freeway/scripts.inc.php
===================================================================
--- GNUnet-docs/WWW/freeway/scripts.inc.php 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/scripts.inc.php 2006-07-08 01:45:58 UTC (rev
3101)
@@ -0,0 +1,51 @@
+<?php
+include('i18nhtml.inc.php');
+$mypath = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']),
strrpos(__FILE__, '/') - strlen($_SERVER['DOCUMENT_ROOT']));
+
+function start($title = 'Freeway') {
+global $mypath;
+XHTML();?>
+<head>
+<?php TITLE($title); ?>
+<link rel="stylesheet" type="text/css" href="<?php echo $mypath
?>/freeway.css"/>
+<link rel="icon" type="image/x-icon" href="<?php echo $mypath ?>/favicon.ico"/>
+<link rel="shortcut icon" type="image/x-icon" href="<?php echo $mypath
?>/favicon.ico"/>
+</head>
+<body>
+<div id="banner">
+<h1><a href="http://gnunet.org/freeway/">Freeway</a></h1>
+<?php W('%s in Java', intlink_('http://gnunet.org/', 'GNUnet'))?>
+</div>
+<?php
+navigation();
+generateLanguageBar();
+}
+
+function navigation() {
+global $mypath;?>
+<table class="navigation">
+<tr>
+<td><?php intlink($mypath . '/index.php', 'Welcome'); ?></td>
+<td><?php intlink($mypath . '/contact.php', 'Contact'); ?></td>
+<?php /* ?><td><?php intlink($mypath . '/community.php', 'Community'); ?></td>
+<td><?php intlink($mypath . '/faq.php', 'FAQ'); ?></td>
+<td><?php intlink($mypath . '/download.php', 'Download'); ?></td><?php */ ?>
+<td><?php intlink($mypath . '/doc/index.php', 'Documentation'); ?></td>
+<?php /* ?><td><?php intlink($mypath . '/papers.php', 'Papers'); ?></td>
+<td><?php intlink($mypath . '/links.php', 'Links'); ?></td><?php */ ?>
+</tr>
+</table><?php
+}
+
+function stop() {?>
+<hr/>
+<?php navigation(); ?>
+<hr/>
+<div id="copyright">Copyright (C) 2006<br/>
+Verbatim copying and distribution of this entire article<br/>
+is permitted in any medium, provided this notice is preserved.</div>
+<?php generateFooter(); ?>
+</body>
+</html><?php
+}
+?>
\ No newline at end of file
Deleted: GNUnet-docs/WWW/freeway/scripts.php3
===================================================================
--- GNUnet-docs/WWW/freeway/scripts.php3 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/scripts.php3 2006-07-08 01:45:58 UTC (rev
3101)
@@ -1,523 +0,0 @@
-<?php
-/*
- (C) 2003 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.
-*/
- // Internationalization script. The code uses a MySQL database
- // to map an english sentence to a sentence in the target language.
- //
- // 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 PHP files that use it and compare with
- // the generated pages.
-
- // The main files of the I18N code are:
- // scripts.php3, connect.php3, translate.php3, commitTranslation.php3 and
vote.php3
-
- // MySQL database connection code.
- include("connect.php3");
-
- // If no language is specified, use english.
- if ( (! $lang) || ($lang=="") )
- $lang = "English";
- if ($xlang)
- $lang = $xlang;
- $lang = ucfirst(strtolower($lang));
-
- /* Function that converts special ascii character to html
- */
- function txt2html($text)
- {
-
- $arr= array(
- 128 =>"€" , "", "‚",
- "ƒ", "„", "…",
- "†", "‡", "ˆ",
- "‰", "Š", "‹",
- "Œ", "", "Ž",
- "", "", "‘",
- "’", "“", "”",
- "•", "–", "—",
- "˜", "™", "š",
- "›", "œ", "",
- "ž", "Ÿ", " ",
- "¡", "¢", "£",
- "¤", "¥", "¦",
- "§", "¨", "©",
- "ª", "«", "¬",
- "­", "®", "¯",
- "°", "±", "²",
- "³", "´", "µ",
- "¶", "·", "¸",
- "¹", "º", "»",
- "¼", "½", "¾",
- "¿", "À", "Á",
- "Â", "Ã", "Ä",
- "Å", "Æ", "Ç",
- "È", "É", "Ê",
- "Ë", "Ì", "Í",
- "Î", "Ï", "Ð",
- "Ñ", "Ò", "Ó",
- "Ô", "Õ", "Ö",
- "×", "Ø", "Ù",
- "Ú", "Û", "Ü",
- "Ý", "Þ", "ß",
- "à", "á", "â",
- "ã", "ä", "å",
- "æ", "ç", "è",
- "é", "ê", "ë",
- "ì", "í", "î",
- "ï", "ð", "ñ",
- "ò", "ó", "ô",
- "õ", "ö", "÷",
- "ø", "ù", "ú",
- "û", "ü", "ý",
- "þ", "ÿ"
- );
-
- $res="";
-
- for ($i=0;$i<strlen($text);$i++)
- {
- if (ord($text{$i})==92 && ord($text{$i+1})==39)
- {
- $res=$res."’";
- $i++;
- }
- else if (ord($text{$i})==92 && ord($text{$i+1})==34)
- {
- $res=$res.""";
- $i++;
- }
- else if (ord($text{$i})==92 && ord($text{$i+1})==92)
- {
- $res=$res.chr(92);
- $i++;
- }
- else if (isset($arr[ord($text{$i})]))
- $res=$res.$arr[ord($text{$i})];
- else
- $res=$res.$text{$i};
- }
-
- return $res;
- }
-
-
- // create a link to the translation maintainer
- // page
- function translateLink($a) {
- global $lang;
- global $HTTP_SERVER_VARS;
- global $edit;
-
- if ($edit != "off") {
- $back = "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] .
$HTTP_SERVER_VARS["REQUEST_URI"];
- echo "<A HREF=\"translate.php3?xlang="
- . $lang
- . "&text=" . rawurlencode($a)
- . "&back=" . urlencode($back)
- . "\">*</A>\n";
- }
- }
-
- // create a link to the translation maintainer
- // page
- function translateLink_($a) {
- global $lang;
- global $edit;
- global $HTTP_SERVER_VARS;
-
- if ($edit == "off")
- return "";
- $back = "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] .
$HTTP_SERVER_VARS["REQUEST_URI"];
- return "<A HREF=\"translate.php3?xlang="
- . $lang
- . "&text=" . rawurlencode($a)
- . "&back=" . urlencode($back)
- . "\">*</A>\n";
- }
-
- // return 1 if translation is available (or DB down)
- function isTranslated($a) {
- global $connection;
- global $lang;
- global $editor;
- if ("English" == $lang) {
- // no need to translate english, that's the
- // hard-wired source language!
- return 1;
- }
- if (!$connection) {
- // database not available, just print english
- return 1;
- }
- $u = urlencode($a);
- $query = "SELECT translation FROM map WHERE name=\"$u\" AND lang=\"$lang\"
ORDER BY ranking DESC";
- $result = mysql_query($query, $connection);
- $num = 0;
- if ($result)
- $num = mysql_numrows($result);
- if ($num > 0)
- return 1;
- else
- return 0;
- }
-
- // translate the sentence $a and output the
- // result. Returns 1 if a translate link was created.
- function W($a, $args=NULL) {
- global $connection;
- global $lang;
- global $editor;
-
- if ("English" == $lang) {
- // no need to translate english, that's the
- // hard-wired source language!
- echo vsprintf("$a\n",$args);
- return 0;
- }
- if (!$connection) {
- // database not available, just print english
- echo vsprintf("$a\n",$args);
- return 0;
- }
- $u = urlencode($a);
- $query = "SELECT translation FROM map WHERE name=\"$u\" AND lang=\"$lang\"
ORDER BY ranking DESC";
- $result = mysql_query($query, $connection);
- $num = 0;
- if ($result)
- $num = mysql_numrows($result);
- if (0 == $num) {
- echo vsprintf("$a", $args);
- translateLink($a);
- echo "\n";
- return 1;
- } else {
- $row = mysql_fetch_array($result);
- echo vsprintf(urldecode($row["translation"]), $args);
- if ($editor)
- translateLink($a);
- echo "\n";
- return 0;
- }
- }
-
- // translate the sentence $a and output the
- // result. Returns 1 if a translate link was created.
- function W_($a,$args=null) {
- global $connection;
- global $lang;
- global $editor;
-
- if ("English" == $lang) {
- // no need to translate english, that's the
- // hard-wired source language!
- return vsprintf("$a", $args);
- }
- if (!$connection) {
- // database not available, just print english
- return vsprintf("$a", $args);
- }
- $u = urlencode($a);
- $query = "SELECT translation FROM map WHERE name=\"$u\" AND lang=\"$lang\"
ORDER BY ranking DESC";
- $result = mysql_query($query, $connection);
- $num = 0;
- if ($result)
- $num = mysql_numrows($result);
- if (0 == $num) {
- return vsprintf("$a", $args) . translateLink_($a);
- } else {
- $row = mysql_fetch_array($result);
- if ($editor)
- return vsprintf(urldecode($row["translation"]),$args) .
translateLink_($a);
- else
- return vsprintf(urldecode($row["translation"]),$args);
- }
- }
-
- // translate the sentence $a and output the
- // result, but never produce full HTML.
- // Returns 1 if a translate link should be
- // created (never creates one by itself).
- function TRANSLATE($a,$args=null) {
- global $connection;
- global $lang;
- global $editor;
-
- if ("English" == $lang) {
- // no need to translate english, that's the
- // hard-wired source language!
- echo vsprintf($a,$args);
- return 0;
- }
- if (!$connection) {
- // database not available, just print english
- echo vsprintf($a,$args);
- return 0;
- }
- $u = urlencode($a);
- $query = "SELECT translation FROM map WHERE name=\"$u\" AND lang=\"$lang\"
ORDER BY ranking DESC";
- $result = mysql_query($query, $connection);
- $num = 0;
- if ($result)
- $num = mysql_numrows($result);
- if (0 == $num) {
- echo vsprintf($a,$args);
- return 1;
- } else {
- $row = mysql_fetch_array($result);
- echo vsprintf(urldecode($row["translation"]),$args);
- if ($editor)
- return 1;
- else
- return 0;
- }
- }
-
- // translate the sentence $a and output the
- // result, but never produce full HTML.
- // Returns 1 if a translate link should be
- // created (never creates one by itself).
- function TRANSLATE_($a,$args=null) {
- global $connection;
- global $lang;
- global $editor;
-
- if ("English" == $lang) {
- // no need to translate english, that's the
- // hard-wired source language!
- return vsprintf($a,$args);
- }
- if (!$connection) {
- // database not available, just print english
- return vsprintf($a,$args);
- }
- $u = urlencode($a);
- $query = "SELECT translation FROM map WHERE name=\"$u\" AND lang=\"$lang\"
ORDER BY ranking DESC";
- $result = mysql_query($query, $connection);
- $num = 0;
- if ($result)
- $num = mysql_numrows($result);
- if (0 == $num) {
- return vsprintf($a,$args);
- } else {
- $row = mysql_fetch_array($result);
- return vsprintf(urldecode($row["translation"]),$args);
- }
- }
- function LI($a,$b="") {
- echo "<LI>";
- W($a,$b);
- echo "</LI>\n";
- }
- function LIV($a) {
- echo "<LI>" . $a . "</LI>\n";
- }
- function DT($a,$b="") {
- echo "<DT>";
- W($a,$b);
- echo "</DT>\n";
- }
- function H1($a) {
- echo "<H1>";
- W($a);
- echo "</H1>\n";
- }
- function H2($a) {
- echo "<H2>";
- W($a);
- echo "</H2>\n";
- }
- function H3($a) {
- echo "<H3>";
- W($a);
- echo "</H3>\n";
- }
- function H4($a) {
- echo "<H4>";
- W($a);
- echo "</H4>\n";
- }
- function H5($a) {
- echo "<H5>";
- W($a);
- echo "</H5>\n";
- }
-
- // create internationalized, internal link to
- // $a.php3 with description $b
- function intlink($a, $b) {
- global $lang;
- echo "<A HREF=\"" . $a . ".php3?xlang=" . $lang . "\">";
- $t = TRANSLATE($b);
- echo "</A>";
- if ($t == 1)
- translateLink($b);
- }
-
- // create internationalized, internal link to
- // $a.php3 with description $b
- function intlink_($a, $b) {
- global $lang;
- global $editor;
-
- $ret = "<A HREF=\"" . $a . ".php3?xlang=" . $lang . "\">" . TRANSLATE_($b)
. "</A>";
- if ( ($editor == 1) || (isTranslated($b) == 0) )
- $ret = $ret . translateLink_($b);
- return $ret;
- }
-
- // create internationalized, external link to
- // $a with description $b
- function extlink($a, $b) {
- echo "<A HREF=\"" . $a . "\">";
- $t = TRANSLATE($b);
- echo "</A>";
- if ($t == 1)
- translateLink($b);
- }
-
- // create internationalized, external link to
- // $a with description $b
- function extlink_($a, $b) {
- global $editor;
-
- $ret = "<A HREF=\"" . $a . "\">" . TRANSLATE_($b) . "</A>";
- if ( ($editor == 1) || (isTranslated($b) == 0) )
- return $ret . translateLink_($b);
- else
- return $ret;
- }
-
- function P() {
- echo "<P>\n";
- }
-
- function BR() {
- echo "<BR>\n";
- }
-
- function HR() {
- echo "<HR>\n";
- }
-
- function PRE($a) {
- echo "<PRE>" . $a . "</PRE>";
- }
-
- function IMG($src, $alt, $align="CENTER", $width, $height, $border=0,
$hspace=0, $vspace=0) {
- global $editor;
-
- if ($align == "CENTER")
- echo "<P><CENTER>\n";
- echo "<IMG SRC=\""
- . $src . "\" ALT=\"";
- TRANSLATE($alt);
- echo "\" ALIGN=\"" . $align . "\" WIDTH=$width HEIGHT=$height
BORDER=$border HSPACE=$hspace VSPACE=$vspace>\n";
- if ( ($editor == 1) || (isTranslated($alt) == 0) )
- translatelink($alt);
- if ($align == "CENTER")
- echo "</CENTER><P>\n";
- }
-
- function IMG_($src, $alt, $align="CENTER", $width, $height, $border=0,
$hspace=0, $vspace=0) {
- global $editor;
- $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";
- if ( ($editor == 1) || (isTranslated($alt) == 0) )
- $ret = $ret . translatelink($alt);
- if ($align == "CENTER")
- $ret = $ret . "</CENTER><P>\n";
- return $ret;
- }
-
- function ANCHOR($a) {
- echo "<A NAME=\"$a\"></A>";
- }
-
-// GNUnet specific scripts
-
- function afslogo() {
- img("afs_small.png", "Anonymous file sharing logo", "RIGHT", 150, 115);
- }
- function gnunetlogo() {
- img("gnu_in_net.png", "GNUnet logo", "RIGHT", 149, 150);
- }
-
- function shortEntry_($a, $b="") {
- return "<td align=center>" . W_($a) . $b . "</td>";
- }
- function shortEntryVerbatim_($a, $b="") {
- return "<td align=center>" . $a . $b . "</td>";
- }
- function row($a, $b) {
- echo "<tr>" . $a . $b . "</tr>\n";
- }
- function rowIntEntry($a, $b="") {
- echo "<tr><td align=center colspan=2>" . W_($a) . $b . "</td></tr>\n";
- }
- function rowIntEntryNBO($a) {
- rowIntEntry($a, NBO_());
- }
- function fiveRowIntEntries($a) {
- for ($i=0;$i<5;$i++)
- rowIntEntry($a);
- }
- function rowIntEntryVerbatim($a, $b="") {
- echo "<tr><td align=center colspan=2>" . $a . $b . "</td></tr>\n";
- }
- function rowSizeType($size, $type) {
- row(shortEntryVerbatim_($size . " (" . W_("size") . ")", NBO_()),
- shortEntryVerbatim_($type . " (" . W_("type") . ")", NBO_()));
- }
-
- function NBO() {
- global $haveNBO;
-
- $haveNBO = 1;
- echo "(<A HREF=\"#NBO\">NBO</A>)";
- }
- function NBO_() {
- global $haveNBO;
- $haveNBO = 1;
- return "(<A HREF=\"#NBO\">NBO</A>)";
- }
-//H2("Footnotes");
-//ANCHOR("nbo");H3("NBO - network byte order");
-/*Fields of this type are in network byte order.");
- W("Before reading these
- fields, they must be converted to host byte order using <tt>htons</tt>
- for 2-byte values and <tt>htonl</tt> for 4-byte values.");
- W("Before writing
- to these fields, the value must be converted using <tt>ntohs</tt> and
- <tt>ntohl</tt> respectively.");
-*/
-
-?>
Added: GNUnet-docs/WWW/freeway/status.php
===================================================================
--- GNUnet-docs/WWW/freeway/status.php 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/status.php 2006-07-08 01:45:58 UTC (rev 3101)
@@ -0,0 +1,93 @@
+<?php
+/*
+ (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
+ 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 can be used to obtain some statistics
+ // about the progress of the translation.
+ // It has no other purpose.
+
+include("i18nhtml.inc.php");
+if (!$connection) {
+ echo "Database is down.";
+ die();
+ }
+$mode = $_REQUEST['mode'];
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>\n";
+TITLE("Translation: status");
+echo "</head><body>";
+W("Language setting is %s.",
+ $lang);
+P();
+$query = "SELECT count FROM ".$i18nHTMLsqlPrefix."pending WHERE
lang=\"English\"";
+$result = mysql_query($query, $connection);
+$num = 0;
+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 ".$i18nHTMLsqlPrefix."map";
+$result = mysql_query($query, $connection);
+$num = 0;
+if ($result)
+ $num = mysql_numrows($result);
+for ($i=0;$i<$num;$i++) {
+ $row = mysql_fetch_array($result);
+ $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",
+ $text,
+ $row["lang"],
+ urlencode($row["lang"]),
+ urlencode($text),
+ urlencode($translation),
+ $translation,
+ $ranking);
+ }
+}
+if ($mode == 1) {
+ echo "</table>";
+ P();
+ HR();
+ P();
+}
+W("%s translated sentences in database.", $num);
+P();
+foreach ($stats as $a => $b) {
+ W("%s translations available in %s.", ARRAY($b, $a));
+ BR();
+}
+generateFooter();
+echo "</body></html>";
+?>
\ No newline at end of file
Property changes on: GNUnet-docs/WWW/freeway/status.php
___________________________________________________________________
Name: svn:executable
+ *
Added: GNUnet-docs/WWW/freeway/translate.php
===================================================================
--- GNUnet-docs/WWW/freeway/translate.php 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/translate.php 2006-07-08 01:45:58 UTC (rev
3101)
@@ -0,0 +1,96 @@
+<?php
+/*
+ (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
+ 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.
+*/
+include("i18nhtml.inc.php");
+if (!$connection) {
+ echo "Database is down. Cannot edit translations.";
+ die();
+}
+$text = fix($_REQUEST['text']);
+$text_sql = quote_smart($text);
+$text_url = urlencode($text);
+$back = $_REQUEST['back'];
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>\n";
+TITLE("WWW translation");
+echo "<meta name=\"description\" content=\"";
+TRANSLATE("Help translating this webpage.");
+echo "\">";
+echo "</head><body>";
+if ($lang == "English") {
+ echo "Cannot translate to English.";
+ die();
+ }
+H2("Original Text");
+echo $text;
+H2("Translation");
+W("Destination language: ");
+W($lang);
+P();
+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";
+W("Translated text:");
+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");
+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.");
+W("You must use %%%% in the text to print a single percent sign.");
+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>";
+?>
Property changes on: GNUnet-docs/WWW/freeway/translate.php
___________________________________________________________________
Name: svn:executable
+ *
Deleted: GNUnet-docs/WWW/freeway/translate.php3
===================================================================
--- GNUnet-docs/WWW/freeway/translate.php3 2006-07-07 17:04:37 UTC (rev
3100)
+++ GNUnet-docs/WWW/freeway/translate.php3 2006-07-08 01:45:58 UTC (rev
3101)
@@ -1,97 +0,0 @@
-<?php
-include("scripts.php3");
-if (!$connection) {
- echo "Database is down. Can not edit translations. Please notify
address@hidden";
- die();
-}
-if ($xlang == "Italien") {
- echo "You must use the english word to describe the language. Try Italian.";
- die();
-}
-$title = "GNUnet WWW translation";
-$description = "Help translating the GNUnet webpage.";
-$menu = "NO";
-include("html_header.php3");
-
-/*
- (C) 2003 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.
-*/
-
-H2("Original Text");
-echo $text;
-H2("Translation");
-W("Destination language: ");
-W($lang);
-P();
-?>
-<FORM ACTION="commitTranslation.php3">
-<?php
-echo "<INPUT TYPE=HIDDEN NAME=\"text\" VALUE=\"" . urlencode($text) . "\">";
-echo "<INPUT TYPE=HIDDEN NAME=\"xlang\" VALUE=\"$xlang\">";
-echo "<INPUT TYPE=HIDDEN NAME=\"back\" VALUE=\"$back\">";
-?>
-<INPUT SIZE="80" MAXLENGTH="65535" NAME="translation">
-<INPUT TYPE=SUBMIT VALUE="I hereby give this translation into the Public
Domain (commit)">
-</FORM>
-<?php
-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_numrows($result);
- for ($i=0;$i<$num;$i++) {
- $row = mysql_fetch_array($result);
-
- printf("<TR><TD>%s</TD><TD><A
HREF=\"vote.php3?xlang=%s&text=%s&translation=%s\">%s</A></TD></TR>\n",
- W_($row["lang"]),
- urlencode($row["lang"]),
- urlencode($text),
- $row["translation"],
- urldecode($row["translation"]));
- }
-echo "</TABLE>";
-
-H2("Remarks");
-H3("The percent sign");
-W("The %% sign is a special character.");
-W("You must use %%%% in the text to print a single percent sign.");
-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.");
-
-include("html_footer.php3");
-?>
\ No newline at end of file
Added: GNUnet-docs/WWW/freeway/vote.php
===================================================================
--- GNUnet-docs/WWW/freeway/vote.php 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/vote.php 2006-07-08 01:45:58 UTC (rev 3101)
@@ -0,0 +1,55 @@
+<?php
+/*
+ (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
+ 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 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 = 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 ".$i18nHTMLsqlPrefix."map WHERE " .
+ "name=\"$text_sql\" AND lang=\"$lang\" AND
translation=\"$translation_sql\"";
+$result = mysql_query($query, $connection);
+$num = 0;
+if ($result)
+ $num = mysql_numrows($result);
+if ($num > 0) {
+ $row = mysql_fetch_array($result);
+ $ranking = $row["ranking"] + 1;
+ $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 '%s' of '%s' does not exist (bug?).",
+ ARRAY($translation, $text));
+}
+?>
Property changes on: GNUnet-docs/WWW/freeway/vote.php
___________________________________________________________________
Name: svn:executable
+ *
Deleted: GNUnet-docs/WWW/freeway/vote.php3
===================================================================
--- GNUnet-docs/WWW/freeway/vote.php3 2006-07-07 17:04:37 UTC (rev 3100)
+++ GNUnet-docs/WWW/freeway/vote.php3 2006-07-08 01:45:58 UTC (rev 3101)
@@ -1,47 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>GNUnet WWW translation: vote</TITLE>
-</HEAD>
-<BODY>
-<?php
-/*
- (C) 2003 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.
-*/
- include("scripts.php3");
- if (!$connection) {
- echo "Database is down. Can not edit translations.";
- die();
- }
- $u = urlencode($text);
- $t = urlencode($translation);
- $query = "SELECT ranking FROM map WHERE name=\"$u\" AND lang=\"$lang\" AND
translation=\"$t\"";
- $result = mysql_query($query, $connection);
- $num = 0;
- 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\"";
- mysql_query($query, $connection);
- W("Ranking of translation is now: ");
- echo "$ranking";
- } else {
- W("Translation does not exist (bug?).");
- }
-?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3101 - in GNUnet-docs/WWW/freeway: . doc,
mdonoughe <=