Show book cover
6 posts
• Page 1 of 1
I see that it is possible in some way to add a cover to your book record. However, where and how can i add such a cover? I'm used to work in php but don't have any experience in the code presented here.
since my covers are all called isbn.jpg it's easy to bypass mysql and just ask for the isbn from this specific record and add .jpg at the end. However, where and how can I show a certain field from the specifik form I'm watching. I also have thumbnails for the view:browse. However, if I have an answer on previous question i'll figure this out myself.
Hi, I originally had a book cover feature but removed it because the people who were going to be using it at first, didn't want it.Ê If you have all of the book covers in an easy form as you say, then it wouldn't be too hard to re-add this.Ê The easiest way is to probably add a column to the books table for the cover art.Ê Then implement an htmlValue method in books delegate class (tables/books/books.php) for the column to make sure that it is displayed as an image. You'll notice remnants of the old columns named cover_art_url_large, cover_art_url_medium, and cover_art_url_small that are already in the fields.ini file and the books.php file. To make life easier, you may want to just name your field cover_art_url_large so that it will pick up the existing settings.Ê Then you should be able to do one big SQL query on the database to populate that field with the correct cover art url values. You can alter the cover_art_url_large__htmlValue() method as required to make the output how you like. -Steve
I made it myself easy and added the following line on the place of the missing_logo.gif in Dataface_View_Record.html
val('isbn')}.jpeg" style="max-width:180px"/> All I needed was $record->val($var) since my covers are all isbn.jpeg It's not a clean code since only me (and other administrators) can add covers (ftp) and there is no replace image, however, my aim is to add a cover for every book so this is more a push for me to be sure I'll find a cover (by now it's only about 300-400 books). I see dataface supports uploading files and so on but this line is more than enough for my small library. Thanks for your fast reply ! Denis
After experimenting more with dataface I really start loving this application.
So I added widget:type = file to be able to upload files trough dataface. However, there I found a bug (I think). I did everyting which is written here: http://framework.weblite.ca/documentation/how-to/how-to-handle-file-uploads This didn't work (it handled it just as if it was a blob, and by taking the blob-way i couldn"t upload because it asked for required field cover_mimetype and cover_filetype) untill I changed the name from cover to PDFOutline This is not a big problem since nobody knows the table name, but it's a weird big ( ? ).
I replied to the comment on that you left on that tutorial page. There is no bug, though. Yoiiur problem was that you specified the 'Type' parameter in the fields.ini file as 'type'. It needs to be 'Type' and not 'type'.
Case sensitivity... -Steve
6 posts
• Page 1 of 1
Return to Library DB Discussion Who is onlineUsers browsing this forum: No registered users and 2 guests |