Просмотр файла functions.php

Размер файла: 1.29Kb
<?

//------------------ Функция вставки BB-кода --------(c)Вантуз------------//
function bb_code($text){ 

$text = preg_replace('#\[code\](.*?)\[/code\]#ie', 'highlight_code("\1")', $text); 
$text = preg_replace('#\[big\](.*?)\[/big\]#si', '<big>\1</big>', $text);
$text = preg_replace('#\[b\](.*?)\[/b\]#si', '<b>\1</b>', $text);
$text = preg_replace('#\[i\](.*?)\[/i\]#si', '<i>\1</i>', $text);
$text = preg_replace('#\[u\](.*?)\[/u\]#si', '<u>\1</u>', $text);
$text = preg_replace('#\[small\](.*?)\[/small\]#si', '<small>\1</small>', $text);
$text = preg_replace('#\[red\](.*?)\[/red\]#si', '<font color="#FF0000">\1</font>', $text);
$text = preg_replace('#\[green\](.*?)\[/green\]#si', '<font color="#00FF00">\1</font>', $text);
$text = preg_replace('#\[blue\](.*?)\[/blue\]#si', '<font color="#0000FF">\1</font>', $text);
$text = preg_replace('#\[yellow\](.*?)\[/yellow\]#si', '<font color="#FFFF00">\1</font>', $text);
$text = preg_replace('#\[q\](.*?)\[/q\]#si', '<q>\1</q>', $text);
$text = preg_replace('#\[del\](.*?)\[/del\]#si', '<del>\1</del>', $text);
 

return $text;
}



//определяем ip
$ip=$_SERVER['REMOTE_ADDR'];


//определяем браузер
$bra=$_SERVER['HTTP_USER_AGENT'];


$copy="code9 Book 0.2 &copy; 2009";

?>