Repository navigation
Expand file tree
/
Copy pathset_word_on_hover.php
More file actions
71 lines (58 loc) · 2.68 KB
/
Copy pathset_word_on_hover.php
File metadata and controls
71 lines (58 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
require_once 'inc/session_utility.php';
require_once 'googleTranslateClass.php' ;
$translation = '*';
if($_REQUEST['status']==1) {
$tl=$_GET["tl"];
$sl=$_GET["sl"];
$text=$_GET["text"];
$tl_array = GoogleTranslate::staticTranslate($text, $sl, $tl);
if($tl_array) {
$translation = $tl_array[0];
}
if($translation == $_GET["text"]) {
$translation = '*';
}
header('Pragma: no-cache');
header('Expires: 0');
}
$word = convert_string_to_sqlsyntax($_REQUEST['text']);
$wordlc = convert_string_to_sqlsyntax(mb_strtolower($_REQUEST['text'], 'UTF-8'));
$langid = get_first_value("select TxLgID as value from " . $tbpref . "texts where TxID = " . $_REQUEST['tid']);
runsql(
'insert into ' . $tbpref . 'words (WoLgID, WoTextLC, WoText, ' .
'WoStatus, WoTranslation, WoSentence, WoRomanization, WoStatusChanged,' . make_score_random_insert_update('iv') . ') values( ' .
$langid . ', ' .
$wordlc . ', ' .
$word . ', ' .
$_REQUEST["status"] . ', ' .
convert_string_to_sqlsyntax($translation) . ', "", "", NOW(), ' .
make_score_random_insert_update('id') . ')', "Term saved"
);
$wid = get_last_key();
do_mysqli_query('UPDATE ' . $tbpref . 'textitems2 SET Ti2WoID = ' . $wid . ' WHERE Ti2LgID = ' . $langid . ' AND LOWER(Ti2Text) =' . $wordlc);
$hex = strToClassName(prepare_textdata(mb_strtolower($_REQUEST['text'], 'UTF-8')));
pagestart("New Term: " . $word, false);
echo '<p>Status: ' . get_colored_status_msg($_REQUEST['status']) . '</p><br />';
if($translation != '*') { echo '<p>Translation: <b>' . tohtml($translation) . '</b></p>';
}
?>
<script type="text/javascript">
//<![CDATA[
var context = window.parent.document;
var title = window.parent.JQ_TOOLTIP?'':make_tooltip(<?php echo prepare_textdata_js($_REQUEST['text']); ?>,<?php echo prepare_textdata_js($translation); ?>,'','<?php echo $_REQUEST["status"]; ?>');
$('.TERM<?php echo $hex; ?>', context)
.removeClass('status0')
.addClass('status<?php echo $_REQUEST["status"]; ?> word<?php echo $wid; ?>')
.attr('data_status','<?php echo $_REQUEST["status"]; ?>')
.attr('data_wid','<?php echo $wid; ?>')
.attr('title',title)
.attr('data_trans','<?php echo tohtml($translation); ?>');
$('#learnstatus', context).html('<?php echo addslashes(texttodocount2($_REQUEST['tid'])); ?>');
window.parent.getElementById('frame-l').focus();
window.parent.setTimeout('cClick()', 100);
//]]>
</script>
<?php
pageend();
?>