Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
BBCODE
#8
Kod:
function BBCode($tekst){
    $tekst = nl2br($tekst);
//    $tekst = htmlspecialchars($tekst);
        $tekst = preg_replace("#\[b\](.*?)\[/b\]#si",'<b>\\1</b>',$tekst);
        $tekst = preg_replace("#\[i\](.*?)\[/i\]#si",'<i>\\1</i>',$tekst);
        $tekst = preg_replace("#\[u\](.*?)\[/u\]#si",'<u>\\1</u>',$tekst);
        $tekst = preg_replace("#\[s\](.*?)\[/s\]#si",'<s>\\1</s>',$tekst);
        $tekst = preg_replace("#\[img\](.*?)\[/img\]#si",'<img src="\\1" alt="wstawka_img" class="wstawka" />',$tekst);
        $tekst = preg_replace("#\[img=(.*?)\](.*?)\[/img\]#si",'<img src="\\2" width="\\1" alt="wstawka_img" class="wstawka" />',$tekst);
//      $tekst = preg_replace("#\[img=\=(.*?)\](.*?)\[/img\]#si",'<img src="\\3" width="\\1" style=\"float:\\2;\" alt="wstawka_img" class="wstawka" />',$tekst);

        $em=array
                (
                ':D' => 'images/emoty/icon_biggrin.gif',
                ':lol:' => 'images/emoty/icon_lol.gif',
                ':)' => 'images/emoty/icon_smile.gif',
                ';)' => 'images/emoty/icon_wink.gif',
                ':(' => 'images/emoty/icon_sad.gif',
                ':oops:' => 'images/emoty/icon_redface.gif',
                ':o' => 'images/emoty/icon_surprised.gif',
                ':?:' => 'images/emoty/icon_question.gif',
                ':?' => 'images/emoty/icon_confused.gif',
                '8)' => 'images/emoty/icon_cool.gif',
                ':x' => 'images/emoty/icon_mad.gif',
                ':shock:' => 'images/emoty/icon_eek.gif',
                ':cry:' => 'images/emoty/icon_cry.gif',
                ':P' => 'images/emoty/icon_razz.gif',
                ':evil:' => 'images/emoty/icon_evil.gif',
                ':twisted:' => 'images/emoty/icon_twisted.gif',
                ':roll:' => 'images/emoty/icon_rolleyes.gif',
                ':wink:' => 'images/emoty/icon_wink.gif',
                ':!:' => 'images/emoty/icon_exclaim.gif',
                ':idea:' => 'images/emoty/icon_idea.gif',
                ':arrow:' => 'images/emoty/icon_arrow.gif',
                ':|' => 'images/emoty/icon_neutral.gif',
                ':green:' => 'images/emoty/icon_mrgreen.gif',
                ':+:' => 'images/emoty/icon_plus.gif',
                ':-:' => 'images/emoty/icon_minus.gif',
                ':*:' => 'images/emoty/icon_point.gif'

                );

        foreach ( $em as $smile=>$adres)
                {
                $tekst = str_replace( $smile , '<img src="'.$adres .'" alt=">>emotka<<" />', $tekst );
                };

return($tekst);
}
Masz pełny kod Smile
Odpowiedz


Wiadomości w tym wątku
BBCODE - przez michalszyd - 25-01-2009, 20:00
RE: BBCODE - przez dziamber - 25-01-2009, 20:40
RE: BBCODE - przez IcePenguin - 26-01-2009, 18:27
RE: BBCODE - przez dziamber - 26-01-2009, 19:17
RE: BBCODE - przez michalszyd - 28-01-2009, 22:36
RE: BBCODE - przez fannet - 31-01-2009, 10:20
RE: BBCODE - przez dziamber - 31-01-2009, 12:43
RE: BBCODE - przez jsmp - 31-01-2009, 22:23
RE: BBCODE - przez michalszyd - 01-02-2009, 13:13

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl