SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru DeNasio's Avatar
    Join Date
    May 2001
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Converting BB code to HTML code?

    Hello guys,

    I want to disable posting HTML code on my message boards and enable posting BB code.
    Converting [ b]This is sample text[ /b] into HTML is easy, but some of the codes are harder to convert.

    Can you guys show me the easiest way to convert the following codes?

    1) Convert [ email]user@domain.com[ /email] into user@domain.com

    2) Convert [ email="user@domain.com"]Click here![ /email] or [ email=user@domain.com]Click here![ /email] into Click here!

    Is it possible to create one code that will convert both 1) and 2)?
    Ballot-Box.net - free polls for webmasters
    FormLog.com - free form processor

  2. #2
    SitePoint Member vChris's Avatar
    Join Date
    Jun 2004
    Location
    Canada
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suggest you take a look at this php class:

    http://www.phpclasses.org/browse/package/951.html

    It does exactly what you what you want and also lets you do other kinds of BB codes easily.
    Website Designer/Developer - Graphics/PHP
    Vio Group (Just Launched!!)

  3. #3
    SitePoint Guru DeNasio's Avatar
    Join Date
    May 2001
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vChris
    I suggest you take a look at this php class:

    http://www.phpclasses.org/browse/package/951.html

    It does exactly what you what you want and also lets you do other kinds of BB codes easily.
    This class is like a black box for me, I provide the input and it provides the output but I don't know what's going on inside. I don't know OOP so I don't know what this class does. If I would like to change something then I can't. I like to have full control over my scripts. This means that I must know exactly what the code does and must be able to change things if I wanted to.

    Anyone else have any suggestions?
    Ballot-Box.net - free polls for webmasters
    FormLog.com - free form processor


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
  •