Operate a community website that allows users to upload photos to personal galleries. The front end of the site is complete and working? we need a few admin tools that will do the following:
1) Allow us to view photos by userID and galleryID and delete individual files from both the database and the server.
2) Allow us to delete entire individual user galleries (and associated photos) from the database and server.
3) Allow us to delete all photos associated with a particular userID from the database and the server.
4) Provide photo statistics, such as how many photos a particular user has uploaded, the number of galleries he has, and allow us to sort these based on number of photos.
The database is in MySQL and the photos themselves are stored as files on the server.
In addition, we'll require a script to remove ?orphan? photos from the database and server. There are certain user_albums that have been deleted, but the db entries for their associated user_images still remain. We need a script to clear those out and to check the files on the server to be sure they are removed there as well.