Surely someone else will have written an open-source document management system with a tree heirarchy... but I can't find one. So I wrote one. I'm glad I did, actually, because I enjoyed it and I quite like the result (and hopefully others will too!). Nice and simple, but I used the opportunity to teach myself about mod_rewrite (so that a url of http://.../doc56 will really fetch http://.../main.php?id=26), how to design a site with no tables and lots of CSS, and also about cache controls (to make the site nice and speedy by caching the bits that won't change often, even though PHP doesn't usually do that).
I also made use of Mozilla's prefetching features. These are quite amazing, and really can make the site lightning-fast. Whilst you're reading a page, Mozilla will be fetching related pages (i.e. those on the same level in the heirarchy, or the level below). The pages are all tiny, but having them already in cache does still give a noticable improvement - it cuts the page load time from a couple of seconds down to almost zero.
Ooh, scary. Only two-and-a-half more days of school ever. (Not counting the exams...)
Some truly amazing ideas have arisen on what we can do to our favourite Scottish maths teacher, but due to reasons of secrecy, these cannot yet be revealed :-)