1. PHP / Говнокод #3014

    +152.2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    function ShowMsg($text)
    {
        if(session_is_registered('xynta')) $un = base64_decode(strrev($_SESSION['xynta']));
        else $un = "%USERNAME%";
        $text = str_replace("%%USERNAME%%",$un,$text);
        $text = preg_replace("/\[img\](.+?)\[\/img\]/is","<img src=\"\\1\" />",$text);
        $text = preg_replace("/\[bkb\](.+?)\[\/bkb\]/is","<span class=bkb>\\1</span>",$text);
        $text = preg_replace("/\[move\](.+?)\[\/move\]/is","<marquee>\\1</marquee>",$text);
        $text = preg_replace("/\[quote\](.+?)\[\/quote\]/is","<blockquote>\\1</blockquote>",$text);
        $text = preg_replace("/\[center\](.+?)\[\/center\]/is","<center>\\1</center>",$text);
        $text = preg_replace("/\[b\](.+?)\[\/b\]/is","<b>\\1</b>",$text);
        $text = preg_replace("/\[i\](.+?)\[\/i\]/is","<i>\\1</i>",$text);
        $text = preg_replace("/\[u\](.+?)\[\/u\]/is","<u>\\1</u>",$text);
        $text = preg_replace("/\[s\](.+?)\[\/s\]/is","<s>\\1</s>",$text);
        $text = preg_replace("/\[code\](.+?)\[\/code\]/is","<code>\\1</code>",$text);
        $text = preg_replace("/\[effekt\](.+?)\[\/effekt\]/is","<div style='padding: 20px;display:block;'><span id=effekt name=effekt>\\1</span></div>",$text);
        $text = preg_replace("/\[blink\](.+?)\[\/blink\]/is","<span id=blink name=blink>\\1</span>",$text);
        //    $text = preg_replace("/\[flash\](.+?)\[\/flash\]/is","<embed type='application/x-shockwave-flash' width=640 height=480 src=\\1 />",$text);
        $text = preg_replace_callback("/\[mp3\](.+?)\[\/mp3\]/is","mp3_safe_url",$text);
        $text = preg_replace("/\[bg=(.+?)\](.+?)\[\/bg\]/is","<span style='background:\\1'>\\2</span>", $text);
        $text = preg_replace("#\[url\](.+?)\[/url\]#is", "<a href=http://www.dereferer.org/?\\1 target=_blank>\\1</a>", $text);
        if(!strstr($text,"<br")) $text=nl2br($text);
        return $text;
    }

    Запостил: diio, 15 Апреля 2010

    Комментарии (11) RSS

    Добавить комментарий