$sql = "SELECT actor_id, actor_runame, actor_enname FROM " . BB_ACTORS ;
if (!($result = DB()->sql_query($sql)))
{
bb_die('Could not get actors information');
}
while ($row = DB()->sql_fetchrow($result)) {
if (!empty($row['actor_runame']) || !empty($row['actor_enname']) ) {
$runame = explode(',', $row['actor_runame']);
$enname = explode(',', $row['actor_enname']);
foreach (array_merge($runame, $enname) as $word) {
$name[] = $word;
$replace[] = "<a href=\"actors.php?id={$row['actor_id']}\">$word</a>";
}
}
}
$message = str_replace($name, $replace, $message);