|
Cookbook /
PageRankSummary:Vote on a page's popularity
Version:0.4
Prerequisites:PmWiki 2.2.0beta+
Status:beta
Maintainer:XES
How can I choose the most popular page(s), topic(s), product(s) on the site?You can use the PageRank tool to allow users to vote on whether they like anything that's attached to a single page. With modifications, this could be extended to multiple items on a page. DescriptionPlug-in for page ranking system. NotesThis is a basic page-ranking system. It could use some improvements graphically, but basically it allows users to vote (default 1-5) on a page. It only requires CSS, no JavaScript is used. Security Note until PmWiki comes out with "insert" permissions, this recipe can add information to pages regardless of whether the user has edit/read permissions. Only enable this recipe on pages you wish rankings to be on, and note that the only "security" feature is the default that requires users are logged in. Later this recipe will require "insert" permissions. Installation
UsageVotes by loginThe default behavior of the script is to track votes by login. This means that if a user votes again, it changes their original vote. To rate a page by loginIf you would like to use the PageRank in a specific group, add the following to GroupHeader or to GroupFooter:
To allow votes regardless of loginThis behavior accumulates votes, regardless of whether the user is logged in or not. If a user votes again, it's counted as an additional vote.
To display the page ratingThis displays the page rating only if the page is rated, and is added to the GroupHeader or GroupFooter. A visual star interpretation will come in a later release.
OptionsThese are the options enabled by the recipe so far: change the star imageYou may use other images than stars, or different star images. The "empty" image should be on top, the "filled" image should be on the bottom, thus the image should be half as wide as it is high. See star_rating.gif for an example. Use the new image by changing the following settings:
change the range for ratingsYou may change the number of stars or the range of the vote. Example: If you prefer a vote of 1-4 instead of 1-5, change the following:
list the user votes on the pageThe following will tally the user votes visibly. Due to a bug in PmWiki, the votes had to be placed at the top of the page being edited, so you will want to use GroupHeader to display the voting results.
Release Notes2006-11-9 - Version 0.1 released 2006-11-12 - Version 0.2 released - bug fixes, documentation corrections 2006-11-12 - Version 0.3 released - another bug fix 2006-12-2 - Version 0.4 released - now checks rating entered for numeral. To-Do
CommentsI like the pagerank recipe, but I would like to limit the number of times a person could rate a page to once. Also, I would like to display a list of the top ranked Authors based on reader rankings. Am I a dreamer? set $PRS_Vote['exclusive'] = true; for people to vote only once. This works best if you require people to log in to vote, of course, otherwise there's no good way to track whether someone has already voted.Displaying the top rated author would depend on how you have the website configured, and is probably a question more suited for the user list or IRC channel. See MailingLists about the mailing list and for IRC; we're on irc.freenode.net #pmwiki. For questions (generally free) and (paid) custom programming, I can be contacted personally on AIM or Skype at EclecticTLLC. XES March 01, 2007, at 09:03 PM See AlsoContributors |