Its sounds as if you have the database set up correctly so you should be in good shape in that area. To display this I would query the db, and store all the rows in an array. Then take the array and search for the first main directory, then its sub categories and then the sub categories subs, and then move back to the next category and continue on like that. The reason for thearray is so that you are not having 8 or 12 queries to your db which would take a lot more time to run.
SELECT parent.name AS parent, category.name AS category, page.name AS page
FROM pages_table AS page,
LEFT JOIN categories_table AS category
ON page.categoryid = category.categoryid
LEFT JOIN parent_table AS parent
ON category.parentid = parent.id
You'll have to modify the above query to reflect the proper table and column names before it'll work. It's a pretty generic join too, you may want to look into the link above it and see if there's something that suits your taste or needs a little more closely - the above should give you a result set with 3 columns, and a row for every page that's in your database. Each row will include a column detailing which category that page belongs to, and in turn what parent category that belongs to. How you display the output is up to you, but all the data should be there to do it however you like.