[pmwiki-users] Another stab at ratings...

Peter Bowers pbowers at pobox.com
Sun Mar 8 08:40:55 CDT 2009

On Sunday March 08 2009 12:18 Petko Yotov wrote:
> On Saturday 28 February 2009 12:41:38 Petko Yotov wrote:
> > I forgot to mention that a while ago we discussed this format :
> > * (+) Excellent, I use it. [[~Petko]] (datestamp)
> > * (-) Didn't work for me, PHP 7 required. [[~Peter Bowers]] (datestamp)
> >
> > That is : asterisk, (special markup keyword), optional comment,
> signature.
> Hi. I'd like to let you know that as of today there are two new recipes
> that
> allow us to count votes (opinions, comments) and display a simple rating
> on a
> recipe page and on the cookbook pagelist categories.
> Both recipes use the same format we discussed a while ago --
>   * (+) comment signature
> -- and concentrate on the simple count of "generally" positive or negative
> votes, a reader can always read the full  on the page.
> Please see these recipes :
>   http://www.pmwiki.org/wiki/Cookbook/VoteCounter  has more  options
>   http://www.pmwiki.org/wiki/Cookbook/Rating2      has fewer options

More specifically... using this example vote list:

* (+) both recipes
* (-) allow arbitrary
* (+2) comments after
* (+) the (rating) so this
* (superb) text is
* (+1) simply
* (+) irrelevant in terms
* (unusable) of this discussion

VoteCounter allows arbitrary text within the parentheses and counts each as
a valid vote.  So from VoteCounter you would have 
	8: +(3), -(1), +1(1), +2(1), superb(1), unusable(1)
Rating2 would have interpreted/summarized the same votes as 
	+5 -1 | +2
scoring "+1" and "+2" as a single "+" each and separating "superb" and
"unusable" as being ambiguous votes.

The 2 recipes also differ in their implementation.  VoteCounter reads the
page and calculates the votes whenever the PV is used.  Rating2 calculates
the votes whenever the page is saved and then saves the PV as a page
attribute.  This puts the load more on the file-save rather than the
file-read which is appropriate considering read is a far more common

In certain circumstances VoteCounter could be useful (where arbitrary rating
text was desirable or where you wanted more flexibility in the formatting of
the vote details), but Rating2 is more "sortable" if we ever want to put a
list of recipes in order by rating (especially if a {$Rating2Sum} were
implemented adding the + votes and subtracting the - votes).  It also has
slight performance advantages.

* (+2) I vote to activate Rating2 on the cookbook group in pmwiki.org
[[~Peter Bowers]] March 8, 2009 14:29:09


More information about the pmwiki-users mailing list