From a8d99f2228cc042c8410553f5f3ec375148552f5 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 12 May 2006 20:52:58 +0000 Subject: - introduce new function build_url to easily build a valid url from the user->page object as well as optionally removing certain keys - changed attachment config to utilize the config build methods - cleaned up posting.php - the submit/delete_post functions are now usable (functions_posting.php) - adjusted header icons (transparency) - a bunch of fixes for mssql - bug fixes git-svn-id: file:///svn/phpbb/trunk@5902 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_user.php') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index b722549720..533f7b9ef7 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -139,6 +139,7 @@ function user_delete($mode, $user_id, $post_username = false) GROUP BY topic_id"; $result = $db->sql_query($sql); + $topic_id_ary = array(); while ($row = $db->sql_fetchrow($result)) { $topic_id_ary[$row['topic_id']] = $row['total_posts']; @@ -199,7 +200,7 @@ function user_delete($mode, $user_id, $post_username = false) set_config('newest_user_id', $row['user_id']); set_config('newest_username', $row['username']); } - $db->freeresult($result); + $db->sql_freeresult($result); } set_config('num_users', $config['num_users'] - 1, true); @@ -1226,6 +1227,12 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow { if (isset($group_attributes[$attribute]) && !in_array($attribute, $group_only_ary)) { + // If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set... + if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute]) + { + continue; + } + $sql_ary[str_replace('group', 'user', $attribute)] = $group_attributes[$attribute]; } } @@ -1618,6 +1625,12 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal { if (isset($group_attributes[$attribute])) { + // If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set... + if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute]) + { + continue; + } + settype($group_attributes[$attribute], $type); $sql_ary[str_replace('group_', 'user_', $attribute)] = $group_attributes[$attribute]; } -- cgit v1.2.1