isAuthenticated()) { $user = $api->getAuthorizedUser(); echo 'Welcome ' . ($user->name ?? $user->username) . '
'; } try { $poll_token = array_key_exists('polltoken', $_GET) ? $_GET['polltoken'] : null; $poll = $api->getPoll($poll_id, $poll_token); } catch (NotFoundException $nfe) { die('Poll not found'); } catch (NotSupportedPollException $nspe) { die('Sorry, this poll has a not yet supported type: ' . $nspe->getMessage()); } catch (PollAccessRestrictedException $are) { $message = array_key_exists('polltoken', $_GET) ? 'Sorry, your poll token is invalid! Please enter a valid token: ' : ('Sorry, this poll is private! If you have found this poll on a post, ' . 'please enter a link to the post, the post ID or the access token for the poll: '); die( $message . '
' . '
' ); } #echo json_encode($poll); #$user_avatar_url = $api->getAvatarUrl($poll->user->id, 50); $user_avatar_url = $poll->user->getAvatarUrl(50); #$prompt = '@' . $poll->user->username . ' asks: ' . $poll->prompt; $username = '@' . $poll->user->username; #echo ''; #echo $prompt; $disabled = $poll->canVote() ? '' : 'disabled'; ?>
asks: prompt ?>
options as $option) { $checked = $option->is_your_response ? 'checked' : ''; ?>
/> text ?>