$HOME = 'http://'.$_SERVER['HTTP_HOST'];
$HOME = 'http://'.$_SERVER['HTTP_HOST'];
$mes = preg_replace("~(^|s|-|:| |()(http(s?)://|(http://www.))((S{25})(S{5,})(S{15})([^<s.,>)];'"!?]))~i" ;, "\1<a href="http\3://\4\5">Ссылка</a>", $mes);
$mes = preg_replace("~(^|s|-|:|(| |xAB)(http(s?)://|(http://www.))((S+)([^<s.,>)];'"!?]))~i" ;, "\1<a href="http\3://\4\5">Ссылка</a>", $mes);
$mes = preg_replace("~(^|s|-|:| |()(http(s?)://|(http://www.))((S{25})(S{5,})(S{15})([^<s.,>)];'"!?]))~i" ;, "\1<a href="http\3://\4\5">Ссылка</a>", $mes);
$mes = preg_replace("~(^|s|-|:|(| |xAB)(http(s?)://|(http://www.))((S+)([^<s.,>)];'"!?]))~i" ;, "\1<a href="http\3://\4\5">Ссылка</a>", $mes);
function ava($id){
$ava = mysql_fetch_array
(mysql_query("SELECT * FROM
`users` WHERE `id` = '".$id."'"));
return (empty($ava['avatar'])?'<img src="http://okmob.ru/files/ava/net.png" alt="*" style="max-width: 30px; max-height: 40px;">':'<img src="http://okmob.ru/files/ava/'.$ava['avatar'].'" alt="*" style="max-width: 30px; max-height: 40px;">');
}