[eluser]darkhouse[/eluser]
I just quickly looked at the first bit of your forum model and noticed something. You're selecting all categories, then looping through each one selecting all of the threads in each category and adding the num_rows as numThreads to each category, then doing the same thing again for posts and adding the num_rows as numPosts to each category.
It probably doesn't make much difference now, but in the future if your forum is popular you could potentially be selecting many thousands of records here. This could end up taking a very long time to process each page request and your forum could become unusable. A much better solution is to let your database do all the work by using teh COUNT function.
Now I haven't tested this code, it's possible it might be a little more complex than what I've got here. You might need to use a subquery or something, but I'm sure it's very possible to get everything you want in one SQL statement and that will greatly reduce the load when you have a lot of data.
Code:
$sql = "SELECT c.*, COUNT(t.id) numThreads, COUNT(p.id) numPosts
FROM fm_categories c
JOIN fm_threads t ON t.categoryID = c.id
JOIN fm_posts p ON p.threadId = t.id
GROUP BY t.id, c.id";