[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4760 - Extractor-docs/WWW/gnu.org
From: |
gnunet |
Subject: |
[GNUnet-SVN] r4760 - Extractor-docs/WWW/gnu.org |
Date: |
Wed, 18 Apr 2007 18:04:54 -0600 (MDT) |
Author: grothoff
Date: 2007-04-18 18:04:54 -0600 (Wed, 18 Apr 2007)
New Revision: 4760
Removed:
Extractor-docs/WWW/gnu.org/commitMassTranslation.php
Extractor-docs/WWW/gnu.org/commitTranslation.php
Extractor-docs/WWW/gnu.org/editor.php
Extractor-docs/WWW/gnu.org/status.php
Extractor-docs/WWW/gnu.org/translate.php
Extractor-docs/WWW/gnu.org/update.php
Extractor-docs/WWW/gnu.org/vote.php
Log:
del
Deleted: Extractor-docs/WWW/gnu.org/commitMassTranslation.php
===================================================================
--- Extractor-docs/WWW/gnu.org/commitMassTranslation.php 2007-04-19
00:04:39 UTC (rev 4759)
+++ Extractor-docs/WWW/gnu.org/commitMassTranslation.php 2007-04-19
00:04:54 UTC (rev 4760)
@@ -1,100 +0,0 @@
-<?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");
-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 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 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 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 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>";
-?>
Deleted: Extractor-docs/WWW/gnu.org/commitTranslation.php
===================================================================
--- Extractor-docs/WWW/gnu.org/commitTranslation.php 2007-04-19 00:04:39 UTC
(rev 4759)
+++ Extractor-docs/WWW/gnu.org/commitTranslation.php 2007-04-19 00:04:54 UTC
(rev 4760)
@@ -1,81 +0,0 @@
-<?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");
-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 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.",
- 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 map VALUES(\"$text_sql\", \"$lang\", " .
- "\"$translation_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
- $result = mysql_query($query, $connection);
- if ($result) {
- $query = "DELETE FROM 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>";
- }
- }
-}
-?>
\ No newline at end of file
Deleted: Extractor-docs/WWW/gnu.org/editor.php
===================================================================
--- Extractor-docs/WWW/gnu.org/editor.php 2007-04-19 00:04:39 UTC (rev
4759)
+++ Extractor-docs/WWW/gnu.org/editor.php 2007-04-19 00:04:54 UTC (rev
4760)
@@ -1,141 +0,0 @@
-<?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");
-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 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 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 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";
-?>
Deleted: Extractor-docs/WWW/gnu.org/status.php
===================================================================
--- Extractor-docs/WWW/gnu.org/status.php 2007-04-19 00:04:39 UTC (rev
4759)
+++ Extractor-docs/WWW/gnu.org/status.php 2007-04-19 00:04:54 UTC (rev
4760)
@@ -1,93 +0,0 @@
-<?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");
-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 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 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.", $b, $a);
- BR();
-}
-generateFooter();
-echo "</body></html>";
-?>
\ No newline at end of file
Deleted: Extractor-docs/WWW/gnu.org/translate.php
===================================================================
--- Extractor-docs/WWW/gnu.org/translate.php 2007-04-19 00:04:39 UTC (rev
4759)
+++ Extractor-docs/WWW/gnu.org/translate.php 2007-04-19 00:04:54 UTC (rev
4760)
@@ -1,96 +0,0 @@
-<?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");
-if (!$connection) {
- echo "Database is down. Cannot edit translations.";
- die();
-}
-$text = fix($_REQUEST['text']);
-$text_sql = mysql_real_escape_string($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 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>";
-?>
Deleted: Extractor-docs/WWW/gnu.org/update.php
===================================================================
--- Extractor-docs/WWW/gnu.org/update.php 2007-04-19 00:04:39 UTC (rev
4759)
+++ Extractor-docs/WWW/gnu.org/update.php 2007-04-19 00:04:54 UTC (rev
4760)
@@ -1,50 +0,0 @@
-<?php
-include("i18nhtml.inc");
-?>
-# This script merely generates the SQL statements<br>
-# to do the update. You'll have to run the SQL<br>
-# commands yourself to prevent accidental data loss.<br>
-# <pre>
-<?php
-echo "use $i18nHTMLsqlDB;\n";
-$query = "SELECT * FROM map";
-$result = mysql_query($query, $connection);
-$num = 0;
-$loss = 0;
-if ($result)
- $num = mysql_numrows($result);
-for ($ii=0;$ii<$num;$ii++) {
- $row = mysql_fetch_array($result);
- $la = mysql_real_escape_string($row["lang"]);
- $src = mysql_real_escape_string($row["name"]); // urlencoded
- $dst = $row["translation"]; // possibly urlencoded
- $rank = $row["ranking"];
- $rtrans = mysql_real_escape_string(to_unicode(urldecode($dst)));
- // detect "bad" translations (where conversion failed)
- // if more than 5 values in [0..9] follow => bad conversion
- $txtCnt = count_chars(urldecode($src), 1);
- $tCnt = count_chars($rtrans, 1);
-
- // 3426
- if (! ( ereg("&#[0-9]{6}", $rtrans) ||
- ($txtCnt[ord('%')] != $tCnt[ord('%')]) ||
- ( ( ($la != "Japanese") &&
- ($la != "Traditional chinese") &&
- ($la != "Russian") &&
- ($la != "Ukrainian") &&
- (ereg("&#[0-9]{4}", $rtrans)) ) ) ) ) {
- $dst = mysql_real_escape_string($dst);
- if ($rtrans != $dst) {
- $subquery = "UPDATE map SET translation=\"$rtrans\" WHERE name=\"$src\"
AND lang=\"$la\" AND translation=\"$dst\" AND ranking=$rank;\n";
- echo "$subquery\n";
- }
- } else {
- $subquery = "DELETE FROM map WHERE name=\"$src\" AND lang=\"$la\" AND
translation=\"$dst\" AND ranking=$rank;\n";
- echo "$subquery\n";
- $loss++;
- }
- }
-echo "# Lost $loss out of $num translations.\n";
-?>
-# </pre>
-# end of conversion
Deleted: Extractor-docs/WWW/gnu.org/vote.php
===================================================================
--- Extractor-docs/WWW/gnu.org/vote.php 2007-04-19 00:04:39 UTC (rev 4759)
+++ Extractor-docs/WWW/gnu.org/vote.php 2007-04-19 00:04:54 UTC (rev 4760)
@@ -1,55 +0,0 @@
-<?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");
-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 = mysql_real_escape_string($text);
-$translation_sql = mysql_real_escape_string(to_unicode($translation));
-
-$query = "SELECT ranking FROM 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 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));
-}
-?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4760 - Extractor-docs/WWW/gnu.org,
gnunet <=