[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r594 - GNUnet-docs/WWW/gnu.org
From: |
grothoff |
Subject: |
[GNUnet-SVN] r594 - GNUnet-docs/WWW/gnu.org |
Date: |
Mon, 4 Apr 2005 00:19:19 -0700 (PDT) |
Author: grothoff
Date: 2005-04-04 00:19:16 -0700 (Mon, 04 Apr 2005)
New Revision: 594
Removed:
GNUnet-docs/WWW/gnu.org/commitTranslation.php3
GNUnet-docs/WWW/gnu.org/connect.php3
GNUnet-docs/WWW/gnu.org/html_footer.php3
GNUnet-docs/WWW/gnu.org/html_header.php3
GNUnet-docs/WWW/gnu.org/lang.php3
GNUnet-docs/WWW/gnu.org/scripts.php3
GNUnet-docs/WWW/gnu.org/translate.php3
GNUnet-docs/WWW/gnu.org/vote.php3
Modified:
GNUnet-docs/WWW/gnu.org/gnunet.php
GNUnet-docs/WWW/gnu.org/requirements.html
Log:
update
Deleted: GNUnet-docs/WWW/gnu.org/commitTranslation.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/commitTranslation.php3 2005-04-04 07:12:56 UTC
(rev 593)
+++ GNUnet-docs/WWW/gnu.org/commitTranslation.php3 2005-04-04 07:19:16 UTC
(rev 594)
@@ -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/gnu.org/connect.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/connect.php3 2005-04-04 07:12:56 UTC (rev
593)
+++ GNUnet-docs/WWW/gnu.org/connect.php3 2005-04-04 07:19:16 UTC (rev
594)
@@ -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);
- }
-?>
Modified: GNUnet-docs/WWW/gnu.org/gnunet.php
===================================================================
--- GNUnet-docs/WWW/gnu.org/gnunet.php 2005-04-04 07:12:56 UTC (rev 593)
+++ GNUnet-docs/WWW/gnu.org/gnunet.php 2005-04-04 07:19:16 UTC (rev 594)
@@ -1,10 +1,9 @@
<?php
-include("scripts.php3");
+include("i18nhtml.inc");
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>\n";
+TITLE("GNUnet - GNU Project - Free Software Foundation (FSF)");
?>
-<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<HTML>
-<HEAD>
-<TITLE>GNUnet - GNU Project - Free Software Foundation (FSF)</TITLE>
<LINK REV="made" HREF="mailto:address@hidden">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#1F00FF" ALINK="#FF0000"
VLINK="#9900DD">
Deleted: GNUnet-docs/WWW/gnu.org/html_footer.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/html_footer.php3 2005-04-04 07:12:56 UTC (rev
593)
+++ GNUnet-docs/WWW/gnu.org/html_footer.php3 2005-04-04 07:19:16 UTC (rev
594)
@@ -1,32 +0,0 @@
-<?php
-P();
-HR();
-if ($menu != "NO")
- include("menu.php3");
-HR();
-?>
-<pre>Copyright (C) 2002, 2003 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 ($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>
-</BODY>
-</HTML>
Deleted: GNUnet-docs/WWW/gnu.org/html_header.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/html_header.php3 2005-04-04 07:12:56 UTC (rev
593)
+++ GNUnet-docs/WWW/gnu.org/html_header.php3 2005-04-04 07:19:16 UTC (rev
594)
@@ -1,36 +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
- if ($title)
- TITLE($title);
- else
- TITLE("GNUnet");
- 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">
-<meta name="publisher" content="Christian Grothoff">
-<meta name="date" content="2004-09-18">
-<?php
-if ($author)
- echo "<meta name=\"rights\" content=\"(C) 2001,2002,2003,2004,2005 by
$author\">";
-else
- echo "<meta name=\"rights\" content=\"(C) 2001,2002,2003,2004,2005 by
Christian Grothoff\">";
-?>
-<meta http-equiv="expires" content="43200">
-<meta http-equiv="Content-Style-Type" content="text/css">
-</HEAD>
-<BODY>
-<?php
- if ($menu != "NO") {
- include("menu.php3");
- include("lang.php3");
- }
-?>
Deleted: GNUnet-docs/WWW/gnu.org/lang.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/lang.php3 2005-04-04 07:12:56 UTC (rev 593)
+++ GNUnet-docs/WWW/gnu.org/lang.php3 2005-04-04 07:19:16 UTC (rev 594)
@@ -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>";
- }
-?>
Modified: GNUnet-docs/WWW/gnu.org/requirements.html
===================================================================
--- GNUnet-docs/WWW/gnu.org/requirements.html 2005-04-04 07:12:56 UTC (rev
593)
+++ GNUnet-docs/WWW/gnu.org/requirements.html 2005-04-04 07:19:16 UTC (rev
594)
@@ -6,5 +6,5 @@
<li><a href="http://www.gnu.org/software/gmp/">GNU MP Bignum Library</a>
(>= 4.0.0)</li>
<li><a href="http://www.gnu.org/directory/security/libgcrypt.html">libgcrypt
(>= 1.2.0)</a></li>
<li><a href="http://www.gtk.org/">gtk+</A> (>= 2.4)</li>
- <li><a href="http://www.ovmj.org/libextractor/">libextractor</a> (>=
0.4.1)</li>
+ <li><a href="http://www.gnu.org/software/libextractor/">libextractor</a>
(>= 0.4.2)</li>
</ul>
Deleted: GNUnet-docs/WWW/gnu.org/scripts.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/scripts.php3 2005-04-04 07:12:56 UTC (rev
593)
+++ GNUnet-docs/WWW/gnu.org/scripts.php3 2005-04-04 07:19:16 UTC (rev
594)
@@ -1,554 +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");
-$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");
-
- $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";
- 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\n", $args);
- }
- if (!$connection) {
- // database not available, just print english
- return vsprintf("$a\n", $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) . "\n";
- } else {
- $row = mysql_fetch_array($result);
- if ($editor)
- return vsprintf(urldecode($row["translation"]),$args) .
translateLink_($a) . "\n";
- else
- return vsprintf(urldecode($row["translation"]),$args) . "\n";
- }
- }
-
- // 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", "GNUnet logo", "RIGHT", 150, 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() {
- echo "(NBO)"; // fixme: make link
- }
- function NBO_() {
- return "(NBO)"; // fixme: make link
- }
-//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.");
-*/
-
-?>
Deleted: GNUnet-docs/WWW/gnu.org/translate.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/translate.php3 2005-04-04 07:12:56 UTC (rev
593)
+++ GNUnet-docs/WWW/gnu.org/translate.php3 2005-04-04 07:19:16 UTC (rev
594)
@@ -1,93 +0,0 @@
-<?php
-include("scripts.php3");
-if (!$connection) {
- echo "Database is down. Can not edit translations. Please notify
address@hidden";
- 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
Deleted: GNUnet-docs/WWW/gnu.org/vote.php3
===================================================================
--- GNUnet-docs/WWW/gnu.org/vote.php3 2005-04-04 07:12:56 UTC (rev 593)
+++ GNUnet-docs/WWW/gnu.org/vote.php3 2005-04-04 07:19:16 UTC (rev 594)
@@ -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] r594 - GNUnet-docs/WWW/gnu.org,
grothoff <=