In robot_functions.php you might try running a query within the IF of the following code to append text to $result and see if that does it:
Code:
if ((is_array($result)) && (count($result) > 0)) {
// run query and stick content into $result[] here
$f_handler = fopen($tempfile1,'wb');
fwrite($f_handler,str_replace('ลก',' ',str_replace(chr(0xad),'-',implode(' ',$result))));
fclose($f_handler);
}