Guest can view polls

This commit is contained in:
Roman Kelesidis 2024-05-28 18:05:50 +07:00
parent 5a46aef7df
commit 46102c0e95
2 changed files with 3 additions and 1 deletions

View File

@ -127,8 +127,10 @@ function html2text (str)
<table id="poll-votes-block" class="borderless bCenter"></table>
<!-- IF not POLL_ALREADY_VOTED && SHOW_VOTE_BTN -->
<!-- IF !IS_GUEST -->
<div id="vote-btn-a" class="mrg_8 tCenter">[ <a href="#" onclick="build_votes(); return false;" class="gen"><b>{L_SUBMIT_VOTE}</b></a> ]</div>
<div id="vote-btn-input" class="mrg_6 tCenter" style="display: none;"><input onclick="window.location.reload();" type="button" class="bold" value="{L_CANCEL}" />&nbsp;&nbsp;<input type="button" onclick="submit_vote(); return false;" value="{L_SUBMIT_VOTE}" class="bold" /></div>
<!-- ENDIF -->
<!-- ELSEIF not SHOW_VOTE_BTN -->
<div class="mrg_8 tCenter">[ <b>{L_NEW_POLL_END}</b> ]</div>
<!-- ENDIF -->

View File

@ -538,7 +538,7 @@ $sel_post_order_ary = array(
$lang['NEWEST_FIRST'] => 'desc',
);
$topic_has_poll = ($t_data['topic_vote'] && !IS_GUEST);
$topic_has_poll = ($t_data['topic_vote']);
$poll_time_expired = ($t_data['topic_time'] < TIMENOW - $bb_cfg['poll_max_days']*86400);
$can_manage_poll = ($t_data['topic_poster'] == $userdata['user_id'] || $is_auth['auth_mod']);
$can_add_poll = ($can_manage_poll && !$topic_has_poll && !$poll_time_expired && !$start);