[WordPress] 外掛分享: WP-DownloadCounter

前言介紹

  • 這款 WordPress 外掛「WP-DownloadCounter」是 2008-12-01 上架。
  • 目前有 200 個安裝啟用數。
  • 上一次更新是 2009-04-22,距離現在已有 5856 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.0.2 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

r-win |

外掛標籤

Counter | download | download counter |

內容簡介

WordPress本身提供了將下載檔案附加到頁面的功能,但不會記錄有關這些下載的統計資訊,因此我編寫了這個外掛程式。
我應該提到,統計資訊只是另一個下載計數器的大詞,因為這是這個外掛程式的主要目的。

功能:

跟踪某个文件的下載次數。
跟踪最後的下載時間
允许您重置计数器
允许您添加计数器到内部和外部URL
可以使用时尚的URL(如/downloads/file.zip)
可以在文章中印出下載次數、檔案大小和上次修改日期。

任意节

在文章中使用标签

在撰写文章或页面时,您可能希望在文章中添加URL或下載次数。使用[ download(downloadname) ](不包括空格)将替换为下载URL,[ downloadcounter(downloadname) ]将替换为下载次数,[ downloadsize(downloadname) ]将打印下载的大小(GB、MB、KB或B),[ downloadupdated(downloadname) ] 将打印上次修改日期,使用您已指定的WordPress设置日期格式。创建超链接时,您可以例如使用Download(当然,再次强调,中括号内不带空格)。

最后,使用downloadsize或downloadupdated时,您可以指定一个额外的参数。使用downloadsize,您可以添加,false以防止使用GB、MB、kB或B后缀。例如,使用[ downloadsize(file.zip, false)]将只显示字节大小。与downloadupdated一起使用时,您可以输入PHP日期格式字符串作为额外的参数。例如,[ downloadupdated(file.zip,d-m-Y)]将显示类似27-11-2008的日期。

从PHP检索下载信息

自0.6版以来,可以使用PHP获取有关下载的信息,因此可以直接在模板或自己的外掛程式中使用此信息。目前只有一个函数很重要:

download_information($download_name, $return_information = DOWNLOAD_URL | DOWNLOAD_AMOUNT)

此函数将返回一个包含所需信息的数组。您可以通过参数$return_information指定要返回的信息。文件downloadcounter-options.php包含正确的define语句,可供使用。目前仅可用URL、Amount、Size和Last Modified Date。

使用代码

$info = download_information(wp-downloadcounter.zip, DOWNLOAD_URL | DOWNLOAD_AMOUNT | DOWNLOAD_SIZE | DOWNLOAD_LASTMODIFIED);
var_dump($info);

返回:

array(4) { ["url"]=> string(73) "http://projects.bovendeur.org/downloads/wp-downloadcounter.zip" ["amount"]=> string(4) "1878" ["size"]=> int(11006) ["lastmodified"]=> int(1228157426) }

原文外掛簡介

Since WordPress does offer attaching downloads to pages, but doesn’t keep track of statistical information about these downloads, I wrote this plugin.
I should mention statistical information is a big word for just another download counter, since that is main purpose of this plugin.
Features:

Keeps track of the amount of downloads of a certain file.
Keeps track of the last download time
Allows you to reset the counter
Allows you to add counters to both internal and external urls
Can use fancy urls (like /downloads/file.zip)
Can print the amount of downloads, the filesize and the last modified date in a post.

Arbitrary section
Using tags in your posts
When writing a post or a page, you may want to add the URL or the amount of downloads in your post. Using [ download(downloadname) ] (without the spaces) will be replaced with the download url, [ downloadcounter(downloadname) ] will be replaced with the amount of downloads, [ downloadsize(downloadname) ] will print the size of the download (in GB, MB, kB or B), [ downloadupdated(downloadname) ] will print the last modified date, using the WordPress setting you’ve specified for the date format. When creating a link, you could, for instance, use Download (of course, again, without the spaces within the [] brackets).
Finally, when using downloadsize of downloadupdated, you can specify one extra argument. With downloadsize, you can add ,false to prevent the usage of the GB, MB, kB or B postfixes. So, for example, using [ downloadsize(file.zip, false) ] will just display the size in bytes. With downloadupdated, you can enter a PHP date format string as extra argument. For example, [ downloadupdated(file.zip, d-m-Y) ] will display a date like 27-11-2008.
Retrieving download information from PHP
Since version 0.6 is it possible to get information about the downloads using PHP, so you can use this information directly in your templates or in you own plugins. Only one function is important at the moment:
download_information($download_name, $return_information = DOWNLOAD_URL | DOWNLOAD_AMOUNT)

