aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/memberlist.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-08-03 15:23:34 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-08-03 15:23:34 +0000
commit82f42bb5fa611e790e02bc679b88ce90b3f8156b (patch)
tree7cb7cf746da4fd979569dc41dcec96db5f5c9acd /phpBB/memberlist.php
parent650007a5f18e0538b27bf93d674c264fef58c506 (diff)
downloadforums-82f42bb5fa611e790e02bc679b88ce90b3f8156b.tar
forums-82f42bb5fa611e790e02bc679b88ce90b3f8156b.tar.gz
forums-82f42bb5fa611e790e02bc679b88ce90b3f8156b.tar.bz2
forums-82f42bb5fa611e790e02bc679b88ce90b3f8156b.tar.xz
forums-82f42bb5fa611e790e02bc679b88ce90b3f8156b.zip
- custom profile field fixed
- fixing sql_fetchfield from cache - changing the quote parser. In my tests i have not seen changed behaviour - but i might have broken something with this change. git-svn-id: file:///svn/phpbb/trunk@6232 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r--phpBB/memberlist.php24
1 files changed, 19 insertions, 5 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 3934074154..7ef4daf93c 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -25,6 +25,7 @@ $user->setup(array('memberlist', 'groups'));
$mode = request_var('mode', '');
$action = request_var('action', '');
$user_id = request_var('u', ANONYMOUS);
+$username = request_var('un', '');
$group_id = request_var('g', 0);
$topic_id = request_var('t', 0);
@@ -321,16 +322,27 @@ switch ($mode)
case 'viewprofile':
// Display a profile
- if ($user_id == ANONYMOUS)
+ if ($user_id == ANONYMOUS && !$username)
{
trigger_error('NO_USER');
}
// Get user...
- $sql = 'SELECT *
- FROM ' . USERS_TABLE . "
- WHERE user_id = $user_id
- AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ if ($username)
+ {
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . "
+ WHERE LOWER(username) = '" . strtolower($db->sql_escape($username)) . "'
+ AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ }
+ else
+ {
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . "
+ WHERE user_id = $user_id
+ AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ }
+
$result = $db->sql_query($sql);
$member = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -340,6 +352,8 @@ switch ($mode)
trigger_error('NO_USER');
}
+ $user_id = (int) $member['user_id'];
+
// Do the SQL thang
$sql = 'SELECT g.group_id, g.group_name, g.group_type
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug