[WordPress] 外掛分享: Featuring CountComments

WordPress 外掛 Featuring CountComments 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Featuring CountComments」是 2007-03-23 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2017-11-09,距離現在已有 2734 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.3 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.3 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

neoxx |

外掛標籤

count | author | authors | comment | comments |

內容簡介

在管理選單使用者頁面上擴展評論計數的資訊
設置頁面可設定標準功能
易於整合 (內含多個/側邊欄和儀表板小工具功能)
可以整合到”現在”方塊中,或顯示為控制台小工具和用戶個人資料頁面
高效能,因為使用者的評論計數在頁面請求中被重複使用
API供開發者使用
完全與https/SSL/TLS站點相容
充分支援多站點網路
乾淨的卸載

此外掛要求:使用者必須註冊並登錄以進行評論 - 因此,Featuring CountComments在允許匿名評論的網誌中將無法正常工作!

請在以下的版本中找到WordPress控制台:

3.3及以上版本 此處
3.2版本 此處
2.8至3.1版本 此處
2.8次要版本 此處

控制台的網站:https://www.bernhard-riedl.com/projects/

作者網站:https://www.bernhard-riedl.com/
注意!-Geek的東西前面! 😉

API

參數可以作為陣列或 URL 查詢類型的字符串 (例如:"表示=0&格式=0") 進行傳遞。請注意,WordPress將所有引數解析為字符串,因此,在查詢類型的字符串中使用布爾值必須是0或1,而在陣列中應使用真正的布爾值。

$featuring_countcomments->count_by_user($params=array())

計算當前已登錄的使用者或具有特定屬性的使用者發表的評論數。

$params:

user_attribute:使用者的屬性之一(符合query_type),例如user_id或WP_User物件; 如果未給出user_attribute,則將回退到當前正在使用的使用者

query_type:對應使用者屬性或WP_User物件的SQL字段;預設值為user_id

user_id
display_name
user_nicename
user_email
user_login
WP_User物件

format:如果設為true (預設值),則使用zero、one、more和thousands_separator屬性格式化輸出;false = 測試純數值的值

zero,one,more:用於格式化輸出-%c將被評論數替換

'zero' => '0則評論'
'one' => '1則評論'
'more' => '%c則評論'

原文外掛簡介

extends information on Users page in Admin Menu with comment counts
settings page configurable for standard functions
easy to integrate (ships with multi/sidebar- and dashboard-widget functionality)
possible to integrate in “Right Now” box or to display as widget on the dashboard and on the user’s profile page
high performance because users’ comment counts are re-used within a page-call
API for developers
fully compatible with https/SSL/TLS-sites
fully multisite network compatible
clean uninstall

Requirement for this plugin: Your users have to be registered and logged in to comment – Thus, Featuring CountComments will not work properly in weblogs where anonymous comments are allowed!
Please find the version for WordPress

3.3 and higher here
3.2 here
2.8 to 3.1 here
minor 2.8 here

Plugin’s website: https://www.bernhard-riedl.com/projects/
Author’s website: https://www.bernhard-riedl.com/
Attention! – Geeks’ stuff ahead! 😉
API
Parameters can either be passed as an array or a URL query type string (e.g. “display=0&format=0”). Please note that WordPress parses all arguments as strings, thus booleans have to be 0 or 1 if used in query type strings whereas for arrays real booleans should be used.
$featuring_countcomments->count_by_user($params=array())
Counts the number of comments made by a user who is currently logged in or has a particular attribute.
$params:

user_attribute: one of the user’s attributes (matching query_type), for example, the user_id or a WP_User object; if no user_attribute is given, will fallback to currently logged in user

query_type: corresponding SQL-field of user’s attribute or WP_User object; default is user_id

user_id
display_name
user_nicename
user_email
user_login
WP_User object

format: if set to true (default), the output will be formatted using the attributes zero, one, more and thousands_separator; false = process plain count value

zero, one, more: for formatted output – %c gets replaced with the number of comments

‘zero’ => ‘0 comments’
‘one’ => ‘1 comment’
‘more’ => ‘%c comments’

thousands_separator: divides counts by thousand delimiters; default , => e.g. 1,386

display: if you want to return the count (e.g. for storing it in a variable) instead of echoing it with this function-call, set display to false; default setting is true

The following example outputs the comment count of the user with the registered e-mail address ‘[email protected]’.
'user_email',
'user_attribute' => '[email protected]'
);

$featuring_countcomments->count_by_user($params);

?>

$featuring_countcomments->count_by_comment($params=array())
Counts the number of comments made by a user who wrote a certain comment or the current comment in the comment-loop.
$params:

comment: a comment object or comment id; if empty retrieves current comment

format: if set to true (default), the output will be formatted using the attributes zero, one, more and thousands_separator; false = process plain count value

zero, one, more: for formatted output – %c gets replaced with the number of comments

‘zero’ => ‘0 comments’
‘one’ => ‘1 comment’
‘more’ => ‘%c comments’

thousands_separator: divides counts by thousand delimiters default , => e.g. 1,386

display: if you want to return the count (e.g. for storing it in a variable) instead of echoing it with this function-call, set display to false; default setting is true

in_loop: if set to true (default), the query count for all user who wrote a comment which belongs to the post of the handed over comment will be cached; otherwise the comment count will be retrieved only for the user who posted the comment

The following example outputs the number of comments of the author with the current comment in the comment loop:
count_by_comment();

?>

Shortcodes
How-to for shortcodes
General Example:
Enter the following text anywhere in a post or page to output the comment count of user xyz:
[featuring_countcomments_count_by_user query_type="user_nicename" user_attribute="xyz"] by xyz so far...

Available Shortcode:
featuring_countcomments_count_by_user

Invokes $featuring_countcomments->count_by_user($params).
featuring_countcomments_count_by_comment

Invokes $featuring_countcomments->count_by_comment($params).
Filters
How-To for filters
General Example:
function my_featuring_countcomments_defaults($params=array()) {
$params['query_type'] = 'user_nicename';
return $params;
}

add_filter('featuring_countcomments_defaults', 'my_featuring_countcomments_defaults');

Available Filters:
featuring_countcomments_defaults

In case you want to set the default parameters globally rather than handing them over on every function call, you can add the filter featuring_countcomments_defaults in for example featuring-countcomments.php or your own customization plugin (recommended).
Please note that parameters which you hand over to a function call ($featuring_countcomments->count_by_user or $featuring_countcomments->count_by_comment) will always override the defaults parameters, even if they have been set by a filter or in the admin menu.
featuring_countcomments_dashboard_widget

Receives an array which is used for the dashboard-widget-function call to $featuring_countcomments->count_by_user. display and format will automatically be set to true and user_parameter to null to receive the current user’s count.
featuring_countcomments_dashboard_widget_text

Receives a string which is used in the dashboard-widget. %c will be replaced by the comment count of the user who is currently logged in.
featuring_countcomments_dashboard_right_now

Receives an array which is used for the dashboard-right-now-box-function call to $featuring_countcomments->count_by_user. display and format will automatically be set to true and user_parameter to null to retrieve the comment count of currently logged in user.
featuring_countcomments_dashboard_right_now_text

Receives a string which is used in the right-now box on the dashboard. %c will be replaced by the comment count of the user who is currently logged in.
featuring_countcomments_user_profile

Receives an array which is used for the user-profile-function call to $featuring_countcomments->count_by_user. display and format will automatically be set to true and user_parameter to null to retrieve the comment count of currently logged in user.
featuring_countcomments_user_profile_text

Receives a string which is used in the user’s profile page. %c will be replaced by the comment count of the user who is currently logged in.
featuring_countcomments_users_custom_column

Receives an array which is used for the users-page-function call to $featuring_countcomments->count_by_user. display and format will automatically be set to true and user_parameter to the user-id of each row to retrieve the user’s comment count.

各版本下載點

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

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


