summaryrefslogtreecommitdiff
path: root/lib/notes
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 19:36:41 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 19:36:41 +0200
commit8d9321225140a3db0b72796d4d0236d6cacfeb8a (patch)
tree766e25ed98b86ed4cbf6d0517d9daaecc5ce3c18 /lib/notes
parentb6b341d949437c913fcce3d1a7c302945f67b22b (diff)
downloadBits-8d9321225140a3db0b72796d4d0236d6cacfeb8a.tar.gz
Bits-8d9321225140a3db0b72796d4d0236d6cacfeb8a.zip
Started working on a study program.
Diffstat (limited to 'lib/notes')
-rw-r--r--lib/notes/index.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/notes/index.php b/lib/notes/index.php
index 3c81f46..3089605 100644
--- a/lib/notes/index.php
+++ b/lib/notes/index.php
@@ -1,9 +1,21 @@
<?php
+$filters = array (
+ "order" => array (
+ "nbNotes" => "number of notes",
+ "name" => "username",
+ ),
+ "way" => $ord_ways,
+);
+$fdefaults = array (
+ "order" => "nbNotes",
+ "way" => "DESC",
+);
+
$users = array();
$n = sql("SELECT account.id AS id, login AS name, COUNT(notes.id) AS nbNotes FROM account ".
"LEFT JOIN notes ON notes.owner = account.id ".
"WHERE notes.public != 0 AND notes.id != 0 ".
- "GROUP BY account.id ORDER BY nbNotes DESC");
+ "GROUP BY account.id ORDER BY " . get_filter("order") . " " . get_filter("way"));
while ($nn = mysql_fetch_assoc($n)) $users[] = $nn;
require("tpl/notes/index.php");