On Sat, Aug 23, 2008 at 2:46 AM, Linly <[EMAIL PROTECTED]> wrote:
>
> Recently I'm learning the 'log' command from Dan and Martin. And I
> find an interesting usage - as a rating system.
>
> Here is the very first draft code:
>
> <code>
> [form]
> [radio rating[] '1']One`
> [radio rating[] '2']Two`
> [radio rating[] '3']Three`
> [radio rating[] '4']Four`
> [radio rating[] '5']Five
> [submit 'Rate this post']
> [session target rate.{p}]
> [session log '{=rating}']
> [form]
> [(include page=rate.{p})]
> </code>
>
> This code is not yet finished because we don't need to see ALL of the
> original datas. Right now it can only accept reader's rating score,
> saving to a certain page and display ALL the score numbers. :(
>
> I don't know how to calculate the total sum and average of the number
> and display it in the format like this:
>
> Rating: xxx times/ Score: 4.5 Stars
>
> The pros of this approach is 'simple', no need to install other php or
> template page to work. All the functions needed are BoltWire built in.
>
> But in other hand, the cons are if we need to list the most rating
> times page or the highest score pages. It should open all of the
> 'rate.*' pages to find out.
>
> So this is more like an coding exercise? Maybe it's better to use
> pagedata plugin to do this rating system?This is a great idea. I have a plan to import the 5 star rating system Hans just did for PmWiki when I get chance but this might be easier. All we need is a simple function for taking the vote page and working it into a display. I'll try to pull one together as soon as I can find a bit of spare time. It won't be hard at all. Great idea! I might suggest (optionally) using pagedata (the new version) so you could do something like Caveman: 2 Linly: 5 Marcos: 4 etc., to prevent members from voting more than once. It would be no harder to do a function to extract these. Looks like a very fun project. Will get back to you soon... Cheers, Dan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BoltWire" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/boltwire?hl=en -~----------~----~----~----~------~----~------~--~---
