這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Dan's Viewer for Google Drive

描述

Dan’s Viewer for Google Drive was created when I was looking for a way to share files via Google Drive on my sites, in a way that allowed downloading, viewing, exporting, and hardest to find, the ability drill down into subfolders without leaving the site. I couldn’t find anything within my price range that fit what I needed, so I decided to create my own.

Dan’s Viewer for Google Drive displays files in a way that is mobile friendly, customizable via shortcode, and easy to style. No need to import files or manage them directly in WordPress. All you need is a public Google Drive Folder (or multiple!) and a free, easy to get API key.

Features

  • Displays public drive document listings in a mobile friendly format

  • Offers both View and Download Options, where appropriate

  • Offers Export Option for Google Docs / Sheets / Presentations

  • All options are configured via shortcode

  • Allows drill down / up within folders without leaving the page

  • Ability to store and use unlimited Google Drive Folders

Shortcodes:

  • Default Display [dandrive] (defaults to 1st drive)

  • Optional Attributes Ex:[dandrive drive=1 divid=mydrive height=400 width=300 rbutton=no]

  • drive= (number of the drive you want, defaults to 1 if not entered)

  • divid= (id of the div your calendar is stored in, for custom theming. Defaults to random string to allow multiple per page)

  • height= (maximum height in pixels, defaults to auto. If this is set, a scroll bar will appear if your div overflows. Enter a number only).

  • width = (maximum width in pixels, defaults to 400. Enter a number only)

  • rbutton = (no means don’t display return to initial folder button. Omit to display (default behaviour))

For help creating an API key to use with this plugin, either check out the settings page in plugin, or the FAQ tab here.

To see other plugins like this, or tips on how these are built, check out my site.

Thanks to Mike @ WP Bullet Guides for the banner and icon.

Dependencies and Liscencing

Depends on Google Drive’s JavaScript API v4

螢幕截圖

  • View of Shared Folder with View / Download

  • Settings Page

安裝

  1. Upload the plugin files to the /wp-content/plugins/dans-gdrive-viewer directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Head over to the Dan’s GDrive settings page, found on the Dashboard sidebar.

常見問題

How do I create my API key?

To create API key, visit Google Developers Console. https://console.developers.google.com/
Then, follow bellow;

  • Create new project (or use project you created before).

  • Check “APIs & auth” -> “Credentials” on side menu.

  • Hit “Create new Key” button on “Public API access” section.

  • Choose “Browser key” and keep blank on referer limitation.

  • Set this key on the plugin’s setting page.

How do I find the ID for the folder I want to share?

Once you have set the folder as public, you can find the id with the following:

  • Visit https:/drive.google.com/, while logged in to your account.

  • Enter the folder that you have shared publically

  • Find the folder ID from the url, after the /folders/. Example: https://drive.google.com/drive/u/0/folders/xxxxxxxxxxxxxxxx , where xxxxxxxxxxxxxxx is the key.

評價

2023年10月8日
Thank you for having such a determination. The plugin is doing its job. No much fancy, but graet for what is required. Keep up and what’s more, adding get background from current theme (instead of black) and Folder Icon view can make it look aesthetically worthy. Regards
2021年1月3日
Just want to spend some time to say thank you. It is simple and neat and meets my need.
2019年10月25日
I had some difficulty activating it and at the beginning I only saw the message “Loading drive folder”, it was because although I had correctly put the Google Drive API Key and Google Drive ID in the plugin configuration, the Google Drive API of the project was not activated in the Google APIs console. It is also important to confirm that the Google Drive folder is public public. In my case, once this is solved, the plugin works very well. Excellent work Dan!
閱讀全部10個評價

貢獻者及開發者

“Dan's Viewer for Google Drive” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Dan's Viewer for Google Drive 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.2

  • Check with latest version of WP
  • Minor fixes

1.1

  • Moved Dashboard Link Under Tools
  • Added jQuery dependency to enqueues
  • Updated Supported Version

1.0

  • Initial Plugin Release