Introduction
This plugin allow you to keep track the number of downloads of the specific files by using specific URL and you can display the download count in the post as well.
Installation
- Unzip the file
- Put the folder 'downloadcounter' to /user/plugins and activate it
Once activated, a new table called '{prefix}_download_counter' will be created for the usage of this plugin.
Configuration Option
There is no configuration page for this plugin. All the setup is done through a separate page in the dashboard, please refer to 'Usage' section for details
Usage
After activated it, a new item called 'Downloads' will be appeared in Dashboard as shown below, shortcut key is 'K'.
The details of 'Downloads' page is as follows.
All the files for download will be displayed in this page, each item has the following information.
- Name - It is an identifier that is bold face for you to identify the file
- URL - URL pointed to the file for download
- Creation Time - The creation time of the file, datetime format is same as the one in Habari Options screen
- Last Download Time - The last download time for this file, datetime format is same as the one in Habari Options screen
- Count - No. of downloads of this file
Whenever you want to keep track the download of new file, please click the top button <Add Download Item> and the following screen will be shown.
Key in the information in this screen, please note all the fields are mandatory except 'Last Download Time'. Not all datetime format is supported in the field 'Creation Time' and 'Last Download Time' due to the limitation of PHP DateTime class. Therefore, the input datetime format is standardized to 'YYYY-MM-DD HH:MM' for the sake of conversion.
After you clicked <Save> button, the information of this new file will be shown in 'Downloads' page of Dashboard.
Once you completed the above steps, the new file is ready to be downloaded. But what download link should be used? The publish form has the answer. After the plugin is activated, not only a new item is appeared in Dashboard, new fields is also added to the publish form for you to paste the download link and tag to show download count to the post.
As you can see, 3 controls have been added.
- Download Items - A dropdown box contained all the files for download
- <Download Link> button - Paste the download link of the file selected in 'Download Items' to the post, the format of the link is <URL of your blog>/download/<id of download file>
- <Count Tag> button - Paste the tag that show download count of the file selected in 'Download Items' to the post, the format of the tag is <--download(<id of download file>)-->
Note
- The table '{prefix}_download_counter' created for this plugin WILL NOT be deleted when deactivate the plugin. The reason is to retain the data for future re-activation of this plugin.
- If a non-exist download file id is used in count tag, the download count will be shown as -1
Changelog
- Version 0.5 - Initial release
- Version 0.6 - Fixed the failure of plugin under SQLite and PostgreSQL
- Version 0.7 - Changed the input datetime format of 'Creation Time' and 'Last Download Time' to 'YYYY-MM-DD HH:MM'
- Version 0.8 - Fixed datetime format regex validation and a critical bug prevent the correct saving of the download item
Download
- For Habari 0.7-alpha (trunk) (Downloaded 523 times)
- For Habari 0.6.x (stable) (Downloaded 449 times)
=====================
簡介
這個 plugin 是用作以特定 URL 來設定檔案給用家下載、記錄下載次數的,用家還可以在文章顯示這些檔案的下載次數。
安裝
- 將下載了的 zip file 解壓
- 把 'downloadcounter' folder 放在 /user/plugins 中,然後啟動 plugin
當啟動 plugin 後,會新增一個名叫 '{prefix}_download_counter' 的 table 以供這個 plugin 使用。
設定選項
這個 plugin 是沒有 plugin 設定頁面,所以設定都在 Dashboard 中一個新增的頁面中,詳情請參考下面的“使用方法”。
使用方法
當啟動 plugin 後,Dashboard 會新增一個名叫 'Downloads' 的頁面如下,shortcut 鍵是 'K'。
而 'Downloads' 的頁面是這樣的。
所有可以下載的檔案都會顯示出來,每個檔案皆有以下的屬性。
- Name - 這是用來識別每個檔案的名字
- URL - 下載檔案的 URL
- Creation Time - 檔案的建立時間,日期時間格式和 Habari Options 的設定相同
- Last Download Time - 最後一次下載檔案的時間,日期時間格式和 Habari Options 的設定相同
- Count - 下載次數
當你想新增下載檔案,請 click 最頂的 <Add Download Item> 按鈕,跟著便會顯示以下的畫面。
輸入所需資料,所有項目是必需輸入(除了 Last Download Time),因為 PHP DateTime class 的限制,不是所有日期時間格式都支援,為了轉換的原因,所以 'Creation Time' 和 'Last Download Time' 的日期時間格式統一為 'YYYY-MM-DD HH:MM'。
當你 click <Save> 按鈕後,這個新增的檔案便會顯示在 Dashboard 的 Downloads 頁面內。
當你完成以上步驟,那個新增檔案便可供用家下載了。但應該用什麼 URL 呢?答案就是在發佈文章頁面內。因為當啟動 plugin,不但在 Dashboard 新增 Downloads 頁面,還在發佈文章頁面內增加了新的項目,用來將下載的 URL 和顯示下載次數的標籤貼在文章內。
從上圖看,有 3 個新 fields 加上了。
- Download Items - 一個 dropdown box 內藏所有下載檔案的名字
- <Download Link> button - 將下載的 URL 貼在文章內,格式是 <URL of your blog>/download/<下載檔案的 id>
- <Count Tag> button - 將顯示下載次數的標籤貼在文章內,格式是 <--download(<下載檔案的 id>)-->
注意事項
- 為了保存這個 plugin 所有下載檔案的資料,那個新增的 table '{prefix}_download_counter' 在解除 plugin 時是不會被刪除的。
- 若在 count tag 用了一個不存在的下載檔案 id,下載次數會是 -1
版本資料
- Version 0.5 - 首次公開版本
- Version 0.6 - 修正不能在 SQLite 和 PostgreSQL 運行這 plugin
- Version 0.7 - 將 'Creation Time' 和 'Last Download Time' 的日期時間輸入格式統一為 'YYYY-MM-DD HH:MM'
- Version 0.8 - 修正日期時間格式的 regex validation 和一個不能正確儲存下載檔案資料的嚴重錯誤
下載
- Habari 0.7-alpha (trunk) 版本(已經下載了 523 次)
- Habari 0.6.x (stable) 版本(已經下載了 449 次)




4 Responses to “Habari - RN Download Counter Plugin”
Leave a Reply