
a sam bbcode dziala poprawnie bo wszystko ladnie zamienia
<? // bbcode Function bbcode($text){ // usun zbedne // Kolorowanie składni // Odnośnik e-mail(własne definiowanie wyświetlanego tekstu) $text = preg_replace("#[email=([a-z0-9-_.]+?)@([w-]+.([w-.]+.)?[w]+)?(.*?)](.*?)[/email]#i", "<a href="mailto:1@2">5</a>", $text); // Odnośnik, otwieranie w nowym oknie // Odnośnik, otwieranie w nowym oknie, definiowanie treści odnośnika // Odnośnik, otwieranie w tym samym oknie // Odnośnik, otwieranie w tym samym oknie, definiowanie treści odnośnika // Automatyczne tworzenie linków $text = preg_replace_callback("#([n ])([a-z]+?)://([a-z0-9-.,?!%*_#:;~&$@/=+]+)#si", "bbcode_autolink", $text); $text = preg_replace("#([n ])www.([a-z0-9-]+).([a-z0-9-.~]+)((?:/[a-z0-9-.,?!%*_#:;~&$@/=+]*)?)#i", " <a href="http://www.2.34" target="_blank">www.2.34</a>", $text); $text = preg_replace("#([n ])([a-z0-9-_.]+?)@([w-]+.([w-.]+.)?[w]+)#i", "1<a href="java script:mailto:mail('2','3');">2_(at)_3</a>", $text); // Ukrywanie treści // Pogrubiony tekst // Pochylony tekst // Podkreślony tekst // Pomniejszanie tekstu // Powiększanie tekstu // Akapit // Akapit z wyrównaniem // Wyśrodkowanie tekstu // Kolor tekstu // Wielkość czcionki // Obrazek // Obrazek z katalogu img $text = preg_replace("#[ftp_img](.*?)[/ftp_img]#si", "<img src="img/1" border="0" alt="Obrazek" />", $text); // Obrazek Lewo $text = preg_replace("#[img:left](.*?)[/img]#si", "<img align="left" src="1" border="0" alt="Obrazek" />", $text); // Obrazek z katalogu img Lewo $text = preg_replace("#[ftp_img:left](.*?)[/ftp_img]#si", "<img align="left" src="img/1" border="0" alt="Obrazek" />", $text); // Obrazek Prawo $text = preg_replace("#[img:right](.*?)[/img]#si", "<img align="right" src="1" border="0" alt="Obrazek" />", $text); // Obrazek z katalogu img Prawo $text = preg_replace("#[ftp_img:right](.*?)[/ftp_img]#si", "<img align="right" src="img/1" border="0" alt="Obrazek" />", $text); // Obrazek Center $text = preg_replace("#[img:center](.*?)[/img]#si", "<img align="center" src="1" border="0" alt="Obrazek" />", $text); // Obrazek z katalogu img Center $text = preg_replace("#[ftp_img:center](.*?)[/ftp_img]#si", "<img align="center" src="img/1" border="0" alt="Obrazek" />", $text); // Pozioma linia // Spacja // Znaki specjalne // znaki specjalne // błędne kodowanie m.in. z phpmyadmina // znaki specjalne z m$ word $text = str_replace('„', '"', $text); // Wykonaj html // Kod // Kod, podany autor // Cytat $text = preg_replace("#<!--quoteo--><div class='quotetop'>CYTAT</div><div class='quotemain'><!--quotec-->(.*?)<!--QuoteEnd--></div><!--QuoteEEnd-->#si", "<p class="cytat">1</p>", $text); // Cytat, podany autor $text = preg_replace("#<!--QuoteBegin-(http://)?(.*?)+--><div class='quotetop'>CYTAT((http://)?(.*?))</div><div class='quotemain'><!--QuoteEBegin-->(.*?)<!--QuoteEnd--></div><!--QuoteEEnd-->#si", "<p class="cytat">2: 3</p>", $text); // Lista // Odnośnik e-mail $text = preg_replace("#([a-z0-9-_.]+?)@([w-]+.([w-.]+.)?[w]+)#i", "<a href="mailto:1@2">1@2</a>", $text); // kolejny wiersz // kodowanie kodu // js // wynik return $text;} ?>