This function will return an array with the requested information. You can specify what information to return by the argument $return_information. The file downloadcounter-options.php contains the correct define statements which can be used. Currently only URL, Amount, Size and Last Modified Date are available.
Using the code
$info = download_information(wp-downloadcounter.zip, DOWNLOAD_URL | DOWNLOAD_AMOUNT | DOWNLOAD_SIZE | DOWNLOAD_LASTMODIFIED);
var_dump($info);

returns:
array(4) { ["url"]=> string(73) "http://projects.bovendeur.org/downloads/wp-downloadcounter.zip" ["amount"]=> string(4) "1878" ["size"]=> int(11006) ["lastmodified"]=> int(1228157426) }

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP-DownloadCounter」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.6 | 0.8 | 1.0 | 1.1 | 1.01 | trunk |

延伸相關外掛(你可能也想知道)

  • Post Views Counter 》Post Views Counter 讓您能使用這個簡單、快速且易於使用的外掛程式來顯示文章、頁面或自訂文章類型已被檢視的次數。, 欲了解更多資訊,請瀏覽 dFactory 的外...。
  • WP-PostViews 》使用方法, , 打開 wp-content/themes/<您的佈景主題名稱>/index.php , 您也可以將它放在 archive.php、single.php、post.php 或 page.php 中。, 尋找:...。
  • StatCounter – Free Real Time Visitor Stats 》官方 StatCounter WordPress 外掛為您的 WordPress 網誌帶來所有有力的 StatCounter 功能。, 包括但不限於以下功能:, , 隱形計數器選項, 可配置計數器, 可配...。
  • Koko Analytics 》Koko Analytics 是一款針對 WordPress 的隱私友好型分析外掛程式。它不使用任何外部服務,所以您的訪客資料永遠不會與任何第三方公司分享。, 此外,它不會收...。
  • Top 10 – WordPress Popular posts by WebberZone 》WordPress 沒有內建的系統可以追蹤網頁瀏覽量或顯示熱門文章。 Top 10 是一個易於使用、功能強大的 WordPress 外掛程式,可以計算您的文章、頁面和任何自訂文...。
  • Simple Download Monitor 》我開發了「Simple Download Monitor」外掛,因為我需要一個好的方式來管理我的數位下載,並監測我檔案和文件的下載次數。, , 此外掛非常適用於管理和追蹤您的...。
  • WassUp Real Time Analytics 》WassUp 是一個 WordPress 外掛,可提供準確、即時的統計資料,並提供大量詳細的時間序列資訊、可自訂追蹤、即時檢視、訪客和頁面瀏覽次數、熱門統計、圖表、I...。
  • Uji Countdown 》Uji Countdown 可以讓您在文章或頁面上顯示倒數計時器。最簡單的方式是放置您完全自訂的 HTML5 倒數計時器。, 功能列表:, , 新增:支援區塊編輯器, 新增:重...。
  • SRS Simple Hits Counter 》正如其名,這是一個非常簡單的點擊計數器,它可以計算「獨立訪客」和「頁面瀏覽量」的數量。您可以使用小工具或短代碼在網站的任何位置顯示獨立訪客或總頁面...。
  • Entry Views 》Entry Views 會記錄每篇文章/頁面(或任何文章類型)的瀏覽次數。 它附帶一個小工具,可顯示最受歡迎的文章,一個短代碼可顯示文章的瀏覽次數,以及方便的佈...。
  • Counter Number Showcase, Fun Facts – WordPress Animated Counter Plugin 》Counter Number 外掛的設計佈局基於最新的 CSS 動畫,並支援所有主要瀏覽器。可以容易地上傳 Counter Number 統計數據,也可輕鬆更新其標題、計數器狀態和圖...。
  • Post Hit Counter 》「文章瀏覽數計數器」(Post Hit Counter)會如其名所述,統計每篇文章的瀏覽數。瀏覽數會在文章清單中新增一欄、在文章編輯頁面的送出方塊裡和管理條上(在...。
  • WP Post Statistics (Visitors & Visits Counter) 》一個簡單的工具,可用於瞭解您的文章統計數據(包括地理位置), 單篇文章的統計數據包括:, , 全面的概覽頁面(儀表板),包括國家統計、城市、訪客、訪問次...。
  • Easy Timer 》Easy Timer 可讓您輕鬆地在網站的文章、頁面和小工具中插入無限數量的倒數/正數計時器,每秒刷新一次,以及時間或日期。每個倒數計時器顯示剩餘時間直到您選...。
  • Counters Block – Display Number as an animated counter. 》一種優秀的方式,可以以有趣而有吸引力的方式顯示數字。顯示有關您的服務/公司或自己的統計數據。例如,顯示您的 YouTube 頻道的總訂閱者、追隨者、員工數、...。

文章
Filter
Apply Filters
Mastodon