fetch_assoc(); $user = exec_stmt('SELECT user_id, username, email, role_id, created_at, last_active, is_active, profile_picture FROM user WHERE user_id = ?', 'i', $user_id)->fetch_assoc(); if ($user == null) header('Location: articles.php?view=sort&sort=newest'); $view = '

' . $user['username'] . '

'; if ($_SESSION['user_id'] != $user_id && !$following) { $view .= ' '; } else if ($following) { $view .= '
'; } $view .= '
'; // TODO: Allow user to update profile picture. // // if ((isset($_SESSION['user_id']) && $_SESSION['user_id'] == $user_id) || (isset($_SESSION['role_id']) && $_SESSION['role_id'] <= 2)) { $view .= '

User Actions

'; } else { $ids = articles_ids_by_author($_GET['user_id']); $view .= '
'; foreach ($ids as $id) $view .= article_card($id); $view .= '
'; } return $view; }