wordpress 3.2 | wordpress 2.8 - 3.1 | wordpress minor 2.8 |

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

  • Simple Download Monitor 》我開發了「Simple Download Monitor」外掛,因為我需要一個好的方式來管理我的數位下載,並監測我檔案和文件的下載次數。, , 此外掛非常適用於管理和追蹤您的...。
  • Post Views Count (Support caching plugins!) 》重要提示:3.0 版本支援快取外掛!, 當有人訪問一則文章或頁面(不包括搜尋引擎爬蟲時),它會將瀏覽次數加 1。, 但這還不是全部,這些計數器會分成逐日、逐...。
  • Waiting: One-click countdowns 》一鍵倒數計時。, 倒數計時到一個日期或特定持續時間(例如從頁面加載開始的 60 秒)。, 功能:, , 無限的倒數計時。, 易於使用的可視化構建器,具有實時預覽...。
  • GravityWP – Count 》請造訪 GravityWP.com 取得文件。, 最簡單的短代碼版本(計數並顯示指定 Gravity Form 表單的條目數量):, [gravitywp_count formid=''], , 當您需要數字欄...。
  • WooCommerce Cart Count Shortcode 》如果您正在尋找在您的網站的 WooCommerce 購物車中靈活顯示項目的方法,那就不用再尋找了!此外掛可讓您在網站的任何位置插入短碼,以生成 a href 鏈接。, 參...。
  • Posts Character Count Admin 》此外掛會在文章管理子面板中加入一個欄位,顯示每篇文章中的字元計數。, 在文章編輯子面板中,此外掛同樣會在「字數計算」附近提供每篇文章的字元計數,協助...。
  • Easy CountDowner 》Easy Countdowner 讓你能夠在你的文章或網頁上顯示倒數計時器。將全定制的 HTML5 倒數計時器放置到最簡單地方。只需點擊 tinyMce 編輯器中的 countDowner 按...。
  • Countdown Timer 》倒數計時器可讓您設置一個或多個要倒數至或倒數離開的日期。, 事件可以使用小工具插入側邊欄,或使用短碼插入文章和頁面中。, 目前支援22種語言。, 翻譯, 使...。
  • AJAX Hits Counter + Popular Posts Widget 》本外掛使用外部 AJAX 計數器腳本來記錄文章的瀏覽次數,是最適合快取整個頁面或使用其他快取外掛的解決方案。, 此外,外掛還包含了「熱門文章」小工具,可根...。
  • Simple Post Views Count 》插件被棄用了, 現在,我們終於確信谷歌分析統計和追蹤系統是無與倫比的先進做法(其他插件也是,例如:Google Analytics [by MonsterInsights]),相較於無用...。
  • Dashboard Wordcount 》更新儀表板的 At a Glance 小工具,以顯示此 WordPress 網站中所有已發表文章的總字數(及每篇文章的平均字數)。還會顯示網站的年齡(自最老的文章以來的時...。
  • Posts Social Shares Count 》關於, 您可以使用此外掛程式,透過文章 ID 取得某篇文章的分享數量。, 如何使用, 例如,在迴圈中使用 echo pssc_facebook() 函數,或是在任何地方使用 echo p...。
  • bbp topic count 》這個 bbPress 外掛可以在每個主題/回覆檢視中,顯示主題總數、回覆總數和總計數的任意組合,並且允許您自訂標籤,例如「已建立的主題:253」或「主題 — 253」...。
  • Most Read Posts in XX days 》「最多閱讀文章」外掛可以計算文章和頁面的點擊次數,並讓你在以下頁面上展示它們:, , 單篇文章頁面, 頁面, 索引頁面和存檔頁面, 可配置的小工具,也可帶有...。
  • WordPress Word Count and Limit 》這個外掛可以在編輯文章視窗的底部即時將字數資訊替換為字元/單字計算。此外,您可以將字元/單字計算限制在指定的使用者角色中。, 這裡列出了設定清單(詳細...。

文章
Filter
Mastodon