First to the issue: The plugin Country Flags has the option to require a flag or to make it optional, if you make it required, and you want to register by flyover, it tells u to add choose a flag first, but which is not possib...
$query = $db->write_query("
SELECT DISTINCT u.uid, u.username, u.usergroup, u.displaygroup, u.avatar
FROM " . TABLE_PREFIX . "users u
LEFT JOIN " . TABLE_PREFIX . "posts p ON (p.uid = u.uid)
WHERE p.tid = '$tid'
ORDER BY p.datelin...