Changed my check for mainfile from using the id to using path and filename, as this is what's relevant for our use. (If someone erases and re-uploads a modified version of a site, all ID numbers will change, and chaos will ensue. If we change paths then we expect to have to change the references to them, so no biggie.)
changed check for if $file is set
I've started working on adding the resource selection capability.
I've added a select box, and I have it calling a function to produce it's list of options, but the function is incomplete.
My selectbox now has a list of the resource names, but it doesn't pass any useful values.