How to get the Top Author of the week based on user points? I have tried http://drupal.org/project/userpoints_ranking but it has no such options. I am using drupal 7
I have vote up/down module and user-points module enabled and a Rules to add user points for every vote automatically, based on that vote i want to have Top Author of the week.
-
2Are we to assume that user points are assigned every time that a user posts a piece of content? Or every time a piece of content is viewed? Could you expand on your use-case somewhat, otherwise this question is too ambiguous.– ChapabuCommented Feb 15, 2013 at 16:34
-
OK, you can assume that user points are assigned every time a user posts a piece of content... but any ideas?– rakibtgCommented Feb 16, 2013 at 10:05
-
Did you find any solutions? I need this too.– Raj Pawan GumdalCommented Jun 10, 2015 at 10:51
-
No! but what i dead i have created a table and then i did put all the activities/points of a user id on that table and then i fetch the top author from that database table, that does the job.– rakibtgCommented Jun 11, 2015 at 7:58
Add a comment
|
1 Answer
The Userpoints module has Views integration to make this happen:
- Create a new view using Userpoints Transactions as the base table.
- Add a Relationship, Userpoints Transactions: User.
- Select your fields: User: uid & Userpoints Transactions: Points.
- Filter on Userpoints Transactions: Timestamp with the Value Type set to An offset from the current time... so you can input your
strtotime()
offset (e.g. by rolling week, "-7 day"). - Enable the Use aggregation option.
- Lastly, for the Aggregation Settings on Userpoints Transactions: Points, set the Aggregation Type to Sum.