內容簡介
這個外掛為文章新增了投票功能。此功能類似 Reddit 或 Digg,訪客可以投票支持或反對文章。
訪客與遊客皆可投票,此功能可以設定關閉。
在網站上顯示最近熱門文章的小工具,可增加熱門文章的曝光度。
此外掛的主要功能如下:
訪客可以投票支持或反對文章,可依據設定是否開放投票
文章投票功能易於管理
如果啟用此功能,投票方式有支持或反對文章
發文者可被禁止投票
開啟初始投票計數功能,即發文時可以立刻投票
功能相當可客製化
熱門文章的小工具可增加讀者對熱門文章的關注度
需求條件
一個可運行的 WordPress 安裝程序
WordPress 主題必須包含呼叫 get_header() 函數的程式碼
WordPress 主題必須包括 WordPress 迴圈
大多數的 WordPress 安裝程序都滿足這些需求,無需擔心。
另外,在使用此外掛時必須啟用瀏覽器的 JavaScript。
建議使用 WordPress 2.8 或更新版本來使用此外掛。
客製化
Votingfunctions.php
在 votingfunctions.php 中,有多個函數可以顯示其他資訊。
GetVotes($post_ID): 回傳與文章相關的投票數量
UserVoted($post_ID, $user_ID): 若使用者已投票支持或反對文章則回傳 TRUE,若使用者尚未投票則回傳 FALSE
GetPostVotes($post_ID): 回傳一個使用者 ID 陣列,此陣列代表對此文章投票支持的使用者
GetPostSinks($post_ID): 回傳一個使用者 ID 陣列,此陣列代表對此文章投票反對的使用者
SortVotes(): 回傳一個文章 ID 陣列,此陣列會按照投票數量排序,投票最多的文章排在陣列的最前面
外掛標籤
開發者團隊
原文外掛簡介
This plugin adds voting functionality for posts. This function is similar to Reddit or Digg, in that visitors can vote for and against.
Guests can also vote for posts. This functionality can be disabled as well.
A widget can be displayed showing the most voted posts on your blog, giving further exposure to your popular posts.
A brief summary of what the plugin has to offer:
Visitors can vote for your posts, if they are allowed to
Easy management of post votes
Two-way voting: People can vote for or against your posts if feature is enabled
Post authors can be barred from voting their own posts
Initial vote count feature enables the voting of posts the moment they were published
Fairly customizable features
Top voted post widget gives greater exposure of posts your readers like
Requirements
A working WordPress install
WordPress theme must contain a call to the get_header() function
WordPress theme must contain the WordPress loop
Most WordPress installs have these, so you need not worry about these.
In addition, one must have JavaScript enabled in their browsers in order to vote.
WordPress 2.8 or above is recommended for this plugin.
Customizing
Votingfunctions.php
Within votingfunctions.php, there are several functions that can shows other information.
GetVotes($post_ID): Returns the number of votes associated with the post.
UserVoted($post_ID, $user_ID): Returns TRUE if the user already voted for the post, FALSE if the user hasn't voted for the post
GetPostVotes($post_ID): Returns an array of user IDs that have voted for the post.
GetPostSinks($post_ID): Returns an array of user IDs that have voted against the post.
SortVotes(): Returns an array of post IDs and votes. The array is sorted with the post having the most votes at the top of the array.
