Commit 0527c276 authored by Simon Welsh's avatar Simon Welsh

Change number of people in each list to 20 to take up less space.

parent 0f7603c6
......@@ -104,7 +104,7 @@ function build_stats(Redis $r) {
$stats = [];
$swears = array_filter(array_map('trim', file(__DIR__ . '/swears.txt')));
natcasesort($swears);
$query = 'SELECT COUNT(*) AS "Number", "Nick" FROM "Log" WHERE "Text" ILIKE \'%%%s%%\' GROUP BY "Nick" ORDER BY "Number" DESC LIMIT 50;';
$query = 'SELECT COUNT(*) AS "Number", "Nick" FROM "Log" WHERE "Text" ILIKE \'%%%s%%\' GROUP BY "Nick" ORDER BY "Number" DESC LIMIT 20;';
foreach($swears as $name) {
$res = DB::inst()->query(sprintf($query, $name));
$stats[$name] = [];
......@@ -114,7 +114,7 @@ function build_stats(Redis $r) {
}
$stats = array_filter($stats);
$full = [];
$query = 'SELECT COUNT(*) AS "Number", "Nick" FROM "Log" WHERE "Command" = \'ACTION\' OR "Command" = \'PRIVMSG\' GROUP BY "Nick" ORDER BY "Number" DESC LIMIT 50;';
$query = 'SELECT COUNT(*) AS "Number", "Nick" FROM "Log" WHERE "Command" = \'ACTION\' OR "Command" = \'PRIVMSG\' GROUP BY "Nick" ORDER BY "Number" DESC LIMIT 20;';
$res = DB::inst()->query($query);
while($row = pg_fetch_array($res)) {
$full[$row[1]] = $row[0];
......
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