[pmwiki-users] Rating cookbooks

Eemeli Aro eemeli at gmail.com
Wed Jan 28 16:35:32 CST 2009

Apologies if this causes confusion; Peter clearly meant to send the
following to the list and not just me. My reply to his comments

2009/1/28 Peter Bowers <pbowers at pobox.com>:
> On Wed, Jan 28, 2009 at 12:39 PM, Eemeli Aro <eemeli at gmail.com> wrote:
> ...
>> Users: [[~Eemeli Aro]], [[~Hans]], Bob the Profile-less, etc.
> ...
> I think one of the advantages of the opinion-per-line method was to have
> something that would be useful in a pagelist format.  What y'all have
> suggested here is fantastic for the person who has already decided more or
> less on this recipe and is doing individual research on that given recipe.
> But what about the person who is looking at a category of recipes and wants
> some idea of which ones are well used (and, hopefully by extension, reliable
> and functional).  In that instance it would be very nice if the PTV could be
> expressed numerically in some way for sorting purposes...  Then I put it in
> order by "strength of recommendations" or something like that and I've got
> at least a rough idea that the top 3 are going to be stronger than the last
> one...
> I suppose the $:Users itself (as formatted above) could be put as a block
> into a pagelist as well but it's going to be pretty impossible to use it for
> sorting or getting additional data from it...
> If we did get the form solution working[1] you could have "I use this
> recipe" being the +1 and "I strongly support this recipe" being the +2 or
> something...  (In other words, maybe it's just a choice of terms again?)
> I think having an "opinion" right together with comments is going to make it
> far more likely that people will be more complete in their "reviews."  Of
> course there could be a markup that the recipe page maintainer puts to
> display the full information in one place and a quick summary in another --
> but this is all dependent on having the opinion data in a useful and
> parsable format...
> I guess I don't see any advantages to this $:Users solution over the
> one-opinion-per-line solution with the form (other than the fact that it'll
> take someeone a few hours to code it up) whereas I do see limitations in
> it...
> On another topic, if we allow anonymous ratings is there a time when a
> recipe maintainer can legitimately delete a rating that is deemed
> unhelpful?  It feels like tampering with the ballot box, but I can see where
> there could be a need for it at time...
> -Peter
> [1] I've been thinking about the forms solution and I'm wondering if it
> wouldn't be better to store the data in a Cookbook/Recipe-Opinions page
> rather than on the page itself.  That would handle the concerns for those of
> us who maintain our recipe pages on our local systems and periodically
> upload them to pmwiki.org...

I disagree with the Users: format not being summarisable; it's perhaps
even easier with this than with one-opinion-per-line, as we can expect
the users to be comma-delimited. Hence at least the following quick
hack appear to work:

in config.php:

Markup( '^Users:', 'block', '/^Users:(.*)$/e',
  "\"<:block,1><h2>Users</h2><p class='indent'>$1</p>\"" );
Markup( 'count', 'directives', '/\\(:count\\s(.*?):\\)/ei',
  "strlen('\$1')?(1+substr_count('\$1',',')):0" );

on a wiki page:

Users: Billy, Bob, Charles
Count is: (:count {$:Users}:)

produces the following HTML:

<h2 class='vspace'>Users</h2><p class='indent'> Billy, Bob, Charles</p>
<p>Count is: 3


More information about the pmwiki-users mailing list