Display beautiful digital books based on Google Drive
Setup:
-
Setup Google v3 API for PHP, Web Server
https://developers.google.com/drive/v3/web/quickstart/php
When done you will have the fileclient_secret.json
and a foldervendor
with all required libraries. -
Change your manager password in
custom/config-default.json
atmanager_password_md5
(stored as MD5 hash). -
Visit the
manager.php
page. Use the password you just set.
Click Validate Google Auth. You will have to follow a link, approve API access, and enter the token back inside the box.
Click Validate Google Auth again, and make sure you get the OK.
Click clear cache (file, list)
Click Test cache (file, list) and make sure you get the OK.
Click Edit Configuration.
Notes:
- Before uploading the DOCX files to Google Drive folder make sure to check automatic conversion of DOCX files to Google Drive files.
- Requires PHP 5.5 or higher
- JSON files must be strict - meaning no comments, no ending commas.
- Doc files must have view permission to the Google user, and must be in Google-Doc format (not Word).
- Before first run please visit the
manager.php
page, validate Google API, test and reset cache folders. - You can add additional config files in custom folder, for example
custom/config-xxx.json
; and access custom configs via search query"?cfg=xxx"
. Thecustom/config-default.json
file is loaded first in any case. Try adding "?cfg=myCustomConfig" for example (see the window title changes).
Configuring the toolbar:
You can choose which buttons will go to which one of the four availalbe toolbars.
The buttons names are keys in the global var tb_items
.
See toolbar.js
Each item element can have the following optional properties.
icon: 'fa-icon'
classname of the icon, expected to be a fontawesome class. see http://fontawesome.io/icons/init: function(item)
will trigger on page loadf: function(item)
will trigger on button clicktoggle: true
if the button has two states. seeactive
andicon_active
active: function(item)
return weather the item is currently on active stateicon_active: 'fa-icon-alt'
classname for when the button is active (optional)
Adding AddThis sharing service:
-
Go to AddThis.com, sign up or log in to your account
-
Go to Tools and add:
- Share Button
- Type: Inline
- Configure them however you see fit
-
Make sure there are not other tools except one inline
-
Save and copy the code
-
On the management panel find "AddThis Inline Code" and paste the code
Adding an audio MP3 file that will be added to the page
- Go to the Google Drive folder and upload an MP3 or OGG file that has the exact same name as the DOCX file. For example "127.docx" and "127.ogg"
Adding footnotes*
- Edit the file with Google Docs, go to Insert>Footnote