1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-25 17:41:25 +02:00

- 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
This commit is contained in:
Meik Sievertsen
2006-08-03 15:23:34 +00:00
parent 650007a5f1
commit 82f42bb5fa
16 changed files with 351 additions and 298 deletions

View File

@@ -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