Skip to content

Commit 44b5ef8

Browse files
committed
v1.6.4 bugfix create dict links for sentence translate
1 parent 32d827c commit 44b5ef8

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎js/pgm.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ function getStatusAbbr(status) {
393393
function translateSentence(url,sentctl) {
394394
if ((typeof sentctl != 'undefined') && (url != '')) {
395395
text = sentctl.value;
396-
if (typeof text == 'string') {
396+
if (typeof text == 'string' && text.length) {
397397
window.parent.frames['ru'].location.href =
398398
createTheDictUrl(url,text.replace(/[{}]/g, ''));
399399
}
@@ -403,7 +403,7 @@ function translateSentence(url,sentctl) {
403403
function translateSentence2(url,sentctl) {
404404
if ((typeof sentctl != 'undefined') && (url != '')) {
405405
text = sentctl.value;
406-
if (typeof text == 'string') {
406+
if (typeof text == 'string' && text.length) {
407407
owin (
408408
createTheDictUrl(url, text.replace(/[{}]/g, '') )
409409
);

‎statistics.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
while ($record = mysql_fetch_assoc($res)) {
8484
$lang = $record['LgID'];
8585

86-
flush();
8786
$s1 = isset($term_stat[$record['LgID']][1])?($term_stat[$record['LgID']][1]):0;
8887
$s2 = isset($term_stat[$record['LgID']][2])?($term_stat[$record['LgID']][2]):0;
8988
$s3 = isset($term_stat[$record['LgID']][3])?($term_stat[$record['LgID']][3]):0;

‎trans.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
$trans = str_replace ('?','?sent=1&',$trans);
7070
}
7171
header("Location: " . createTheDictLink($trans,$satz));
72-
}
72+
}
7373
exit();
74-
}
74+
}
7575

7676
if ( $x == 2 ) {
7777
/*
@@ -83,4 +83,4 @@
8383
exit();
8484
}
8585

86-
?>
86+
?>

‎upload_words.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ function savetag($item, $key, $wid) {
175175
}
176176
runsql($sql ,'');
177177
if($fields["tl"]!=0){
178-
runsql('insert ignore into ' . $tbpref . 'tags (TgText) select name from (SELECT ' . $tbpref . 'tempwords.WoTextLC, SUBSTRING_INDEX(SUBSTRING_INDEX(' . $tbpref . 'tempwords.WoTaglist, \',\', ' . $tbpref . 'numbers.n), \',\', -1) name FROM ' . $tbpref . 'numbers INNER JOIN ' . $tbpref . 'tempwords ON CHAR_LENGTH(' . $tbpref . 'tempwords.WoTaglist)-CHAR_LENGTH(REPLACE(' . $tbpref . 'tempwords.WoTaglist, \',\', \'\'))>=' . $tbpref . 'numbers.n-1 ORDER BY WoTextLC, n) A','');
179-
runsql('INSERT IGNORE INTO ' . $tbpref . 'wordtags select WoID,TgID from (SELECT ' . $tbpref . 'tempwords.WoTextLC, SUBSTRING_INDEX(SUBSTRING_INDEX(' . $tbpref . 'tempwords.WoTaglist, \',\', ' . $tbpref . 'numbers.n), \',\', -1) name FROM ' . $tbpref . 'numbers INNER JOIN ' . $tbpref . 'tempwords ON CHAR_LENGTH(' . $tbpref . 'tempwords.WoTaglist)-CHAR_LENGTH(REPLACE(' . $tbpref . 'tempwords.WoTaglist, \',\', \'\'))>=' . $tbpref . 'numbers.n-1 ORDER BY WoTextLC, n) A,' . $tbpref . 'tags,' . $tbpref . 'words where name=TgText and A.WoTextLC=' . $tbpref . 'words.WoTextLC and WoLgID=' . $lang,'');
178+
runsql('insert ignore into ' . $tbpref . 'tags (TgText) select name from (SELECT ' . $tbpref . 'tempwords.WoTextLC, SUBSTRING_INDEX(SUBSTRING_INDEX(' . $tbpref . 'tempwords.WoTaglist, \',\', ' . $tbpref . 'numbers.n), \',\', -1) name FROM ' . $tbpref . 'numbers INNER JOIN ' . $tbpref . 'tempwords ON CHAR_LENGTH(' . $tbpref . 'tempwords.WoTaglist)-CHAR_LENGTH(REPLACE(' . $tbpref . 'tempwords.WoTaglist, \',\', \'\'))>=' . $tbpref . 'numbers.n-1 ORDER BY WoTextLC, n) A','');
179+
runsql('INSERT IGNORE INTO ' . $tbpref . 'wordtags select WoID,TgID from (SELECT ' . $tbpref . 'tempwords.WoTextLC, SUBSTRING_INDEX(SUBSTRING_INDEX(' . $tbpref . 'tempwords.WoTaglist, \',\', ' . $tbpref . 'numbers.n), \',\', -1) name FROM ' . $tbpref . 'numbers INNER JOIN ' . $tbpref . 'tempwords ON CHAR_LENGTH(' . $tbpref . 'tempwords.WoTaglist)-CHAR_LENGTH(REPLACE(' . $tbpref . 'tempwords.WoTaglist, \',\', \'\'))>=' . $tbpref . 'numbers.n-1 ORDER BY WoTextLC, n) A,' . $tbpref . 'tags,' . $tbpref . 'words where name=TgText and A.WoTextLC=' . $tbpref . 'words.WoTextLC and WoLgID=' . $lang,'');
180180
}
181181
runsql('DROP TABLE ' . $tbpref . 'numbers','');
182182
runsql("truncate " . $tbpref . "tempwords" ,'');

‎utilities.inc.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,7 @@ function pagestart_nobody($titletext, $addcss='') {
11981198
<body>
11991199
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
12001200
<?php
1201+
flush();
12011202
if ($debug) showRequest();
12021203
}
12031204

@@ -2460,7 +2461,7 @@ function createDictLinksInEditWin2($lang,$sentctljs,$wordctljs) {
24602461
if ($wb2 != "")
24612462
$r .= '<span class="click" onclick="translateWord2(' . prepare_textdata_js($wb2) . ',' . $wordctljs . ');">Dict2</span> ';
24622463
if ($wb3 != "")
2463-
$r .= '<span class="click" onclick="translateWord2(' . prepare_textdata_js($wb3) . ',' . $wordctljs . ');">GTr</span> | Sent.: <span class="click" onclick="translateSentence2(' . prepare_textdata_js($wb3) . ',' . $sentctljs . ');">GTr</span>';
2464+
$r .= '<span class="click" onclick="translateWord2(' . prepare_textdata_js($wb3) . ',' . $wordctljs . ');">GTr</span> | Sent.: <span class="click" onclick="translateSentence2(' . prepare_textdata_js((substr($wb3,0,7) == 'ggl.php')?str_replace ('?','?sent=1&',$wb3):$wb3) . ',' . $sentctljs . ');">GTr</span>';
24642465
return $r;
24652466
}
24662467

@@ -2514,7 +2515,7 @@ function createDictLinksInEditWin3($lang,$sentctljs,$wordctljs) {
25142515
$f4 = 'translateSentence2(' . prepare_textdata_js(substr($wb3,1));
25152516
} else {
25162517
$f3 = 'translateWord(' . prepare_textdata_js($wb3);
2517-
$f4 = 'translateSentence(' . prepare_textdata_js($wb3);
2518+
$f4 = 'translateSentence(' . prepare_textdata_js((substr($wb3,0,7) == 'ggl.php')?str_replace ('?','?sent=1&',$wb3):$wb3);
25182519
}
25192520

25202521
mysql_free_result($res);

0 commit comments

Comments
 (0)