Results 1 to 7 of 7

Thread: PHP - BB

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Mar:2013
    Location: Sofia
    Posts: 33

    Question PHP - BB

    ,

    , BB . , HTML (: <b>Bold</b>) . , <a href="url">TEXT</a>, [ URL="url" ]TEXT[ /URL ] ( , .). HardwareBG phpBB.

    , BB , phpBB .

    , MySQL, :
    id || BB code || html code

    , BB , .
    ALL GREAT THINGS ARE SIMPLE AND MANY CAN BE EXPRESSED IN SINGLE WORDS:
    FREEDOM, JUSTICE, HONOR, DUTY, MERCY, HOPE.
    Winston Churcill

  2. #2
    Registered User iMarh's Avatar
    Join Date: May:2002
    Location:
    Posts: 373
    Code:
    function bbcode2html($strInput) {
    	return preg_replace(
            array(
    		'/\[url\=(\/.*?)\](.*?)\[\/url\]/is',
    		'/\\[img[\\:\\=]((\\"([\\W]*javascript\:[^\\"]*)?([^\\"]*)\\")|'.'(([\\W]*javascript\:[^\\]]*)?([^\\]]*)))\\]/ie',
    		'/\\[b\\]/i', '/\\[\/b\\]/i',
    		'/\\[i\\]/i', '/\\[\/i\\]/i',
    		'/\\[quote\\]/i', '/\\[\/quote\\]/i',
    		'/\\[center\\]/i', '/\\[\/center\\]/i',
    	),
    	array(
    		'<a href="$1">$2</a>',
    		'\'<img src="\'.(\'$4\'?\'$4\':\'$7\').\'">\'',
    		'<b>', '</b>',
    		'<i>', '</i>',
    		'<blockquote>', '</blockquote>',
    		'<center>', '</center>',
    	),
            	$strInput
        );
    }

  3. #3
    Registered User
    Join Date: Mar:2013
    Location: Sofia
    Posts: 33
    , ,
    ALL GREAT THINGS ARE SIMPLE AND MANY CAN BE EXPRESSED IN SINGLE WORDS:
    FREEDOM, JUSTICE, HONOR, DUTY, MERCY, HOPE.
    Winston Churcill

  4. #4
    ! vbTheKing's Avatar
    Join Date: Sep:2003
    Location:
    Posts: 4,138
    . ! , bb . :
    $text = bbcode2html($_POST['user_input']);
    $text html bbcode html.
    ''? * *
    - !
    ...

  5. #5
    An Ocean Soul Guardian's Avatar
    Join Date: Jul:2001
    Location:
    Posts: 1,203
    markdown, BB.

  6. #6
    Registered User
    Join Date: Mar:2013
    Location: Sofia
    Posts: 33
    $_POST['user_input'] , PHP.net preg_replace(); , //, - .
    ALL GREAT THINGS ARE SIMPLE AND MANY CAN BE EXPRESSED IN SINGLE WORDS:
    FREEDOM, JUSTICE, HONOR, DUTY, MERCY, HOPE.
    Winston Churcill

  7. #7
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , wysiwyg .
    Word, .
    tinyMCE.

    , . , .
    - - , .
    preg_replace , "" , - . "" , , , . , .
    Edit: .

    , markitUp .
    , wysiwyg , ( <script ..).
    Last edited by tedych; 21st April 2013 at 22:42.

Posting Permissions

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

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |