Code: Select all
Code: Select All
$template->assign_block_vars('poll_option', array(
'POLL_OPTION_ID' => $poll_option['poll_option_id'],
'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
'POLL_OPTION_PERCENT' => $option_pct_txt,
'POLL_OPTION_PCT' => round($option_pct * 100),
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
);
Code: Select all
Code: Select All
if($s_hide_results)
{
$template->assign_block_vars('poll_option', array(
'POLL_OPTION_ID' => $poll_option['poll_option_id'],
'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
'POLL_OPTION_RESULT' => '?',
'POLL_OPTION_PERCENT' => '?',
'POLL_OPTION_PCT' => round($option_pct * 0),
'POLL_OPTION_IMG' => $user->img('poll_center', '?', round($option_pct * 0)),
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
);
}
else
{
$template->assign_block_vars('poll_option', array(
'POLL_OPTION_ID' => $poll_option['poll_option_id'],
'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
'POLL_OPTION_PERCENT' => $option_pct_txt,
'POLL_OPTION_PCT' => round($option_pct * 100),
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
);
}
I agree with this suggestionChriZathens wrote: Will you consider adding a switch to make the hide result function optional?
It's more handy this way, since you don't need all the polls results to be hidden...
Try this:CrimsonThunder wrote:Sounds great, I was just looking for this too. >_> Got it from a google search.
Just wondering if theres a possibility to make it so only Admins can create these polls?
Code: Select all
<hr class="dashed" />
<dl>
<dt><label for="poll_hide_results">{L_POLL_HIDE_RESULTS}:</label></dt>
<dd><label for="poll_hide_results"><input type="checkbox" id="poll_hide_results" name="poll_hide_results"{HIDE_RESULTS_CHECKED} /> {L_POLL_HIDE_RESULTS_EXPLAIN}</label></dd>
</dl>
Code: Select all
<!-- IF U_ACP -->
<hr class="dashed" />
<dl>
<dt><label for="poll_hide_results">{L_POLL_HIDE_RESULTS}:</label></dt>
<dd><label for="poll_hide_results"><input type="checkbox" id="poll_hide_results" name="poll_hide_results"{HIDE_RESULTS_CHECKED} /> {L_POLL_HIDE_RESULTS_EXPLAIN}</label></dd>
</dl>
<!-- ENDIF -->
Code: Select all
<tr>
<td class="row1"><b class="genmed">{L_POLL_HIDE_RESULTS}:</b><br /><span class="gensmall">{L_POLL_HIDE_RESULTS_EXPLAIN}</span></td>
<td class="row2"><input type="checkbox" class="radio" name="poll_hide_results"{HIDE_RESULTS_CHECKED} /></td>
</tr>
Code: Select all
<!-- IF U_ACP -->
<tr>
<td class="row1"><b class="genmed">{L_POLL_HIDE_RESULTS}:</b><br /><span class="gensmall">{L_POLL_HIDE_RESULTS_EXPLAIN}</span></td>
<td class="row2"><input type="checkbox" class="radio" name="poll_hide_results"{HIDE_RESULTS_CHECKED} /></td>
</tr>
<!-- ENDIF -->
I 2nd these suggestions, especially those in regards to admin/moderators being able to see results regardless.CrimsonThunder wrote: All that I have to say is that it should be allowed that Admins and Mods can view the results!(And perhaps the topic creator) And that "Total Votes: *Amount*" should be un-viewable. If thats possible.
Maybe a "Make infinate private poll" just for those occations where you want no one else to know the results of a poll. This would of course need it so the admin can see it. ^^;
I don't know how too.Litos wrote:At the moment, I don't really have the time to work on the mod. Once I find some more spare time, I want to add an option for the admin to choose whether the total number of votes should be hidden as well and maybe (if this is possible) an option to prevent the editing of polls while they are hidden. Those were the features I wanted to add before submitting it to the mod database.
Allowing admins and mods to view the results is something which I definitely don't want in my forum, so unless I really have a lot of time and nothing else to do, I probably won't work in that direction. However, this is mod is under the GPL, so anyone is welcome to implement these changes themselves.