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 && isset($following) && !$following) {
$view .= '
';
} else if (isset($following) && $following) {
$view .= '
';
}
$view .= '
';
// TODO: Allow user to update profile picture.
//
//
' . update_profile_picture_form() . '
if ((isset($_SESSION['user_id']) && $_SESSION['user_id'] == $user_id) || (isset($_SESSION['role_id']) && $_SESSION['role_id'] <= admin)) {
$view .= '
User Actions
' . reset_pw_form() . '
' . update_email_form() . '
' . update_username_form() . '
' . request_role_change_form() . '
' . delete_account_form() . '
';
} else {
$ids = articles_ids_by_author($_GET['user_id']);
$view .= '
';
foreach ($ids as $id)
$view .= article_card($id);
$view .= '
';
}
return $view;
}