Файл: core/bb_code.php
Строк: 24
<?php
function len_code_php(&$len, $str) {
$len = strlen($str);
}
function bb_code($msg) {
$msg = preg_replace("#[q](.*)[/q]#isU", '<div class="quote">\1</div>', $msg);
$msg = preg_replace("#[b](.*)[/b]#isU", '<b>\1</b>', $msg);
$msg = preg_replace("#[i](.*)[/i]#isU", '<i>\1</i>', $msg);
$msg = preg_replace("#[u](.*)[/u]#isU", '<u>\1</u>', $msg);
$msg = preg_replace("#[s](.*)[/s]#isU", '<s>\1</s>', $msg);
$msg = preg_replace("/[color=([^]]+?)](.+?)[/color]/uis", "<font color="$1">$2</font>", $msg);
return $msg;
}
function links($msg) {
$msg = preg_replace('/[img](.+)[/img]/isU', '<img src="$1" />', $msg);
$msg = preg_replace('/[url=(.+)](.+)[/url]/isU', ' <a href="$1"><span style="box-shadow: 0 0 3px black;">$2</span></a> ', $msg);
$msg = preg_replace('~(^|s)([a-z]+://([^ rnt`'"]+))(s|$)~iu', ' <a href="$2"><span style="box-shadow: 0 0 3px black;">$2</a></span></a> ', $msg);
return $msg;
}
function smile($msg) {
$result = mysql_query("SELECT id, code FROM `smiles` ORDER BY `id` DESC");
while ($smiles = mysql_fetch_assoc($result)) {
$msg = str_replace($smiles["code"], '<img src = "../smiles/' . $smiles["id"] . '.gif">', $msg);
}
return $msg;
}
?>