內容簡介
skydrv-hotlink 是一個 WordPress 外掛。
Onedrive 是 Microsoft 提供的基於雲端的儲存服務,可以在 http://onedrive.com 中使用。它是免費的,運作得非常好,並與 Microsoft Office 和 Windows 完美整合。以前它被稱為 Skydrive。
問題在於 Onedrive 不易為位於其中的文件提供直接下載連結。假設您想分享在 Skydrive 中存在的文件。您點擊 "分享 "按鈕,Skydrive 給你一個鏈接,然後你可以嵌入任何網頁。
但是,該鏈接不是您要共享的文件的直接下載鏈接。實際的下載鏈接將被嵌入到該頁面中。點擊 Onedrive 提供的 "分享 "鏈接將將用戶帶到 Onedrive,其中他們需要點擊另一個鏈接來下載文檔。
這很好,但在某些情況下,對用戶來說可能不太方便。
這個插件允許 WordPress 博客消除額外的跳躍。
它可以自動將 Onedrive 文檔的鏈接轉換為直接下載鏈接。
它的工作方式如下:
登錄 Onedrive。
選擇要共享的文件。
點擊 "分享 "按鈕。 (見截圖 #1)
複製(Ctrl-C)該特定文件的鏈接。不要使用 URL 縮短程式。鏈接應該長得像這樣:
https://onedrive.live.com/redir?resid=842434EBE9688900!1169&authkey=!AA4kWNcMStEjSUg&ithint=file%2c.pptx
或是像這樣:
https://onedrive.live.com/redir?resid=842434EBE9688900!1123
在 WordPress 的文章或頁面中插入一個錨點標籤;指定該值作為 href。它應該長得像這樣:
< a src=’https://onedrive.live.com/?id=842434EBE9688900!1123&cid=842434ebe9688900#’
class=’skydrv-hotlink’>下載文件</ a >
標記是常規的 HTML 標記,但錨點必須使用特殊類別 'skydrv-hotlink' 進行裝飾。 (見截圖 #2)
當實際頁面或文章被呈現時,插件將將 href 轉換為直接下載鏈接。轉換後的 href 將長得像這樣:
https://pszy1q.bay.livefilestore.com/y1p…many characters…Qgg/Dino%20Chiesa%20-%20Resume.docx
當用戶點擊該鏈接時,它將直接下載該文件。
注意:直接下載鏈接的有效期有限,因此您不應無限期地保留它。事實上,這就是本插件存在的全部原因。設置插件的緩存週期以設定任何鏈接的壽命。一般來說,我發現連結至少可以保持一個小時。
依賴關係
此插件依賴於 jQuery。
因此,查看您的 WordPress 博客的用戶端必須啟用瀏覽器端 JavaScript。
目標文檔的發布者必須擁有 Onedrive 帳戶。
WordPress 主機必須允許外向 http 連接。(大多數情況下為 true)
WordPress 必須配置為啟用無反應性頁面請求。 (大多數情況下為 true)
PHP 應該啟用 mcrypt。如果沒有啟用,插件的操作將不太安全。
感謝
謝謝您的關注!
您可以在 http://dinochiesa.github.io/Skydrv-hotlink-Donate.html 上捐贈。
查看我的所有插件:
https://wordpress.org/extend/plugins/search.php?q=dpchiesa
-Dino Chiesa
外掛標籤
開發者團隊
原文外掛簡介
skydrv-hotlink is a WordPress Plugin.
Onedrive is a cloud-based storage service offered by Microsoft, accessible at http://onedrive.com . It’s free. It works nicely and integrates well with Microsoft Office and Windows. Previously it was known as Skydrive.
One problem is that Onedrive does not easily provide direct-download links for the files located on onedrive. Suppose you would like to share a document that exists on your Skydrive. You click the “share” button, and Skydrive gives you a link which you can then embed into any web page.
But, that link is not a direct-download link for the file you intend to share. The actual download link will be embedded within that page. Clicking the “share” link provided by onedrive takes the user to onedrive, where they need to click another link to download the document.
This is fine, but perhaps not as convenient as it could be for users, in some cases.
This plugin allows a wordpress blog to eliminate that extra hop.
It automatically convert links to Onedrive documents into direct-download links.
The way it works:
You login to Onedrive.
Select the file you would like to share.
Click the “share” button. (see screenshot #1)
Copy (ctrl-C) the link for that particular file. Don’t use the URL shortener. The link should look something like this:
https://onedrive.live.com/redir?resid=842434EBE9688900!1169&authkey=!AA4kWNcMStEjSUg&ithint=file%2c.pptx
or like this:
https://onedrive.live.com/redir?resid=842434EBE9688900!1123
Insert an anchor tag into one of your wordpress posts or one of your
wordpress pages; specify that value as the href. It should look like
this:
< a src=’https://onedrive.live.com/?id=842434EBE9688900!1123&cid=842434ebe9688900#’
class=’skydrv-hotlink’>Download the file a >
The markup is regular HTML markup, but the anchor must be decorated with the special class ‘skydrv-hotlink’. (see screenshot #2)
When the actual page or post is rendered, the plugin will transform the href into a direct-download link. The transformed href will look something like this:
https://pszy1q.bay.livefilestore.com/y1p…many characters…Qgg/Dino%20Chiesa%20-%20Resume.docx
When the user clicks that link, it will download the file directly.
Note: The direct-download link has a limited lifetime, so you should not retain it indefinitely. In fact that is the entire reason this plugin exists. Set the cache period for the plugin to set the lifetime of any link. Generally, I’ve found that links are good for at least an hour.
Dependencies
This plugin relies on jQuery.
Therefore the user viewing your wordpress blog must have browser side Javascript enabled.
The publisher of the target document must have a Onedrive account.
The wordpress host must allow outgoing http connections. (true in most cases)
WordPress must be configured to enable curl. (true in most cases)
PHP should have mcrypt enabled. If not, operation of the plugin is less secure.
Thanks
Thanks for your interest!
You can make a donation at http://dinochiesa.github.io/Skydrv-hotlink-Donate.html
Check out all my plugins:
https://wordpress.org/extend/plugins/search.php?q=dpchiesa
-Dino Chiesa
