add a top karma givers report

This commit is contained in:
Mike Bloy 2011-01-20 10:08:20 -06:00
parent 47bb4bac49
commit 2cc79b42a6
1 changed files with 3 additions and 0 deletions

View File

@ -160,6 +160,9 @@ class Karma(Module):
elif (report == 'negative'):
query = 'SELECT who, neg FROM karma_users ORDER BY neg DESC LIMIT 5'
header = 'Top 5 Pessimists:'
elif (report == 'top'):
query = 'SELECT who, pos+neg AS total FROM karma_users ORDER BY total DESC LIMIT 5'
header = 'Top 5 Total Karma Givers:'
if (query != None):
conn = self.get_db()