I am wanting to store user messages in a database. I have read many sites/posts about what would be the correct way of going about this.
There are advocates that say "Write in BBC, parse into HTML and then store" and then there are others that say "Write in BBC and store, then parse into HTML when displaying" and others who just shout "Write and store in HTML but make sure you sanitize"
These are good arguments but which is easier to implement.
I have played with different options and see the good points but do hit obstacles.
So for me to get users to write messages in BBCode is the sensible thing but what to do next.
I need to store the message but I also need to ability to redit the messages at a later time.
Writing and storing as BBC makes the editing process so much easier as no conversion is required.
For extra guidance I looked at how SMF stored it's messages and they are stored at HTML, so the user inputs as BBC and SMF then parsers the BBC into HTML for storing. If a user wishies to edit his message SMF must parser HTML back into BBC.
So I am confused to say the least as to what is a good way. First off if I store as HTML then I need a way to parse into BBC for editing.
I am using nbbc for BBC to HTML parseing but I can not find a good HTML to BBC parser.
Can anyone point me to a parser that can do the HTML to BBC or even both conversions.