@@ -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 ' ' ;
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 & 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 & 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