Display poll results after voting even if you can change said vote

git-svn-id: file:///svn/phpbb/trunk@5078 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2005-01-26 13:37:29 +00:00
parent c8b0cdc0e8
commit 3f88d08672

View file

@ -274,14 +274,16 @@ if ($forum_password)
// Redirect to login or to the correct post upon emailed notification links
if (isset($_GET['e']))
{
$jump_to = (int) $_GET['e'];
$jump_to = request_var('e', 0);
$redirect_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id";
if ($user->data['user_id'] == ANONYMOUS)
{
login_box($redirect_url . "&p=$post_id&e=$jump_to", $user->lang['LOGIN_NOTIFY_TOPIC']);
}
else if ($jump_to > 0)
if ($jump_to > 0)
{
// We direct the already logged in user to the correct post...
redirect($redirect_url . ((!$post_id) ? "&p=$jump_to" : "&p=$post_id") . "#$jump_to");
@ -390,6 +392,7 @@ if ($config['allow_bookmarks'] && $user->data['user_id'] != ANONYMOUS && request
$db->sql_query($sql);
meta_refresh(3, $viewtopic_url);
$message = (($bookmarked) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']) . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
trigger_error($message);
}
@ -559,7 +562,9 @@ if (!empty($poll_start))
(($poll_length != 0 && $poll_start + $poll_length > time()) || $poll_length == 0) &&
$topic_status != ITEM_LOCKED &&
$forum_status != ITEM_LOCKED) ? true : false;
$s_display_results = (!$s_can_vote || ($s_can_vote && $voted_id) || $view == 'viewpoll') ? true : false;
$s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
echo ">$s_can_vote :: >$s_display_results :: >$voted_id";
if ($update && $s_can_vote)
{
@ -619,10 +624,10 @@ if (!empty($poll_start))
$user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000);
}
//, topic_last_post_time = ' . time() . "
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET poll_last_vote = ' . time() . "
WHERE topic_id = $topic_id";
//, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
$db->sql_query($sql);
meta_refresh(5, "viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id");