[php:1:5aef850481]<?php
function bbcode( $text) {
$text = nl2br( $text);
$text = str_replace("", "<span style="font-weight: bold">", $text);
$text = str_replace("", "</span>", $text);
$text = str_replace("", "<span style="text-decoration: underline">", $text);
$text = str_replace("", "</span>", $text);
$text = str_replace("", "<span style="font-style: italic">", $text);
$text = str_replace("", "</span>", $text);
$text = str_replace("", "<ul>", $text);
$text = str_replace("", "<li>", $text);
$text = str_replace("", "</ul>", $text);
$text = str_replace("[list]", "</ol>", $text);
$text = preg_replace("/[list]/si", "<ol type="1">", $text);
$text = preg_replace("/
{6}|[a-z]+)]/si", "<span
style="color: 1">", $text);
$text = str_replace("", "</span>", $text);
$text = preg_replace("/
?[0-9])]/si", "<span style="font-size:
1px; line-height: normal">", $text);
$text = str_replace("", "</span>", $text);
$patterns = array();
$replacements = array();
$patterns[] = "#[img](.*?)[/img]#si";
$replacements[] = "<img src="1" border="0" />";
$patterns[] =
"#[email=([a-z0-9&-_.]+?@[w-]+.([w-.]+.)?[w]+)]([a-z0-9&-_.]+?@[w-]+.([w-.]+.)?[w]+)[/email]#si";
$replacements[] = "<a href="mailto:1">1</a>";
$patterns[] = "#
([^ "nrt<]*?)#is";
$replacements[] = "<a href="1" target="_blank" class="mb_link">1</a>";
$patterns[] = "#
*?)](.*?)#is";
$replacements[] = "<a href="1" target="_blank" class="mb_link">2</a>";
$patterns[] =
"#[email=([a-z0-9&-_.]+?@[w-]+.([w-.]+.)?[w]+)](.*?)[/email]#si";
$replacements[] = "<a href="mailto:1">3</a>";
$text = preg_replace($patterns, $replacements, $text);
return $text;
}
?>[/php:1:5aef850481]
Ktoś już dał ten kod ale nie pamietam kto