summaryrefslogtreecommitdiff
path: root/lib/list/index.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
commitd45c7f14891d951f8a6987cc6492073b97e05b5b (patch)
treed6467b1202c27f67fd8e894d25fd4aea0085b559 /lib/list/index.php
parent4d7e065c2d2ec407b6a7ebfc7569628bac9149d1 (diff)
downloadBits-d45c7f14891d951f8a6987cc6492073b97e05b5b.tar.gz
Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.zip
Added the bit list study system
Diffstat (limited to 'lib/list/index.php')
-rw-r--r--lib/list/index.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/list/index.php b/lib/list/index.php
new file mode 100644
index 0000000..cbcad67
--- /dev/null
+++ b/lib/list/index.php
@@ -0,0 +1,25 @@
+<?php
+
+$filters = array (
+ "order" => array (
+ "nbUsers" => "popularity",
+ "name" => "name",
+ "owner" => "author",
+ ),
+ "way" => $ord_ways,
+);
+$fdefaults = array (
+ "order" => "nbUsers",
+ "way" => "DESC",
+);
+
+$lists = array();
+$n = sql(
+ "SELECT lists.id AS id, lists.name AS name, account.login AS owner, COUNT(list_study.id) AS nbUsers ".
+ "FROM lists LEFT JOIN account ON lists.owner = account.id LEFT JOIN list_study ON list_study.list = lists.id ".
+ "GROUP BY lists.id ORDER BY " . get_filter("order") . " " . get_filter("way")
+ );
+while ($nn = mysql_fetch_assoc($n)) $lists[] = $nn;
+
+require("tpl/list/index.php");
+