<?
/**
* Смайлы
* @author  Mykhaylo Yatsyshyn
* @package dk-game.ru
* @version 1.0
*  19.04.2015
*/

 function smiles($text){
 	/*
global $db;
$smiles=$db->fetchAll("SELECT * FROM `smiles`",null);
if (is_array($smiles)){
	*/
	$smiles = array(
  array('id' => '1','name' => '','mark' => ':ag'),
  array('id' => '2','name' => '','mark' => ':beee'),
  array('id' => '3','name' => '','mark' => ':dance'),
  array('id' => '4','name' => '','mark' => ':grust'),
  array('id' => '5','name' => '','mark' => ':krutoi'),
  array('id' => '6','name' => '','mark' => ':nono'),
  array('id' => '7','name' => '','mark' => ':rzhu'),
  array('id' => '8','name' => '','mark' => ':super'),
  array('id' => '9','name' => '','mark' => ':ulibka'),
  array('id' => '10','name' => '','mark' => ':vsemprivet')
);
	
	foreach ($smiles as $smile){
			$text=str_ireplace($smile['mark'], "<img src='/imgData/smiles/".$smile['id'].".png'>", $text);
		}
	//}

	$badwords = array('esy.es','.ru','.tk','.ml','bitge','godwars','titwar','B I T G E . M L');

	$text=str_ireplace($badwords, "...", $text);


	return $text;
}



?> 