summaryrefslogtreecommitdiff
path: root/lib/notes/index.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 16:48:29 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 16:48:29 +0200
commitd0060968b77c39bdf8abffb071c971c166b59edb (patch)
tree0be52e00a25bd298235a0cf916fb07496d3ab95f /lib/notes/index.php
downloadBits-d0060968b77c39bdf8abffb071c971c166b59edb.tar.gz
Bits-d0060968b77c39bdf8abffb071c971c166b59edb.zip
First commit.
Diffstat (limited to 'lib/notes/index.php')
-rw-r--r--lib/notes/index.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/notes/index.php b/lib/notes/index.php
new file mode 100644
index 0000000..3c81f46
--- /dev/null
+++ b/lib/notes/index.php
@@ -0,0 +1,9 @@
+<?php
+
+$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");
+while ($nn = mysql_fetch_assoc($n)) $users[] = $nn;
+require("tpl/notes/index.php");