"") { $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("
"); } 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(""); 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(); ?>