Re-building the actual forum?

I know how to (and I have) properly skinned the forum, but I don't know the structure of it well enough to change what I need to change.

I pretty much just want to change the "meat" of the page. The way the forums are displayed and the text and stuff. I want to properly indent all the code and validate it (quotes), but I can't find (like I said), where to change the actual "meat" of the forums (not the header and footer)...

What file do I go to to change this?

Is there a guide I can go that will show me what parts are in what files? Such as, where to go to change the quick message post, where to go to change the meat, where to go to change the login form at the top of the page, etc.

Also, which files have the queries to insert user info into the database?

I plan on integrating the user system in minibb into my own site, and I want to mimic their login information and queries on my site so you can login elsewhere on my site (so I can have the username/login option in the header, rather than in the forum).