gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r2322 - Extractor-docs/WWW GNUnet-docs/WWW doodle-docs/WWW


From: grothoff
Subject: [GNUnet-SVN] r2322 - Extractor-docs/WWW GNUnet-docs/WWW doodle-docs/WWW i18nHTML/src i18nHTML-docs/WWW
Date: Tue, 13 Dec 2005 20:16:30 -0800 (PST)

Author: grothoff
Date: 2005-12-13 20:16:25 -0800 (Tue, 13 Dec 2005)
New Revision: 2322

Modified:
   Extractor-docs/WWW/commitTranslation.php
   GNUnet-docs/WWW/commitTranslation.php
   doodle-docs/WWW/commitTranslation.php
   i18nHTML-docs/WWW/commitTranslation.php
   i18nHTML/src/commitTranslation.php
Log:
Mantis 938

Modified: Extractor-docs/WWW/commitTranslation.php
===================================================================
--- Extractor-docs/WWW/commitTranslation.php    2005-12-14 02:57:05 UTC (rev 
2321)
+++ Extractor-docs/WWW/commitTranslation.php    2005-12-14 04:16:25 UTC (rev 
2322)
@@ -37,13 +37,24 @@
 
 $back            = $_REQUEST['back'];
 // check for identical translation
-$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
-         " AND lang=\"$lang\" AND translation=\"$translation_sql\"";
+$query = "SELECT ranking,translation FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
+  " AND lang=\"$lang\"";
+
 $result = mysql_query($query, $connection);
 $num = 0;
 if ($result)
   $num = mysql_numrows($result);
