@Vlad:
Sorry for the late reply. I was kind of busy with other stuff like work, family, etc
I Tested the new version with your suggestions. On my Synology DS212+ (DSM 4.0-2198)
Open_Base_Dir:
Good suggestion. I removed my mount point and I can access the database outside the webroot without problems. I get a list of books and I can zoom into the metadata for details.
With respect to downloading I have less good results. My findings:
1) When requesting a list of books I get an overview with titles, accompanied with a cover photo on the left hand side.
2) When selecting the Photo to get a detailed view in the fancyapps I only get a window stating "The requested content cannot be loaded. Please try again later".
3) When fetching a fancybox for the book details, the stylesheet is still not working properly. Text is flowing outside the fancebox.
4) When fetching a book in the way suggested by you the PRS-T1 downloads "fetch.php itself in stead of the book.
5) When fetching a book through a regular browser (IE9 on Win7) I download the proper title "bookname.epub" but the file has a 0kb file size.
It surprises me that you manage to download files with X-Sendfile, because (to my limited knowledge) this package is not included in the standard Apache webserver of the Synology.
I'll try to figure out how to fix this. Basically when I can access the database through Open_Base_dir in stead of an external directory mounted in my webroot everything should be the same.
Regards,
Northguy