community rating plugin without lookup?

Creating and modifying plugins.
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

community rating plugin without lookup?

Post by carl_galloway »

Hi all,

Is it possible to use the community rating plugin to allow site visitors to vote (on a scale of 1 to 5) on how useful an article was and leave a comment.

I know the karma plugin seems like the more logical fit, but I want something that allows me to use a series of gold stars for the rating, and if a user who makes a vote also wants to add their comment, I would like them to be able to do so.

I'd also particularly like this to work with the blog entries and static pages plugin. I'm happy to add whatever smarty needs to be added to the template to get this working.

Any thoughts?

Carl
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: community rating plugin without lookup?

Post by garvinhicking »

Hi!

Actually, forget about the communityrating plugin, that one is not up to do that job. The karma plugin would really be much much more fit.

It would need some serous redo though, if you want to associate it with entries. It could be implemented just like the captcha plugin currently is.

It's quite a neat idea, but I figure it would take me a lot of time (like 8-10 hours), which I currently don't have. But I am putting this on my list of things to do once I find the spare time for it :-)

If someone other, like mattsches or matthew or so :) would like to have a stab at it, I'd love to help.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Thanks Garvin, if someone else could help I'd really appreciate it
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

If anyone is willing to help with this project, I'd be happy to make a small donation, say US$30...

What I need is an event plugin that allows site visitors to rate a product (or the article) from 1 to 5, preferably using little yellow stars to indicate the rating. The title and description of the vote panel (whether its a product or the entry) needs to be easliy configured by the site user so that they can use it for whichever purpose they want.

I also want those same users to be able to post a short comment, which will appear directly underneath the rating.

I also want this plugin to work with static pages and blog entries.

Lastly, I want the plugin to be made available via Spartacus to all users, so it needs to meet Garvin's standards for plugins.

Hopefully someone will take up my offer,

Thanks, Carl
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel »

Hey I like this idea. I'll contribute donations too. :D
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

I'd love to help, but I am having trouble seeing any nice way to do this.

The easiest way I see to do this is actually to do it as a Markup plugin. Basically, you allow people to add something like this to an entry/textbox:
[vote_kiosk=type/entryid,Title,text]

And then use the same process as the dynamic markup plugins to output the current stats and a form. You could capture the form through a normal hook, I think. But that means ignoring the current comment code and starting mostly from scratch, which means a lot of work.

The other way would be to extend comments to static pages (and other content), and then just use something similar to the karma plugin to capture the voting. But this means altering core, I think, which introduces the question of when are we trying to release 1.1...

Garvin, any thoughts? You mention the spamblock plugin... are you just thinking that we can use frontend_comment and those hooks? (I haven't looked at the database for comments; can we store comments for something other than entries?)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I just took about an hour to play with the karma plugin and wanted to quickly implemented Carls wish.

However, I failed miserably. This takes much more work than I had anticipated.

My result is currently here: http://rafb.net/paste/results/IZCMdM75.html

The implementation will show a box for the blog entry admin, where you can enable rating for an article and specifiy title/description.

My issues are this:

1. You probably want to use smarty templating for both showing the rating selector (using javascript to click on the number of stars) and showing the rating results. One probably wants to use different rating templates for specific articles.

2. I figured it would be nice to display the ratings just like comments. The problem is, what to do with people that just rate and do not comment. Serendipity does not store empty comments, but a commentid would be needed to associate a rating with an comment, and store the username of that rater somewhere, even if he did not comment.

3. The DB table currently would store individual points and would need to sum up the points for each entry. That might take some time, but only this approach allows to associate specific ratings with an extra text.

4. Performance: To specifically format the rating output into the comment, we would need to inject it into the 'body' of a comment like the Gravatar plugin does. However, parsing a smarty template for each comment/rating would really be slow, so it might not be customizable in PHP, or we need some really good caching system that only uses str_replace to fill in the individual parts of the parsed smarty template.

5. Another item is staticpage integration: This alone might take a day or two of implementation. Staticpages currently have no possibility to associate comments or "entyrproperties" with them. A foundation would need creation, and that's quite time consuming. The other way that Matthew indiciated would be to use abstract markup that you can input into your staticpage, but this would require some code skills of users who want to implement it.

6. What do do with entries that have karma rating activated? Will it be disabled completely, or shown as a generall rating mechanism? Or only for entries that have no "customized" rating?

So, all in all, I figure this plugin would take me a week of work or so, which I simply can't dedicate right now. :-(

Any other takers or developers are fully appreciated, I'd still like to help wherever I can. I hope I didn't stray too much negative vibrations here, it's just that as easy as the concept sound, as tough is the implementation...

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Sorry, guys, my time budget is very tight right now ... as it always is :?

I would have chimed in earlier, but couldn't think of an easy solution neither. The community rating and my microformats plugin (if I will ever find time to improve it) are not meant for this job. I also would have opted for the karma plugin, but if even Garvin fails who else can hope to come up with something? :wink:

Nevertheless, I'm probably going to have a look at Garvin's 700+ lines of code and try to figure it out. However, considering the problems Garvin laid out, my hopes aren't too high.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Ok, are we able to start with a plugin that at least allows user ratings without comments, then, instead of comments, how easy would it be to make a scratchpad where each comment is just appended to the end of the scratchpad with html formatting (<br />) to separate them on screen. The owner of the website would need some way of editing the scratchpad to remove unwanted comments. If this was done, then maybe the scratchpad could be saved to the database in the same way that the multilingual plugin saves translated entries?

I know that this approach removes any link between the vote and the person making the comment, but its a better solution than nothing at all.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

hello, anyone there, why is it dark in here? hehe :D
ostfriese2004
Regular
Posts: 76
Joined: Tue Feb 13, 2007 11:12 pm

Post by ostfriese2004 »

Hey Guys...

So do we have a plugin that let users rate articles and an additional sidebar plugin that shows the top 5 (or whatever) rated headers of the articles?

Regards

Helge
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, serendipity_event_karma from the s9y distro and serendipity_plugin_popularentries from spartacus.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply