From 24547ccec6526fcef3cccb34bc35fb81f31236b3 Mon Sep 17 00:00:00 2001 From: Nicolas BERNSTEIN Date: Sun, 12 Feb 2012 19:50:55 +0100 Subject: A lot of changes : blogging system essentially. --- lib/account/list.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/account/list.php (limited to 'lib/account/list.php') diff --git a/lib/account/list.php b/lib/account/list.php new file mode 100644 index 0000000..dcb6575 --- /dev/null +++ b/lib/account/list.php @@ -0,0 +1,23 @@ + array ( + "name" => "username", + "reg_date" => "date registered", + "nbNotes" => "number of notes", + ), + "way" => $ord_ways, +); +$fdefaults = array ( + "order" => "name", + "way" => "ASC", +); + +$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")); +while ($nn = mysql_fetch_assoc($n)) $users[] = $nn; +require("tpl/account/list.php"); -- cgit v1.2.3