summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-15 14:19:36 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-15 14:19:36 +0100
commit89057a32d9f28d9931f23676033dd4a126765999 (patch)
treea7881f6d50e8005d5c008a9e1e84c9dba0a663af
parentda36af8bcdaf2344fdb9019d1c17f44ff90316c4 (diff)
downloadBits-master.tar.gz
Bits-master.zip
Minor change to user list display.HEADmaster
-rw-r--r--lib/account/list.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/account/list.php b/lib/account/list.php
index dcb6575..56392c0 100644
--- a/lib/account/list.php
+++ b/lib/account/list.php
@@ -6,18 +6,26 @@ $filters = array (
"reg_date" => "date registered",
"nbNotes" => "number of notes",
),
+ "cat" => array (
+ "WHERE nc.count != 0 OR pc.count != 0" => "interesting",
+ "" => "all",
+ ),
"way" => $ord_ways,
);
$fdefaults = array (
"order" => "name",
"way" => "ASC",
+ "cat" => "WHERE nc.count != 0 OR pc.count != 0",
);
$users = array();
$n = sql("SELECT account.id AS id, login AS name, nc.count AS nbNotes, pc.count AS nbPosts ".
"FROM account ".
- "LEFT JOIN (SELECT notes.owner AS owner, COUNT(notes.id) AS count FROM notes WHERE notes.public != 0 GROUP BY notes.owner) nc ON nc.owner = account.id ".
- "LEFT JOIN (SELECT blog_posts.owner AS owner, COUNT(blog_posts.id) AS count FROM blog_posts GROUP BY blog_posts.owner) pc ON pc.owner = account.id ".
- "ORDER BY " . get_filter("order") . " " . get_filter("way"));
+ "LEFT JOIN (SELECT notes.owner AS owner, COUNT(notes.id) AS count FROM notes ".
+ "WHERE notes.public != 0 GROUP BY notes.owner) nc ON nc.owner = account.id ".
+ "LEFT JOIN (SELECT blog_posts.owner AS owner, COUNT(blog_posts.id) AS count FROM blog_posts ".
+ "GROUP BY blog_posts.owner) pc ON pc.owner = account.id ".
+ get_filter("cat") .
+ " ORDER BY " . get_filter("order") . " " . get_filter("way") . " ");
while ($nn = mysql_fetch_assoc($n)) $users[] = $nn;
require("tpl/account/list.php");