From 0095ef14fa72f08e8176ea6bfedd5f46657336df Mon Sep 17 00:00:00 2001 From: aymm Date: Sat, 10 Apr 2021 14:24:09 +0200 Subject: [PATCH] Only showing # of responsends if it's > 0 --- view_poll.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/view_poll.php b/view_poll.php index 0bb1931..b14e936 100644 --- a/view_poll.php +++ b/view_poll.php @@ -112,13 +112,15 @@ if (array_key_exists('poll_created', $_GET) && $_GET['poll_created'] == 1) { ?> $input_type = $poll->max_options === 1 ? 'radio' : 'checkbox'; $input_name = $poll->max_options === 1 ? 'options' : 'options[]'; foreach ($poll->options as $option) { - $checked = $option->is_your_response ? 'checked' : ''; ?> + $checked = $option->is_your_response ? 'checked' : ''; + $num_respondents_text = $option->respondents > 0 ? ' (' . $option->respondents . ')' : ''; + ?>
value="position ?>" name=""/> - text . ' (' . $option->respondents . ')'?> + text . $num_respondents_text?>
respondent_ids as $res_id) {