-if ($num > 0) {
+$exists = 0;
+$max = 0;
+for ($ii=0;$ii<$num;$ii++) {
+  $row = mysql_fetch_array($result);
+  if ($row["translation"] == $translation_sql)
+    $exists = 1;
+  if ($row["rank"] > $max)
+    $max = $row["rank"];
+ }
+
+if ($exists == 1) {
   echo "<html><head>";
   TITLE("Translation exists.");
   echo "</head><body>";
@@ -66,7 +77,7 @@
       echo "</body></html>";
   } else {
     $query = "INSERT INTO ".$i18nHTMLsqlPrefix."map VALUES(\"$text_sql\", 
\"$lang\", " .
-             "\"$translation_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
+             "\"$translation_sql\", $max+1, \"" . $_SERVER['REMOTE_ADDR'] . 
"\");";
     $result = mysql_query($query, $connection);
     if ($result) {
       $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
AND c=\"$text_sql\"";

Modified: GNUnet-docs/WWW/commitTranslation.php
===================================================================
--- GNUnet-docs/WWW/commitTranslation.php       2005-12-14 02:57:05 UTC (rev 
2321)
+++ GNUnet-docs/WWW/commitTranslation.php       2005-12-14 04:16:25 UTC (rev 
2322)
@@ -37,13 +37,24 @@
 
 $back            = $_REQUEST['back'];
 // check for identical translation
-$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
-         " AND lang=\"$lang\" AND translation=\"$translation_sql\"";
+$query = "SELECT ranking,translation FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
+  " AND lang=\"$lang\"";
+
 $result = mysql_query($query, $connection);
 $num = 0;
 if ($result)
   $num = mysql_numrows($result);
-if ($num > 0) {
+$exists = 0;
+$max = 0;
+for ($ii=0;$ii<$num;$ii++) {
+  $row = mysql_fetch_array($result);
+  if ($row["translation"] == $translation_sql)
+    $exists = 1;
+  if ($row["rank"] > $max)
+    $max = $row["rank"];
+ }
+
+if ($exists == 1) {
   echo "<html><head>";
   TITLE("Translation exists.");
   echo "</head><body>";
@@ -66,7 +77,7 @@
       echo "</body></html>";
   } else {
     $query = "INSERT INTO ".$i18nHTMLsqlPrefix."map VALUES(\"$text_sql\", 
\"$lang\", " .
-             "\"$translation_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
+             "\"$translation_sql\", $max+1, \"" . $_SERVER['REMOTE_ADDR'] . 
"\");";
     $result = mysql_query($query, $connection);
     if ($result) {
       $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
AND c=\"$text_sql\"";

Modified: doodle-docs/WWW/commitTranslation.php
===================================================================
--- doodle-docs/WWW/commitTranslation.php       2005-12-14 02:57:05 UTC (rev 
2321)
+++ doodle-docs/WWW/commitTranslation.php       2005-12-14 04:16:25 UTC (rev 
2322)
@@ -37,13 +37,24 @@
 
 $back            = $_REQUEST['back'];
 // check for identical translation
-$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
-         " AND lang=\"$lang\" AND translation=\"$translation_sql\"";
+$query = "SELECT ranking,translation FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
+  " AND lang=\"$lang\"";
+
 $result = mysql_query($query, $connection);
 $num = 0;
 if ($result)
   $num = mysql_numrows($result);
-if ($num > 0) {
+$exists = 0;
+$max = 0;
+for ($ii=0;$ii<$num;$ii++) {
+  $row = mysql_fetch_array($result);
+  if ($row["translation"] == $translation_sql)
+    $exists = 1;
+  if ($row["rank"] > $max)
+    $max = $row["rank"];
+ }
+
+if ($exists == 1) {
   echo "<html><head>";
   TITLE("Translation exists.");
   echo "</head><body>";
@@ -66,7 +77,7 @@
       echo "</body></html>";
   } else {
     $query = "INSERT INTO ".$i18nHTMLsqlPrefix."map VALUES(\"$text_sql\", 
\"$lang\", " .
-             "\"$translation_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
+             "\"$translation_sql\", $max+1, \"" . $_SERVER['REMOTE_ADDR'] . 
"\");";
     $result = mysql_query($query, $connection);
     if ($result) {
       $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
AND c=\"$text_sql\"";

Modified: i18nHTML/src/commitTranslation.php
===================================================================
--- i18nHTML/src/commitTranslation.php  2005-12-14 02:57:05 UTC (rev 2321)
+++ i18nHTML/src/commitTranslation.php  2005-12-14 04:16:25 UTC (rev 2322)
@@ -37,13 +37,24 @@
 
 $back            = $_REQUEST['back'];
 // check for identical translation
-$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
-         " AND lang=\"$lang\" AND translation=\"$translation_sql\"";
+$query = "SELECT ranking,translation FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
+  " AND lang=\"$lang\"";
+
 $result = mysql_query($query, $connection);
 $num = 0;
 if ($result)
   $num = mysql_numrows($result);
-if ($num > 0) {
+$exists = 0;
+$max = 0;
+for ($ii=0;$ii<$num;$ii++) {
+  $row = mysql_fetch_array($result);
+  if ($row["translation"] == $translation_sql)
+    $exists = 1;
+  if ($row["rank"] > $max)
+    $max = $row["rank"];
+ }
+
+if ($exists == 1) {
   echo "<html><head>";
   TITLE("Translation exists.");
   echo "</head><body>";
@@ -66,7 +77,7 @@
       echo "</body></html>";
   } else {
     $query = "INSERT INTO ".$i18nHTMLsqlPrefix."map VALUES(\"$text_sql\", 
\"$lang\", " .
-             "\"$translation_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
+             "\"$translation_sql\", $max+1, \"" . $_SERVER['REMOTE_ADDR'] . 
"\");";
     $result = mysql_query($query, $connection);
     if ($result) {
       $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
AND c=\"$text_sql\"";

Modified: i18nHTML-docs/WWW/commitTranslation.php
===================================================================
--- i18nHTML-docs/WWW/commitTranslation.php     2005-12-14 02:57:05 UTC (rev 
2321)
+++ i18nHTML-docs/WWW/commitTranslation.php     2005-12-14 04:16:25 UTC (rev 
2322)
@@ -37,13 +37,24 @@
 
 $back            = $_REQUEST['back'];
 // check for identical translation
-$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
-         " AND lang=\"$lang\" AND translation=\"$translation_sql\"";
+$query = "SELECT ranking,translation FROM ".$i18nHTMLsqlPrefix."map WHERE 
name=\"$text_sql\"" .
+  " AND lang=\"$lang\"";
+
 $result = mysql_query($query, $connection);
 $num = 0;
 if ($result)
   $num = mysql_numrows($result);
-if ($num > 0) {
+$exists = 0;
+$max = 0;
+for ($ii=0;$ii<$num;$ii++) {
+  $row = mysql_fetch_array($result);
+  if ($row["translation"] == $translation_sql)
+    $exists = 1;
+  if ($row["rank"] > $max)
+    $max = $row["rank"];
+ }
+
+if ($exists == 1) {
   echo "<html><head>";
   TITLE("Translation exists.");
   echo "</head><body>";
@@ -66,7 +77,7 @@
       echo "</body></html>";
   } else {
     $query = "INSERT INTO ".$i18nHTMLsqlPrefix."map VALUES(\"$text_sql\", 
\"$lang\", " .
-             "\"$translation_sql\", 1, \"" . $_SERVER['REMOTE_ADDR'] . "\");";
+             "\"$translation_sql\", $max+1, \"" . $_SERVER['REMOTE_ADDR'] . 
"\");";
     $result = mysql_query($query, $connection);
     if ($result) {
       $query = "DELETE FROM ".$i18nHTMLsqlPrefix."pending WHERE lang=\"$lang\" 
AND c=\"$text_sql\"";





reply via email to

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