I would go about it so you have a blank template page with the basic HTML & CSS with nothing on it but the basic website template.
Then when each blog/forum posts loads (through PHP) onto this template page. Thus only needing one template page which could load 1000s of different forum posts.
So break down:
- You click on this forum post.
- This thread has an ID 273127
- Everything stored in the table with the ID 273127 is echo'd in a predefined format.
-Everytime theres a post a new unique ID is made which everything is normally stored.(Including HTML code to be displayed).
WebJoel described a HTML editor its like word but it does the code. CKeditor is one.