summaryrefslogtreecommitdiff
path: root/lib/list/index.php
blob: cbcad6762b3461bc6c5e0ec65557cd572828bb5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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");