SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Ubb code

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Vlak
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ubb code

    Hi,
    I am having some problems with my ubb code.
    When people dont exit there ["quote"] (It also happens here!) the layout gets messed up.

    I have this now:
    PHP Code:
            $bericht str_replace("[quote]""<table class=body width=\"100%\" cellspacing=\"1\" cellpadding=\"2\"><tr><td><b>Quote:</b></td></tr><td style=\"BORDER-RIGHT: #CCCCCC 1px solid; BORDER-TOP: #CCCCCC 1px solid; BORDER-BOTTOM: #CCCCCC 1px solid; BORDER-LEFT: #CCCCCC 1px solid\">"$bericht); 
            
    $bericht str_replace("[/quote]""</td></tr></table>"$bericht); 
    Als the quote in an quote has to work.

  2. #2
    SitePoint Member
    Join Date
    Jan 2005
    Location
    franklin
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $string 'This is [b]cool[/b] - [url=http://www.somesite.com]Somesite[/url] 
    $replace = array ('
    /(\[[Bb]\])(.+)(\[\/[Bb]\])/','/(\[url=)(.+)(\])(.+)(\[\/url\])/');
    $replacements = array ('
    <b>\\2</b>','<a href="\\2">\\4</a>');
    $string = preg_replace($replace, $replacements, $string);
    echo $string; 
    doing BB Code like that this is often better, if they don't include both tags it won't do anything to the text...

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Vlak
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does any one has a full working ubb code?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •