get editing user correctly

git-svn-id: file:///svn/phpbb/trunk@6600 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-11-18 10:37:10 +00:00
parent 40f0a1ea15
commit 5f788b4d08

View file

@ -980,6 +980,9 @@ while ($row = $db->sql_fetchrow($result))
'search' => '', 'search' => '',
'age' => '', 'age' => '',
'username' => $row['username'],
'user_colour' => $row['user_colour'],
'warnings' => 0, 'warnings' => 0,
); );
} }
@ -1013,6 +1016,9 @@ while ($row = $db->sql_fetchrow($result))
'rank_image' => '', 'rank_image' => '',
'rank_image_src' => '', 'rank_image_src' => '',
'username' => $row['username'],
'user_colour' => $row['user_colour'],
'online' => false, 'online' => false,
'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$poster_id"), 'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$poster_id"),
'www' => $row['user_website'], 'www' => $row['user_website'],
@ -1306,8 +1312,15 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
if ($row['post_edit_reason']) if ($row['post_edit_reason'])
{ {
$user_edit_row = $post_edit_list[$row['post_edit_user']]; // User having edited the post also being the post author?
$display_username = (!$row['post_edit_user']) ? get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']) : get_username_string('full', $row['post_edit_user'], $user_edit_row['username'], $user_edit_row['user_colour']); if (!$row['post_edit_user'] || $row['post_edit_user'] == $poster_id)
{
$display_username = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']);
}
else
{
$display_username = get_username_string('full', $row['post_edit_user'], $post_edit_list[$row['post_edit_user']]['username'], $post_edit_list[$row['post_edit_user']]['user_colour']);
}
$l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time']), $row['post_edit_count']); $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time']), $row['post_edit_count']);
} }
@ -1318,7 +1331,16 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$user_cache[$row['post_edit_user']] = $post_edit_list[$row['post_edit_user']]; $user_cache[$row['post_edit_user']] = $post_edit_list[$row['post_edit_user']];
} }
$display_username = (!$row['post_edit_user']) ? get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']) : get_username_string('full', $row['post_edit_user'], $user_cache[$row['post_edit_user']]['username'], $user_cache[$row['post_edit_user']]['user_colour']); // User having edited the post also being the post author?
if (!$row['post_edit_user'] || $row['post_edit_user'] == $poster_id)
{
$display_username = get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']);
}
else
{
$display_username = get_username_string('full', $row['post_edit_user'], $user_cache[$row['post_edit_user']]['username'], $user_cache[$row['post_edit_user']]['user_colour']);
}
$l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time']), $row['post_edit_count']); $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time']), $row['post_edit_count']);
} }
} }