', $text);
// Get the theme's directory if it is numeric
if (is_numeric($theme))
{
$result = $db->execute("
SELECT folder
FROM arrowchat_themes
WHERE id='".$theme."'
");
if ($result AND $db->count_select() > 0)
{
$row = $db->fetch_array($result);
$theme = $row['folder'];
}
else
{
$theme = "new_facebook";
}
}
if (!empty($blocked_words))
{
$bad_words = explode(",", $blocked_words);
$container_words = array();
$exact_match_words = array();
foreach ($bad_words as $word)
{
$s_word = trim($word);
if (preg_match('/\[(.*?)\]/', $s_word))
{
$exact_match_words[] = trim($s_word, '[]');
}
else
{
$container_words[] = $s_word;
}
}
if (!empty($exact_match_words))
$text = preg_replace("/\b(" . implode($exact_match_words,"|") . ")\b/i", "****", $text);
if (!empty($container_words))
$text = preg_replace("/(" . implode($container_words,"|") . ")/i", "****", $text);
}
if ($disable_smilies != 1)
{
$text = preg_replace('/^\[e-([^\]]+)\]$/', '
', $text);
$text = preg_replace('/\[e-(.*?)\]/', '
', $text);
if (!empty($smileys))
{
foreach ($smileys as $pattern => $result)
{
$pattern = str_replace("\;", ";", $pattern);
$pattern = htmlspecialchars($pattern);
$text = str_replace($pattern, ' ', $text);
}
}
$premade_smilies = array(
":)" => "1f600.png",
":-)" => "1f600.png",
"=)" => "1f600.png",
":p" => "1f61b.png",
":o" => "1f62e.png",
":|" => "1f610.png",
":(" => "1f614.png",
"=(" => "1f614.png",
":D" => "1f603.png",
"=D" => "1f603.png",
":/" => "1f615.png",
"=/" => "1f615.png",
";)" => "1f609.png",
":'(" => "1f62d.png",
"<3" => "2764.png",
">:(" => "1f620.png"
);
foreach ($premade_smilies as $pattern => $result)
{
$pattern = str_replace("\;", ";", $pattern);
$pattern = htmlspecialchars($pattern);
if ($text == $pattern)
$text = str_replace($pattern, '
', $text);
else
$text = str_replace(" " . $pattern, '
', $text);
}
}
$text = preg_replace('@video[{](.*)[}]@', '