[RESOLVED] How to write tag code
I am writing a help-desk sort of software in PHP strictly for the internal use of the company I work for. It is along the lines of a forum except that it's not conversation based. It had to have very specific fields, forms, and functions so unfortunately I have had to write this from the ground up.
Anyway, in this project of mine, people can post information very much like the vBulletin form I'm writing this post in now. And in my project, I'd like to make it easy for people to format their post with bolds, italics, underlines, colors, and post things such as URLs and email addresses easily without having to know HTML code. But I have no idea how.
Now I'm not asking for someone to post vBulletin's source code, I'd rather write my own. However, I'd be grateful if someone could help me get started by telling me how to get this done. I'm pretty sure that I have to use another scripting language like VBScript.
Any ideas? Thanks :wave:
Re: How to write tag code
Re: How to write tag code
Re: How to write tag code
Hmm, it shouldn't be, looks like my subdomains got stuffed up again.
It's now here:
http://dev.penagate.com/php/bbparser/bbcode.phps
Re: How to write tag code
kasracer, thanks, that's a great post!
Re: How to write tag code
This code looks great and I plan on using it; however, I'm not so sure it answers my original question for this post. Your code looks like it takes a post from --let's say, an SQL datbase or something-- and formats it to XHTML for presentation to the user.
What I want to do is go the other direction. I'd like to have Bold, Italic, and Underline buttons next to my <textarea> so that when the user clicks the one of the buttons, it somehow inserts the [ bold ] into the <textarea>.
For example, the source code on the "Reply To Thread" page has this vbcode reference
HTML Code:
<a href="#" onclick="return vbcode('B', '')" accesskey="b">
What might an example of that code look like?
Re: How to write tag code
Then you're looking for JavaScript and not PHP. I'd suggest posting in the correct forum.