diff --git a/res/forum/api/get_posts.php b/res/forum/api/get_posts.php index d9b14a6..a1a63f5 100644 --- a/res/forum/api/get_posts.php +++ b/res/forum/api/get_posts.php @@ -28,6 +28,15 @@ while (($res = $out -> fetch_assoc())) $buffer_array[$key] = $value; } + $author_buffer = $database -> query("SELECT username FROM user WHERE id=" . $value); + if ($author_buffer -> num_rows == 1) + { + $buffer_array["username"] = ($author_buffer -> fetch_assoc())["username"]; + } else + { + $buffer_array["username"] = "[odstraněn]"; + } + array_push($output, $buffer_array); }