Jump to content


This topic is now archived and is closed to further replies.


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\" /]

Share this post

Link to post
Share on other sites
$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);

Share this post

Link to post
Share on other sites


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.