Hmm, I got it to work fine by replacing the variable in chdir('$directorypath'); with the actual path.
Then I found I had all broken images...so I went and made the images folder an absolute path. Now it seems to work groovy! Gonna experiment with this.
Ok, I'm digging this...but I do have a question. How can I include my own custom templates? Will make the job of making pages far less tedious, as I want parts of the header slightly different than the forum header.