"") { $login = $session['user']['login']; $language = $session['user']['prefs']['language']; $sql = "INSERT INTO " . db_prefix("translations") . " (language,uri,intext,outtext,author,version) VALUES" . " ('$language','$namespace','$intext','$outtext','$login','$logd_version')"; db_query($sql); $sql = "DELETE FROM " . db_prefix("untranslated") . " WHERE intext = '$intext' AND language = '$language' AND namespace = '$namespace'"; db_query($sql); } } if ($mode == "edit") { rawoutput("
"); addnav("", "untranslated.php?op=list&mode=save&ns=".rawurlencode($namespace)); } else { rawoutput(""); addnav("", "untranslated.php?op=list"); } $sql = "SELECT namespace,count(*) AS c FROM " . db_prefix("untranslated") . " WHERE language='".$session['user']['prefs']['language']."' GROUP BY namespace ORDER BY namespace ASC"; $result = db_query($sql); rawoutput(""); output("Known Namespaces:"); rawoutput(""); rawoutput(""); rawoutput("
"); if ($mode == "edit") { rawoutput(translate_inline("Text:"). "
"); rawoutput("
"); rawoutput(translate_inline("Translation:"). "
"); rawoutput("
"); rawoutput(""); } else { rawoutput(""); rawoutput(""); $sql = "SELECT * FROM " . db_prefix("untranslated") . " WHERE language='".$session['user']['prefs']['language']."' AND namespace='".$namespace."'"; $result = db_query($sql); if (db_num_rows($result)>0){ $i = 0; while ($row = db_fetch_assoc($result)){ $i++; rawoutput(""); } }else{ rawoutput(""); } rawoutput("
". translate_inline("Ops") ."". translate_inline("Text") ."
"); rawoutput("". translate_inline("Edit") .""); addnav("", "untranslated.php?op=list&mode=edit&ns=". rawurlencode($row['namespace']) ."&intext=". rawurlencode($row['intext'])); rawoutput(""); rawoutput(htmlentities($row['intext'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); rawoutput("
". translate_inline("No rows found") ."
"); } rawoutput("
"); } else { if ($op == "step2") { $intext = httppost('intext'); $outtext = httppost('outtext'); $namespace = httppost('namespace'); $language = httppost('language'); if ($outtext <> "") { $login = $session['user']['login']; $sql = "INSERT INTO " . db_prefix("translations") . " (language,uri,intext,outtext,author,version) VALUES" . " ('$language','$namespace','$intext','$outtext','$login','$logd_version')"; db_query($sql); $sql = "DELETE FROM " . db_prefix("untranslated") . " WHERE intext = '$intext' AND language = '$language' AND namespace = '$namespace'"; db_query($sql); invalidatedatacache("translations-".$namespace."-".$language); } } $sql = "SELECT count(intext) AS count FROM " . db_prefix("untranslated"); $count = db_fetch_assoc(db_query($sql)); if ($count['count'] > 0) { $sql = "SELECT * FROM " . db_prefix("untranslated") . " WHERE language = '" . $session['user']['prefs']['language'] . "' ORDER BY rand(".e_rand().") LIMIT 1"; $result = db_query($sql); if (db_num_rows($result) == 1) { $row = db_fetch_assoc($result); $row['intext'] = stripslashes($row['intext']); $submit = translate_inline("Save Translation"); $skip = translate_inline("Skip Translation"); rawoutput("
"); output("`^`cThere are `&%s`^ untranslated texts in the database.`c`n`n", $count['count']); rawoutput(""); rawoutput(""); rawoutput(""); rawoutput(""); rawoutput("
"); output("Target Language: %s", $row['language']); rawoutput("
"); output("Namespace: %s", $row['namespace']); rawoutput("
"); rawoutput(""); rawoutput(""); rawoutput(""); rawoutput(""); rawoutput("
"); rawoutput("
"); rawoutput(""); rawoutput("
"); addnav("", "untranslated.php?op=step2"); addnav("", "untranslated.php"); } else { output("There are `&%s`^ untranslated texts in the database, but none for your selected language.", $count['count']); output("Please change your language to translate these texts."); } } else { output("There are no untranslated texts in the database!"); output("Congratulations!!!"); } // end if } // end list if addnav("R?Restart Translator", "untranslated.php"); addnav("N?Translate by Namespace", "untranslated.php?op=list"); require_once("lib/superusernav.php"); superusernav(); page_footer(); ?>