Commit 580fca2e authored by Simon Welsh's avatar Simon Welsh

Sort differently

git-svn-id: svn+ssh://lsgn/var/logbot-www@79 5f99df0c-6b0a-442a-b40a-040688e84a9d
parent 3a2d7a7b
......@@ -128,6 +128,7 @@ function build_stats(Redis $r) {
'wtf',
'Penis',
];
sort($swears);
$query = 'SELECT COUNT(*) AS "Number", "Nick" FROM "Log" WHERE "Text" ILIKE \'%%%s%%\' GROUP BY "Nick" ORDER BY "Number" DESC LIMIT 50;';
foreach($swears as $name) {
$res = DB::inst()->query(sprintf($query, $name));
......@@ -137,9 +138,6 @@ function build_stats(Redis $r) {
}
}
$stats = array_filter($stats);
uasort($stats, function($b, $a) {
return count($a) - count($b);
});
$full = [];
$query = 'SELECT COUNT(*) AS "Number", "Nick" FROM "Log" WHERE "Command" = \'ACTION\' OR "Command" = \'PRIVMSG\' GROUP BY "Nick" ORDER BY "Number" DESC LIMIT 50;';
$res = DB::inst()->query($query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment