Page 1 of 1

implemet bb code

Posted: Thu Jun 05, 2003 6:27 pm
by thebay
Can anyone give me an example how to use phpbb.

Actually just like this forum's stile...

I want implement somthing for text input.

In order the customer can input html tags, such as bold, italic easily, I want to show a tool bar on top of the text area, then users just input the sentence, if they want "bold" certain word, just highlight it, then click the icon of "bold", then the sentence will be added <bold> the word</bold> automatically..

Anyone has an idea how I implement such function

Posted: Thu Jun 05, 2003 6:33 pm
by m3mn0n
ereg_replace()

Search for any tag you create, such as [bold] and [/bold]. Then replace it with the HTML tag for that specific code, in this case <b> and </b>.

That how I did it for a forum system i created. It works great for smilies too. Search for the text combo :) and then display <img src="images/smile.jpg">, for example.

Posted: Fri Jun 06, 2003 3:39 am
by twigletmac
Since phpBB is opensource you can always download their code and see how they did things:
http://www.phpbb.com

Mac

Posted: Fri Jun 06, 2003 3:41 am
by volka
and there are many more free implementations of BBCode, e.g. check http://www.hotscripts.com

Posted: Fri Jun 06, 2003 4:29 am
by patrikG
And if you still need more info, have a look at this thread http://www.devnetwork.net/forums/viewtopic.php?t=9396