Jump to content

bb codes


Recommended Posts

ok im putting together a tutorial script, that will let people submit tutorials, and read tutorials.

I wanted to know if there was a bbs code script made already, so all i have to do, is include it on the page that converts bb code to html.

if you know of any it would be a great help!

Thanks! [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]
Link to comment
Share on other sites

  • 3 weeks later...
$text=str_replace('[b]', '<b>', $text);
    $text=str_replace('[/b]', '</b>', $text);
    $text=str_replace('[s]', '<del>', $text);
    $text=str_replace('[/s]', '</del>', $text);
    $text=str_replace('[i]', '<i>', $text);
    $text=str_replace('[/i]', '</i>', $text);
    $text=str_replace('[u]', '<u>', $text);
    $text=str_replace('[/u]', '</u>', $text);
    $text=str_replace('[url', '<a href=', $text);
    $text=str_replace('[/url]', '</a>', $text);
    $text=str_replace('[size', '<font size"', $text);
    $text=str_replace('[/size]', '</font>', $text);
    $text=str_replace('[color', '<font color', $text);
    $text=str_replace('[/color]', '</font>', $text);
    $text=str_replace('[img]', '<image src=', $text);
    $text=str_replace('[/img]', '>', $text);
    $text=str_replace('[list]', '<ul>', $text);
    $text=str_replace('[/list]', '</ul>', $text);
    $text=str_replace('[*]', '<li>', $text);
    $text=str_replace('[/*]', '</li>', $text);
    $text=str_replace('[list=1]', '<ol>', $text);
    $text=str_replace('[/list=1]', '</ol>', $text);
    $text=str_replace('[quote]', '<blockquote>', $text);
    $text=str_replace('[/qoute]', '</blockquote>', $text);
    $text=str_replace('[php]', '<image src="php.gif" alt=php banner><code>', $text);
    $text=str_replace('[/php]', '</code>', $text);
    $text=str_replace('[sql]', '<image src="sql.gif" alt=sql banner><code>', $text);
    $text=str_replace('[/sql]', '</code>', $text);
    $text=str_replace('[c]', '<image src="c.gif" alt=c banner><code>', $text);
    $text=str_replace('[/c]', '</code>', $text);
    $text=str_replace('[html]', '<image src="html.gif" alt=html banner><code>', $text);
    $text=str_replace('[/html]', '</code>', $text);
    $text=str_replace('[js]', '<image src="js.gif" alt=php banner><code>', $text);
    $text=str_replace('[/js]', '</code>', $text);
    $text=str_replace(']', '>', $text);
Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.