Skip to content

Commit d4579ad

Browse files
author
LWT Project
committed
Version 1.5.18 (04-Sep-2014 19:35)
1 parent b247c95 commit d4579ad

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎css/styles.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ img {
211211
color: #FF0000;
212212
font-weight: bold;
213213
}
214+
.red3 {
215+
color: #FF0000;
216+
}
214217
.scorered {
215218
font-weight: bold;
216219
color: #FF0000;

‎simterms.inc.php‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,29 @@ function print_similar_terms($lang_id, $compared_term) {
107107
$max_count = (int)getSettingWithDefault("set-similar-terms-count");
108108
if ($max_count <= 0) return '';
109109
if (trim($compared_term) == '') return '&nbsp;';
110+
$compare = tohtml($compared_term);
110111
$termarr = get_similar_terms($lang_id, $compared_term, $max_count, 0.33);
111112
$rarr = array();
112113
foreach ($termarr as $termid) {
113114
$sql = "select WoText, WoTranslation, WoRomanization from " . $tbpref . "words where WoID = " . $termid;
114115
$res = do_mysql_query($sql);
115116
if ($record = mysql_fetch_assoc($res)) {
117+
$term = tohtml($record["WoText"]);
118+
if (stripos($compare, $term) !== FALSE)
119+
$term = '<span class="red3">' . $term . '</span>';
120+
else
121+
$term = str_ireplace($compare, '<span class="red3">' . $compare . '</span>', $term);
116122
$tra = $record["WoTranslation"];
117123
if ($tra == "*") $tra = "???";
118124
if (trim($record["WoRomanization"]) !== '') {
119-
$term = $record["WoText"] . " [" . $record["WoRomanization"] . "]";
125+
$romd = " [" . $record["WoRomanization"] . "]";
120126
$rom = $record["WoRomanization"];
121127
}
122128
else {
123-
$term = $record["WoText"];
129+
$romd = "";
124130
$rom = "";
125131
}
126-
$rarr[] = '<img class="clickedit" src="icn/tick-button-small.png" title="Copy → Translation &amp; Romanization Field(s)" onclick="setTransRoman(' . prepare_textdata_js($tra) . ',' . prepare_textdata_js($rom) . ');" /> ' . tohtml($term) . ' — ' . tohtml($tra) . '<br />';
132+
$rarr[] = '<img class="clickedit" src="icn/tick-button-small.png" title="Copy → Translation &amp; Romanization Field(s)" onclick="setTransRoman(' . prepare_textdata_js($tra) . ',' . prepare_textdata_js($rom) . ');" /> ' . $term . tohtml($romd) . ' — ' . tohtml($tra) . '<br />';
127133
}
128134
mysql_free_result($res);
129135
}

0 commit comments

Comments
 (0)