Added ability to get to profile by username.

This commit is contained in:
flash 2018-09-25 23:58:31 +02:00
parent 238d454464
commit c11a452334

View file

@ -84,8 +84,11 @@ switch ($mode) {
LEFT JOIN `msz_roles` as r LEFT JOIN `msz_roles` as r
ON r.`role_id` = u.`display_role` ON r.`role_id` = u.`display_role`
WHERE `user_id` = :user_id WHERE `user_id` = :user_id
OR LOWER(`username`) = LOWER(:username)
LIMIT 1
'); ');
$getProfile->bindValue('user_id', $userId); $getProfile->bindValue('user_id', $userId);
$getProfile->bindValue('username', $_GET['u'] ?? '');
$profile = $getProfile->execute() ? $getProfile->fetch() : []; $profile = $getProfile->execute() ? $getProfile->fetch() : [];
if (!$profile) { if (!$profile) {