2017-10-16, 08:40 PM
Works but:
1. Try not to hard-code the HTML, use the template system.
2. get_user() function is not something I'd use as it generates lots of queries (1 query per user). Check below, that's a query I use for my ban list.
1. Try not to hard-code the HTML, use the template system.
2. get_user() function is not something I'd use as it generates lots of queries (1 query per user). Check below, that's a query I use for my ban list.
$query = $db->write_query(sprintf("
SELECT b.*, u2.*, u.uid AS id, u.username AS user, u.displaygroup AS dispgroup, u.usergroup AS ugroup FROM %sbanned b
LEFT JOIN %susers u ON(b.admin = u.uid)
LEFT JOIN %susers u2 ON(b.uid = u2.uid)
ORDER BY b.dateline DESC
LIMIT {$start}, {$perpage}", TABLE_PREFIX, TABLE_PREFIX, TABLE_PREFIX
));