Hello, I am running a blog to describe playground sites in Dresden, Germany (http://www.dd4kids.de)
I installed the Karma plugin to give readers (and me) the opportunity to rate the articles (playgrounds).
Now I would like to enable my visitors to view all articles of a category sorted after several (karma-)criterias like:
- top-rated article
- most-rated article
- most-visited article
and of curse
- Date
I assume it should be possible, because it is basically a combination of the sidebar plugin "categories" where I can filter and show single/multiple categories (but not sort) and the event statistics plugin (where I can see some sorted lists, but are not able to choose a category first).
So my question is, what would I have to do, to insert a drop-down field to the sidebar plugin display "categories" to let my users choose a display order?
Thank you for your support!
article filtering /sorting with karma rating
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: article filtering /sorting with karma rating
Hi!
You could copy+paste some code of the statistics+karma plugin into a new PHP sidebar plugin, but actually I'd do it completely independent from it, in a new plugin.
There you would need to query the Database tables serendipity_karma and create a SQL group by statement that uses a join on serendipity_entries and order by the karma ranking points to filter out those entries you want. The result of your SQL query can then be iterated as a PHP array, and you can use the serendipity_archiveURL() functions for example to create a proper link pointing to the entries you filtered.
That however is some work do to. Even I as a skilled s9y developer would surely take 2 hours of work for this.
Best regards,
Garvin
You could copy+paste some code of the statistics+karma plugin into a new PHP sidebar plugin, but actually I'd do it completely independent from it, in a new plugin.
There you would need to query the Database tables serendipity_karma and create a SQL group by statement that uses a join on serendipity_entries and order by the karma ranking points to filter out those entries you want. The result of your SQL query can then be iterated as a PHP array, and you can use the serendipity_archiveURL() functions for example to create a proper link pointing to the entries you filtered.
That however is some work do to. Even I as a skilled s9y developer would surely take 2 hours of work for this.
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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
The plugin serendipity_plugin_karmaranking.php plugin does something like this, but very basic. Maybe one can use that as a starting point.
Also sernedipity_plugin_popularentries uses the karma table to show the most popular entries.
Both do not provide active sorting functionality to the user. With some basic SQL and PHP knowledge, it could be faciliated, if you'd like to dig into this.
Regards,
Garvin
The plugin serendipity_plugin_karmaranking.php plugin does something like this, but very basic. Maybe one can use that as a starting point.
Also sernedipity_plugin_popularentries uses the karma table to show the most popular entries.
Both do not provide active sorting functionality to the user. With some basic SQL and PHP knowledge, it could be faciliated, if you'd like to dig into this.
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/
# 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/
Hm, thanks for the fast replay garvin! That sounds complicated to me.
Could you ore someone else imagine a easier way of achieving my goal (karma sorting within categories) even if it is not as fancy?
Edit: sorry, this was a duplicate from above, because i was disturbed. This was not a answer of your post.
Could you ore someone else imagine a easier way of achieving my goal (karma sorting within categories) even if it is not as fancy?
Edit: sorry, this was a duplicate from above, because i was disturbed. This was not a answer of your post.
Last edited by konus on Wed Sep 10, 2008 9:49 pm, edited 3 times in total.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Regards,
Garvin
Did you check out those two plugins?konus wrote:Hm, thanks for the fast replay garvin! That sounds complicated to me.
It doesn't get any easier. The way I pointed out is the easiest to achieve. I agree it requires a programmer though, I sadly can't offer that for free right now, I'm swamped.Could someone imagine a easier way of achiving my goal (karma sorting within catagories) even if it is not as fancy?
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/
# 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/
Don and I have been wanting to update the karma ranking plugin for some time. We just all have too many other things to fix.
This will bump it up the list a little, especially if Don is thinking of the same features.
To clarify: you want to rank the entries by various karma measurements in only a particular category?
This will bump it up the list a little, especially if Don is thinking of the same features.
To clarify: you want to rank the entries by various karma measurements in only a particular category?
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Yeah, Judebert and I discussed some of this stuff back when he made a bunch of changes to the plugin:
http://judebert.com/progress/permalink/ ... ating.html
and I created new graphics for the plugin http://www.optional-necessity.com/archi ... lugin.html
What I actually envisioned was more of an improvement to the popular entries plugin rather than just the karma ranking. Come up with some scheme to determine popularity - pageviews, karma rank, # comments, whatever..... but as Jude mentioned, working on so many other things right now, and that would probably take quite a bit of time. I'm fairly decent in the "idea department", but always need experienced coders like Judebert, Garvin and others to bring them to life.
I have always seen value in this though, so will try to keep it from completely falling off our collective radar screens.
http://judebert.com/progress/permalink/ ... ating.html
and I created new graphics for the plugin http://www.optional-necessity.com/archi ... lugin.html
What I actually envisioned was more of an improvement to the popular entries plugin rather than just the karma ranking. Come up with some scheme to determine popularity - pageviews, karma rank, # comments, whatever..... but as Jude mentioned, working on so many other things right now, and that would probably take quite a bit of time. I'm fairly decent in the "idea department", but always need experienced coders like Judebert, Garvin and others to bring them to life.
I have always seen value in this though, so will try to keep it from completely falling off our collective radar screens.
=Don=
I would like to apologise. Normally I try not to annoy people by asking the same question over and over again. The above post was a mistake I made after I was on the telephone and used the back button of my browser. After sending the second post, I did a quick check if it was a duplicate, but missed that you already answered my first post. So it is not my fault - you are just to fast, Garvin!garvinhicking wrote: It doesn't get any easier. The way I pointed out is the easiest to achieve. I agree it requires a programmer though, I sadly can't offer that for free right now, I'm swamped.
And sorry, I did not mean to encourage you to solve my special wishes for free.
I will check those two plugins you pointed me to...
Yes thats right, sorting the articles by karma ranking in a particular category would be the most interesting thing, the other stuff would be bonus.judebert wrote: To clarify: you want to rank the entries by various karma measurements in only a particular category?
I would like to point out, that I really appreciate all of the work, you developers are doing for us users. I try to contribute and give back as much as I can, but it will always much less then your efforts.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi Konus!
No offense taken. It's just that I'm currently working on a project that annoys the hell out of me, and sucks in all of my time. I'm currently working about 16 hours a day for the past 2 weeks, and this drags on my nerves. :-/
I'll see how I can help once that darn project is through.

Best regards,
Garvin
No offense taken. It's just that I'm currently working on a project that annoys the hell out of me, and sucks in all of my time. I'm currently working about 16 hours a day for the past 2 weeks, and this drags on my nerves. :-/
I'll see how I can help once that darn project is through.
Spreading the word and talking about serendipity and supporting it is a VERY huge job I much appreciate!I would like to point out, that I really appreciate all of the work, you developers are doing for us users. I try to contribute and give back as much as I can, but it will always much less then your efforts.
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/
# 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/