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) { ...@@ -104,7 +104,7 @@ function build_stats(Redis $r) {
$stats = []; $stats = [];
$swears = array_filter(array_map('trim', file(__DIR__ . '/swears.txt'))); $swears = array_filter(array_map('trim', file(__DIR__ . '/swears.txt')));
natcasesort($swears); 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) { foreach($swears as $name) {
$res = DB::inst()->query(sprintf($query, $name)); $res = DB::inst()->query(sprintf($query, $name));
$stats[$name] = []; $stats[$name] = [];
...@@ -114,7 +114,7 @@ function build_stats(Redis $r) { ...@@ -114,7 +114,7 @@ function build_stats(Redis $r) {
} }
$stats = array_filter($stats); $stats = array_filter($stats);
$full = []; $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); $res = DB::inst()->query($query);
while($row = pg_fetch_array($res)) { while($row = pg_fetch_array($res)) {
$full[$row[1]] = $row[0]; $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