Файл: vsime.com/system/functions/text_smiles.php
Строк: 13
<?
function text_smiles($text, $user_id)
{
global $user, $dbi;
$ank = profile($user_id);
if ($user['smiles_show'] == 1) {
$query = mysqli_query($dbi, "SELECT * FROM `smiles` WHERE `type` = 'smile' ORDER BY `name` DESC");
while ($post = mysqli_fetch_array($query))
{
if ($post['level'] <= $ank['level'])
{
$post['explode_name'] = explode(",", $post['name']);
$post['name'] = array();
foreach($post['explode_name'] AS $key => $name)
{
$text = str_replace($name, "<img src='http://$_SERVER[HTTP_HOST]/i/smiles/$post[id].$post[image]' />", $text);
}
}
}
}
return $text;
}
?>